Java language.
Write a short program that allows the user to enter the year that they were born (as an integer) and outputs the age that they will be at the end of this year. Declare the current year as a constant.
//AgeFromYear.java import java.util.Scanner; public class AgeFromYear { public static void main(String[] args) { final int CURRENT_YEAR = 2020; Scanner scnr = new Scanner(System.in); System.out.print("Enter the year that they were born: "); int year = scnr.nextInt(); System.out.println("Age: "+(CURRENT_YEAR-year)); } }
Java language. Write a short program that allows the user to enter the year that they...
Write a short program in Java that asks the user for an integer. Then ask the user for a letter. Print out the letter followed by the integer.
write pseudocode to represent the logic of a program that allows the user to enter a value for the radius of a circle. The program calculates the diameter by multiplying the radius by 2, and then calculates the circumference by multiplying the diameter by 3.14. The program outputs both the diameter and the circumference.
In C++ Write a program that allows the user to enter eight integer values. Display the values in the reverse order of the order they were entered. Name the file ReverseNumbers.cpp.
Write a program in Java language to prompt the user to enter 3 integers (A, B, and C) then display these numbers from the lowest to the highest (sorted ascendingly) . Note that there are 6 different cases to handle proper order. As an example, a user entered 10 for A, 5 for B and 14 for C: the output of the program should look like this Enter number A? 10 Enter number B? 5 Enter number C? 14 Your...
In Visual Basics - Program 2. Mileage Write a program which allows the user to enter the distance they have traveled by car in miles and the number of gallons of gasoline they used to travel the distance. Be sure to allow for decimal places for both values. Your results should show miles per gallon and kilometers per gallon. A kilometer is 0.61 miles, and this value must be stored as a constant. Your outputs must be formatted to 2...
Write a java program that asks the user to enter an integer. The program should then print all squares less than the number entered by the user. For example, if the user enters 120, the program should display 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, and 100.
Use Java language to create this program Write a program that allows two players to play a game of tic-tac-toe. Using a two-dimensional array with three rows and three columns as the game board. Each element of the array should be initialized with a number from 1 - 9 (like below): 1 2 3 4 5 6 7 8 9 The program should run a loop that Displays the contents of the board array allows player 1 to select the...
Write java program that prompts the user to enter integers from the keyboard one at a time. Program stops reading integers once the user enters the same value three times consecutively. Program then outputs "Same entered 3 in a row. "
Java language: C Write a game program that allows the user to collect 4 tokens hidden in an array (cells) of size 10. The program asks the user to select a cell. Determine if there is a token in that cell or not, and give the user appropriate feedback. This program should keep letting user to select until the all tokens are collected. The program should display the total number of selections. Use rand_position Example input/output: There are four tokens....
# C++ Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter two values. The program outputs the sum of and the difference between the two values.