These exercises allow you to practice getting input
from the keyboard using the Scanner class.
Put your code in a new empty Java file named "InputExercises.java", and make sure to name the class InputExercises.
Start with a structure similar to VariableExercises.java, where you had a method called main() and then three other methods: part1(), part2(), and part3().
Ask the user for two words and two numbers, and let the person at the keyboard type in some values, but don't bother storing their responses into any variables.
Again, there is no need to create any variables,
except for the Scanner variable typically
named keyboard.
Give me a word! lorry! Give me a second word! deoxyribonucleic? Great, now your favorite number? 42 And your second-favorite number... 1 Whew! Wasn't that fun?
Ask the user for their name. Then display their name to prove that you can recall it. Ask them for their age. Then display that. Finally, ask them for how much they make and display that. You should use the most appropriate data type for each variable.
Hello. What is your name? Dennis Hi, Dennis! How old are you? 37 So you're 37, eh? That's not old at all! How much do you make, Dennis? 8.50 8.5! I hope that's per hour and not per year! LOL!
Ask the user for several pieces of information, and display them on the screen afterward as a summary.
Please enter the following information so I can sell it for a profit! First name: Helena Last name: Bonham-Carter Grade (9-12): 12 Student ID: 453916 Login: bonham_453916 GPA (0.0-4.0): 3.73 Your information: Login: bonham_453916 ID: 453916 Name: Bonham-Carter, Helena GPA: 3.73 Grade: 12