Code
/// Name: Afaf Nabeeha
/// Period: 7
/// Program Name: Refresher Challenge
/// File Name: Challenge.java
/// Date Finished: 3/8/2016 public class Challenge
import java.util.Scanner;
public class Challenge
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String name;
System.out.print( "Your name: " );
name = keyboard.next();
System.out.println();
if ( name.equals("Josh"))
{
for ( int x = 0; x <= 5; x++)
{
System.out.println( "Josh" );
}
}
while ( !name.equals("Josh"))
{
System.out.println(name);
System.out.println(name);
System.out.println(name);
System.out.println(name);
System.out.println(name);
System.out.println(name);
System.out.println(name);
System.out.println(name);
System.out.println(name);
System.out.println(name);
name = "Josh";
}
}
}
Picture of the output