Assignemnt #108: A Refresher
Code
/// Name: Kelsey Lieberman
/// Period 5
/// Program Name: ARefresher
/// File Name: ARefresher.java
/// Date Finished: 2/9/2016
import java.util.Scanner;
public class ARefresher
{
public static void main( String[] args )
{
String name;
int x;
Scanner keyboard = new Scanner(System.in);
System.out.println("What is your name?");
System.out.print(">");
name = keyboard.next();
if (name.equalsIgnoreCase("Josh"))
x = 5;
else
x = 10;
for (int n = 1; n <= x; n++)
System.out.println(name);
}
}
Picture of the output