Java Loop Help
Go to solution
Solved by x7ASSASSIN7x,
import java.util.Scanner;
public class Name {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner keyboard = new Scanner(System.in);
Scanner keyboard1 = new Scanner(System.in);
String name;
int i;
System.out.println("How many times would you like to print your name?");
i = keyboard.nextInt();
int m = i;
System.out.println("What is your name?");
name = keyboard1.nextLine();
do
{
System.out.println(name);
m--;
}while(m!=0);
}
}
Switch the statements to the way you would like them to look
Switch the statements to the way you would like them to look
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now