Assignemnt #108 and Counting with a For Loop
Code
/// Name: Marco Correa
/// Period: 5
/// Program Name: A Refresher
/// File Name: A Refresher.java
/// Date Finished: 4/2/2016
import java.util.Scanner;
public class ARefresher
{
public static void main(String[] args)
{
Scanner k = new Scanner(System.in);
int max = 10;
System.out.print("What is your name: ");
String name = k.next();
System.out.println();
if ( name.equals("Josh") )
max = 5;
for (int i = 0; i < max; i++){
System.out.println(name);
}
}
}
Picture of the output