Assignemnt #109: Refresher Challenge
Code
/// Name: Kelsey Lieberman
/// Period 5
/// Program Name: RefresherChallenge
/// File Name: RefresherChallenge.java
/// Date Finished: 2/9/2016
import java.util.Scanner;
public class RefresherChallenge
{
public static void main( String[] args )
{
String name;
int x = 10;
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;
for (int n = 1; n <= x; n++)
System.out.println(name);
}
}
Picture of the output