Assignemnt #108
Code
///Name: Joshua Bautista
///Period: 6
///Date: 5/9/2016
import java.util.Scanner;
public class R
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String name;
System.out.println();
System.out.print( "What is your name: " );
name = keyboard.next();
System.out.println();
if ( name.equals("George") )
{
for ( int times = 0; times < 5; times = times + 1 )
{
System.out.println( name );
}
}
if ( !name.equals("George") )
{
for ( int times = 0; times < 10; times = times + 1 )
{
System.out.println( name );
}
}
System.out.println();
}
}
Picture of the output