Assignment #108 and A Refresher
Code
/// Name: Graham Pollock
/// Period: 5
/// Program Name: A Refresher
/// File Name: ARefresher.java
/// Date Finished: 04/13/2016/
import java.util.Scanner;
public class ARefresher
{
public static void main(String[] args)
{
Scanner kb = new Scanner(System.in);
String name;
System.out.print("What is your name: ");
name = kb.next();
System.out.println("");
if (name.equals("josh"))
{
for (int n = 0; n < 5; n++)
{
System.out.println(name);
}
}
else
{
for (int n = 0; n < 10; n++)
{
System.out.println(name);
}
}
System.out.println("");
}
}
Picture of the output