Assignemnt #104 Refresher
Code
/// Name: JJ Deng
/// Period: 6
/// Program Name: Refresher
/// File Name: Refresher.java
/// Date Finished: 4/24/2016
import java.util.Scanner;
public class Refresher
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
System.out.print("What is your name? ");
String name = keyboard.nextLine();
System.out.println("\n");
int times = 5 + ( name.equals("Josh")? 0 : 5);
for (int i = 0; i < times; i++ )
System.out.println(name);
}
}
Picture of the output