Question: Write a piece of code that prompts the user for a number and then prints a different message depending on whether the number was an
Write a piece of code that prompts the user for a number and then prints a different message depending on whether the number was an integer or a real number. Here are two sample dialogues:
Type a number: 42.5
You typed the real number 42.5
Type a number: 3
You typed the integer 3
Step by Step Solution
3.35 Rating (164 Votes )
There are 3 Steps involved in it
code import javautilScanner class MyClass public static void mainString args Scan... View full answer
Get step-by-step solutions from verified subject matter experts
