CSE 142 Homework 2

April 15, 2003

 

Purpose: This homework has three parts, with the following goals.

        The goal of the first part is to practice your modeling and design skills.

        The second and third part should improve your programming skills, including loops.

 

Turn-in and due date: The due date is Tuesday April 22 at 9 pm for electronic turn-ins, and Wednesday April 23 in lecture for paper copy turn-in. More below.

 

Time: Parts 1 and 2 should take 1-2 hours. Part 3 will likely take several hours. Make sure you manage your time efficiently.


1 – Modeling

 

Purpose: To practice your modeling skills.

 

Procedure: You need to create a high-level design for a mobile phone. In the earlier media player assignment you were free to express your design any way you wanted to. However, this time you should closely follow the format of the sample media player design provided as a solution to homework 1.

 

Turn-in: Please turn in a single document using the web turn-in form.  The due date is Tuesday April 22 at 9 pm. The best way to ensure that your TA can read your document is to use a recent version of word, or a plain text editor.

 

Hints:


2 – Calculator Extensions

 

Purpose: Practicing your programming skills and introducing loops.

 

Procedure: Using either your own calculator or the sample solution code for homework 1 (Calculator.java, CalculatorTestHarness.java), add the following functionality:

You also need to modify the test harness provided with homework 1 to test the new calculator functionality.

 

Turn-in: Turn in the new versions of Calculator.java and CalculatorTestHarness.java using the web form, before 9 pm Tuesday April 22. Also hand in the Turin-in Receipt at the beginning of lecture Wednesday April 23.

 

Hints:


3 – The Paper Street Soap Company

 

Purpose: Practice using the code constructs you have learned about so far, particularly conditional statements.

 

Problem: The Paper Street Soap Company sells handmade bars of soap, which are distributed in sheets of recycled paper.

Your eventual assignment is to write the software that controls the operation of the soap-wrapping machine.   Only a part of the code is due on April 22.  The remainder will be due the following week, as a part of Homework 3.

 

Turn-in: Turn in Paper.java, Soap.java and SoapPaperHarness.java using the web turn-in form, before 9 pm Tuesday April 22. Also turn in the Receipt at the beginning of lecture Wednesday April 23. 

 

More Information:

For the First Week's Assignment:

Hints: