CSCI 161 - Assignment #2: ComputePay

Overview

For this assignment refer to problem #19 from Chapter 2 in your blue-covered Millersville edition of the textbook as well as in the regular (full) edition of the textbox. If you have a different book (older or newer version) the problem number may vary, and may be #17, etc. Look for the program called "ComputePay

For the actual problem in question from the book, click here.

Following the instructions in the problem, develop a Java application named ComputePay with class of the same name and submit to me using the submit tool.

The objectives of this assignment are to reinforce and help teach:

Instructions

Following are the instructions and you should follow them carefully:

  1. Using Eclipse create a new Java Project and name it: ComputePay
  2. As with all your labs, add a class of the same name, ComputePay, and include in that class a main method.
  3. The program and its main method should start out exactly as in the book, then once you have it working, update to remove reduntant expressions with special instructions below:
    1. The problem per the textbook only lists 4 different hour amounts (4, 5, 8, 4). Assume those are the daily hours for the work days Monday, Tuesday, Wednesday, and Thursday, respectively and in the order listed (e.g. no Friday hours).
    2. You should declare and use variables for all data and only use literals/expressions in variable assignments and then with a given literal or expression only used once within the program. This is contrary to the problem in the book and its instruction to only use variables for redundant expressions (for example, tax rate is only used once, but you should still have a variable for it).
    3. The instructor's sample solution used 9 variables. It is a good idea for your solution to use the same number and for the appropriate reasons for full credit.
    4. This assignment will be graded.
  4. Your program should output according to the "Output Format" below.
  5. Iteratively develop the assignment (get the original program from the book working, test it, update it to remove expression redundancy, fix syntax errors, continue until finished).
  6. When the lab is complete and working submit ComputePay.java via AutoLab.

Output Format

Following is an example of the desired output format:

My total hours worked:
21
My hourly salary:
8.75
My total pay:
183.75
My taxes owed:
36.75
            

Deadline

This assignment must be submitted to the instructor by 11:59:59pm on Monday, September 11th.