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:
- proper Java program class construction, purpose of the main method and use of other methods that each perform a smaller part of the overall problem
- use of variables
- Java arithmetic operations
Instructions
Following are the instructions and you should follow them carefully:
- Using Eclipse create a new Java Project and name it: ComputePay
- As with all your labs, add a class of the same name, ComputePay, and include in that class a main method.
- 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:
- 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).
- 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).
- 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.
- This assignment will be graded.
- Your program should output according to the "Output Format" below.
- 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).
- 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 via AutoLab by 11:59:59pm on Monday. Refer to AutoLab for the specific due date.