Question: Do the following in Java code: Declare a Scanner type object reference Create a new Scanner object that will read from System.in. Assign the new

Do the following in Java code:

  1. Declare a Scanner type object reference
  2. Create a new Scanner object that will read from System.in. Assign the new object to your object reference
  3. Prompt the user to enter their name. Read in their input and store it in a variable.
  4. Prompt the user to enter how many teeth they have in their upper jaw. Read in their input and store it in a variable. Multiple that value by two and display the result.
  5. Prompt the user to enter a joke. Read in their input and echo it back to the user.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!