A Refresher
Code
/// Name: Rachel Smith
/// Period: 5
/// Program Name: A Refresher
/// File Name: Refresher.java
/// Date Finished: 1/15/2016
import java.util.Scanner;
public class Refresher {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.println();
System.out.print( "What is your name: " );
String name = keyboard.next();
System.out.println();
if ( name.equals( "Josh" ) ) {
for ( int i=0; i<5; i++) {
System.out.println( name );
}
} else {
for ( int j=0; j<10; j++) {
System.out.println( name );
}
}
}
}
Picture of the output