Question: Write an application InputApplication. (An application has a main method.) Create a Scanner object and do the following.. Ask the user to enter a word
Write an application InputApplication. (An application has a main method.)
Create a Scanner object and do the following..
- Ask the user to enter a word using this exact prompt: System.out.print("Enter a word: ");
- Use Scanner's next method to get the word
- Print the last letter of the word
- Ask the user to enter a double using this exact prompt: System.out.print("Enter a double: ");
- Use Scanner's nextDouble method to get the double
- Now ask the user to enter a integer using this prompt: System.out.print("Enter an integer: ");
- Use Scanner's nextInt method to get the integer
- Calculate the product of the double and the integer (Product means multiply)
- Print the product on a new line.
- Print the integer portion of the product on a new line.(Think cast)
Only create one Scanner.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
