Question
Task #2 Using the Scanner Class for User Input In this task you will read in the users name, and let the user enter values
Task #2 Using the Scanner Class for User Input
In this task you will read in the users name, and let the user enter values to replace the hard-coded values in Task #1. 1. Add an import statement above the class declaration to make the Scanner class available to your program.
2. In the main method, create a Scanner object and connect it to the System.in object. Reuse this Scanner object to read in each of the following entries. 3. Prompt the user to enter the first score. 4. Read the first score from the keyboard using the nextLine() method, and store it into the variable called score1 (comment out the line that originally defined score1).
5. Prompt the user to enter the second score. 6. Read the second score from the keyboard using the nextLine() method, and store it into the variable called score2 (comment out the line that originally defined score2). 7. Prompt the user to enter another temperature in Celsius after the original temperature conversion is printed out. 8. Read the temperature and print out the result in Fahrenheit. 9. Compile, debug, and run, using other score values as test data. 10. Submit your completed NumericTypes.java to Blackboard (NOT the class file).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started