Assignment 3
Due Friday, April 24 at 11:59apm on Canvas


Pair Programming (Half Credit for Not Pair Programming)
  • Both partners fill in, sign, date, and submit the pair programming contract
  • Upload the document(s) along with your Lab code to Canvas.
  • Please make sure both your names are on your file (hint: use a comment).
  • If you need help finding a partner, please contact me as soon as possible.

Assignment 3: My Pair Programming Partner and Me (10 pts)
  • Open up a new Java project in Eclipse.
  • Name the project Assignment3
  • Add a new class to your project also named Partner
  • Inside of Partner.java, write your name and section info at the very top of the file by placing them inside of a multi-line comment, like so:
/**
* @author First Partner's Name Here
* @author Second Partner's Name Here
* CIS 36A, Assignment 3
*/
  • The objective of your program is to store some values in a variable and then print those values to the console.
  • It will also help you to get to know your partner better
  • Now, declare 10 new variables at the beginning of your program
  1. Four chars
  2. Two integers
  3. Two doubles
  4. Two booleans
  • The char variables will be used to store the first initial of your first name, the first initial of your last name, the first initial of your partner's first name, and the first initial of your partner's last name. Give these four (4) variables appropriate names of your choice.
  • The integer variables will be used to store the number of quarters you and your partner have studied at De Anza, respectively. Give these two (2) variables appropriate names of your choice.
  • The double variable will be used to store the number of units you and your partner are taking this quarter. Give these two (2) variables appropriate names of your choice.
  • The boolean variable will be used to store whether you and your partner are majoring in computer science. Give these two (2) variables appropriate names of your choice.
  • Next, assign the correct value to each of these variables. You many do this on the same line in which you declared the variables, or on a separate line.
  • For example, you might have a statement that looks like this:

char firstInitial1 = 'J';

  • Or, you might have 2 statements that look like this:

char firstInitial1;
firstInitial1 = 'J';
  • Both options are correct.
  • Next, you will print out the contents of these variables using System.out.print() statements.
  • You need 8 System.out.println statements in total, as follows:
    • Statement 1 should say: Pair Programming Partners for CIS 36A:
    • Statement 2 should say: Our initials are <first initial partner1><last initial partner1> and <first initial partner2><last initial partner2>.
    • Statement 3 should say: <first initial partner1><last initial partner1> has studied at De Anza for <quarters partner 1> quarters.
    • Statement 4 should say: <first initial partner2><last initial partner2> has studied at De Anza for <quarters partner 2> quarters.
    • Statement 5 should say: <first initial partner1><last initial partner1> is taking <units partner 1> units this quarter.
    • Statement 6 should say: <first initial partner2><last initial partner2> is taking <units partner 2> units this quarter.
    • Statement 7 should say: <first initial partner1><last initial partner1> is a computer science major: <cs major partner 1>
    • Statement 8 should say: <first initial partner2><last initial partner2> is a computer science major: <cs major partner 2>
  • Thus, when your program is run, the output should be identical to the following (except your information will be below, not my sample information):
Pair Programming Partners for CIS 36A:
Our initials are JP and GA.
JP has studied at De Anza for 5 quarters.
GA has studied at De Anza for 2 quarters.
JP is taking 12.5 units this quarter.
GA is taking 21.0 units this quarter.
JP is a computer science major: true
GA is a computer science major: false
  • When you are finished, and your output is identical to the sample output above (but with and your partner's information in place of the sample information), submit the Partner.java file to Canvas.
  • Reminder: Look under CIS36A -> Assignment3 -> src  -> Partner.java