Java - Input Projects
1. Create a new Class and call it InputAddition. Write a program that prompts the user for two numbers (int) adds them together and displays the answer.
Sample Output:
Sample Output:
This program will add two numbers together
Enter first number: 10
Enter second number: 25
10 + 25 = 35
2. Create a new Class and call it InputName. Write a program that prompts the user their first name and their last name. These variables should be Strings. Then printout a welcome message using their first and last name.
Sample Output:
Sample Output:
This program will input the users name and print out a welcome message
Enter first name: Bill
Enter last name: Gates
Welcome to Java, Bill Gates!
3. Create a new Class and call it InputArea. Write a program that asks the user for the area (double) of a circle. Then calculate the radius (double) of the circle and print it out. To find the radius of a circle use the formula Math.sqrt(area/Math.PI)
Sample Output:
Sample Output:
This program calculate the radius of a circle with the given area
Enter the area of a circle: 10
The radius of your circle is 1.78