Assignment # 109 and Refresher Challenge

Code

    /// Name: Tommy Oyuntseren
    /// Period: 7
    /// Program Name: RefresherChallenge
    /// File Name: RefresherChallenge.java
    /// Date: 5/4/16

    import java.util.Scanner;
    
    public class RefresherChallenge
    {
        public static void main(String[] args)
        {
            Scanner keyboard = new Scanner(System.in);
            
            int n = 10;
            
            System.out.print("What is your name? ");
            String name = keyboard.next();
        
            System.out.println(" ");
            
            if (name.equals("Josh"))
                n = 5;
            
            for (int x=1; x<=n; x++)
            {
                System.out.println(name);
            }
            
        }
    }
  
    
   

  

Picture of the output

Assignment 109