Discussion 2: Simple Output and Loops

Due: January 30

Purpose: This assignment will familiarize you with basic output facilites of the Java language and also with nested, iterated loops. You should only use the statements we have covered in class (i.e., don't define your own methods yet).


You will write a Java class called Introduction, and turn in a file called Introduction .java . Firstly, your program should produce some messages, like below:

 
Partner 1
---------
 
Name: John Doe
Age: 18
Major in CS because: I want to know how to write computer games.
 
Partner 2
---------
 
Name: John Smith
Age: 19
Major in CS because: I love computers!
    

Your program should print, for each of the two partners, their name, age and a couple of sentences describing why you chose to major in Computer Sciences.

After that, your program should print a rectangle like the following:

            ************
            ************
            ************


In order to do that, you can use two nested loops. The length and the width of the rectangle can be chosen to be any number between 1 and 20.

Here is a template for your lab.

/**

 *
 * @author name 1: discussion section time: 
 * @author name 2: discussion section time: 
 * @version 
 * 
 * Describe what this program does.
 * 
 */
public class Introduction
 
{   
    public static void main (String [] args)
    {
 
    }    
}
  


Submission and Grading:

You will be doing the program in the discussion section on Tuesday.

If you are unable to finish the program in the discussion section, please let the TA know. You may submit the program using the turnin program later that day (by 10:00pm January 30) to receive full credit.