Assignment 1

Be sure to type up your answers so you can submit them electronically on the BlackBoard Connect system. You may complete this assignment individually or with another student in the class. Make sure all your files have your full name and student number on it.

If you worked in a pair, be sure to have both your full names and student numbers on everything. Both of you will need to submit (the same copy) on Blackboard Connect, even though one copy will be graded and you will both get the same mark.

Type up your answers using a text editor as instructed in the labs. The file format of the Java program you are to submit must be .java.

This assignment is marked out of 20 points. If you get 20/20, you will get 5% towards the course grade.

Due Date

September 26, 2013, 11:00PM.

24 Hour Silence Policy

Due to the large class size and the potential volume of questions, we are implementing a 24-hour silence policy. This means that any questions posted on the discussion forum in the 24 hours immediately preceding the assignment deadline may not get answered in time. This does not mean that we will stop answering questions the moment the day before the deadline arrives, it just means that we cannot promise all the questions will be answered in time, due to our prior engagements, such as other classes and meetings we have.

For this reason, please be sure to attempt the assignment early, and try to complete it as if it were due two days prior to the real deadline.

In any case, we will try to answer all the questions that show up on the discussion forum. Note that questions sent to emails will not be answered, as we want all course related material to be viewed for everyone's benefit.

What You Are Given

You are given a partial program that helps restaurant owners receive orders for takeout. The following files are provided for you: Note: You cannot change what is provided in these files (except the author's name and comments you wish to re-word). Changes will result in a lower mark.

Question 1 [7 points]

Complete the constructor method for the TakeOut class. Recall that each class must have a constructor method whose main responsibility is to initialize all the class attributes. In this question, you will need to take each attribute in the TakeOut class and assign it appropriate values.

Question 2 [8 points]

In the TakeOut class, complete the following methods: If you are unclear how and when these methods are used, review the statements inside the main() method in the TestTakeOut class.

Once you get the program working properly (that includes getting both questions 1 and 2 correct), you will see the program generate the following output:

Name:  Jen
Phone: 1234567
Item: , Item: gyoza, Item: , Item: sake, Item: 
Total: 10

Question 3 [5 points]

Using the TestTakeOut class provided to you, add to the main() method statements that process the takeout in the following scenario: Follow the same steps that are used in the statements inside the main() method, you will need to:

To get this working, you only need to call methods in the TakeOut class. More specifically, do not call methods in any other class in the solution for this question here.

Once you get the program working properly (that includes getting questions 1-3 correct), you will now see the program generate the following output:

Name:  Jen
Phone: 1234567
Item: , Item: gyoza, Item: , Item: sake, Item: 
Total: 10

Name:  Ben
Phone: 9876543
Item: edamame, Item: , Item: , Item: , Item: unagi don
Total: 13

What to Submit

For this assignment, submit the following: