Question: Create the scanner object to read input from the user Scanner keyedInput = new Scanner(System.in); // Declare variables int num; String name; // Get the
Create the scanner object to read input from the user
Scanner keyedInput = new Scanner(System.in);
// Declare variables
int num; String name;
// Get the user's name
System.out.println("Please enter your name:"); name = keyedInput.nextLine();
// Get the user's age
System.out.println("Please enter a number:"); num = keyedInput.nextInt();
System.out.println("----------------");
// Print out the user's name, num times, where num is the user's age
for (int i = 1; i <= num; i = i + 1)
{ System.out.println(name); }
Your task is to create A flow chart:
- A program that prompts the user to enter their name, and then a number. A for loop is then used to echo back the user's name the given number of times.
- The flow chart is supposed to be based on the code I inputed above
- I just wanna say thank you for helping me with this I really appreciate it!
Step by Step Solution
There are 3 Steps involved in it
Co... View full answer
Get step-by-step solutions from verified subject matter experts
