ITEC 120 Back to Assignment index page
   
Assignment 2 - Zeta Zeta Zeta - due at midnight on Wed, Feb 23 - submit to RU05 folder

Description: 

The Zeta Zeta Zeta organization is having a fund raiser for their scholarship fund. They are selling small and large boxes of donuts. A small box is $5 and a large box costs $9. The member of Zeta Zeta Zeta who sells the most donuts will receive a Zeta Zeta Zeta sweatshirt. You'll write a program which keeps track of sales for 2 members of Zeta Zeta Zeta.

1. Write a class to represent a member of the Zeta Zeta Zeta organization and their sales.

ZZZmember

- name : String
- smallBoxes : int
- largeBoxes : int

+ ZZZmember(name : String)
+ addSales(small : int, large : int) : void
+ toString() : String

2. Now write a driver that prompts for and reads in two names from the user, creates a ZZZmember object for each, and prompts the user to enter 3 weeks worth of sales for each member. The driver will add the sales to each member and print each member after each week. For example:

Program displays: Please enter a name for the first ZZZ member:
User enters: Fred Sped
Program displays:

Please enter a name for the second ZZZ member:

User enters: Mary Berry
Program displays: How many small boxes did Fred Sped sell in week1?
User enters: 3
Program displays:

How many large boxes did Fred Sped sell in week1?

User enters: 4
Program displays: How many small boxes did Mary Berry sell in week1?
User enters: 2
Program displays: How many large boxes did Mary Berry sell in week1?
User enters: 3
Program displays: Fred Sped    sold 3 small boxes and 4 large boxes for a total of $51
Mary Berry   sold 2 small boxes and 3 large boxes for a total of $37

How many small boxes did Fred Sped sell in week2?
User enters: 5
Program displays: How many large boxes did Fred Sped sell in week2?
User enters: 4
Program displays: How many small boxes did Mary Berry sell in week2?
User enters: 7
Program displays: How many large boxes did Mary Berry sell in week2?
User enters: 2
Program displays:

Fred Sped    sold 8 small boxes and 8 large boxes for a total of $112
Mary Berry   sold 9 small boxes and 5 large boxes for a total of $90

How many small boxes did Fred Sped sell in week3?

User enters: 11
Program displays: How many large boxes did Fred Sped sell in week3?
User enters: 2
Program displays: How many small boxes did Mary Berry sell in week3?
User enters: 3
Program displays: How many large boxes did Mary Berry sell in week3?
User enters: 8
Program displays: Fred Sped    sold 19 small boxes and 10 large boxes for a total of $185
Mary Berry   sold 12 small boxes and 13 large boxes for a total of $177


Submit your finished java files (2 of them) to the RU05 folder in your folder on neelix.