Assignemnt #105 Refresher Challenge

Code


/// Name: JJ Deng
    /// Period: 6
    /// Program Name: Refresher Challenge
    /// File Name: RefresherC.java
    /// Date Finished: 4/25/2016
  
       import java.util.Scanner;

       public class RefresherC
        {
        	public static void main( String[] args )
        	{
        		Scanner keyboard = new Scanner(System.in);
        
        		System.out.print("What is your name? ");
        		String name = keyboard.nextLine();
        		System.out.println("\n");
        
        
        		int times = 5 + ( name.equals("Josh")? 0 : 5);
        
        		for (int i = 0; i < times; i++ )
        			System.out.println(name);
        
        	}
        }


    

Picture of the output

Assignment 110