PROGRAMMING AND CODE


Assignemnt #108

Code

/// Name: Justin Li
/// Period: 7
/// Program Name: A Refresher
/// File Name: ARefresher.java
/// Date Finished: 5/5/2016

import java.util.Scanner;

public class ARefresher
{
    public static void main( String[] args )
    {
        Scanner keyboard = new Scanner(System.in);
        String name;
        System.out.print( "What is your name: " );
        name = keyboard.next();
        if ( name.equals("Josh"))
        {
            for ( int x = 0; x <= 5; x++ )
            {
                System.out.println( name);
            }
        }
        else
        {
            for ( int x = 0; x <= 10; x++ )
            {
                System.out.println(name);
            }
        }
    }
}
    
    

Picture of the output

Assignment 1