Create the scanner object to read input from the user Scanner keyedInput = new Scanner(System.in); // Declare
Fantastic news! We've Found the answer you've been seeking!
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 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!
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: