Assignment #109

Code

      /*
jack newsom
period 5
program RefresherChallenge
filename RefresherChallenge.java
date completed 11/12/2015
*/

import java.util.Scanner;

public class RefresherChallenge
{
    public static void main( String[] args )
    {
        Scanner bot = new Scanner(System.in);
        
        System.out.print("What is your name: ");
        String name = bot.next();
        
        int countTo = 10;
        
        if ( name.equals("Josh") == true )
        {
            countTo = 5;
        }
        
        for ( int counter = 1; counter <= countTo; counter = counter + 1 )
        {
            System.out.println(name);
        }
        
    }
}
    

Picture of the output