Assignment #108
Code
/*
jack newsom
period 5
program Refresher
filename Refresher.java
date completed 11/12/2015
*/
import java.util.Scanner;
public class Refresher
{
public static void main( String[] args )
{
Scanner bot = new Scanner(System.in);
System.out.print("What is your name: ");
String name = bot.next();
if ( name.equals("Josh") == true )
{
for ( int counter = 1; counter <= 5; counter = counter + 1 )
{
System.out.println(name);
}
}
else
{
for ( int counter = 1; counter <=10; counter = counter + 1 )
{
System.out.println(name);
}
}
}
}
Picture of the output