Assignemnt #108 A Refresher
Code
///Name: Morgan Kaplan
///Period: 5
///Project Name: A Refresher
///File Name: Ref.java
import java.util.Scanner;
public class Ref
{
public static void main( String[] args )
{
Scanner momo = new Scanner(System.in);
System.out.println("What is your name?");
String name=momo.next();
if(name.equals("Josh"))
{
for ( int n = 1 ; n <= 4 ; n = n+1 )
{
System.out.println( "Josh" );
}
}
else
{
for ( int n = 1 ; n <= 10 ; n = n+1 )
{
System.out.println( " " + name + " " );
}
}
}
}
Picture of Output