Programming Methods

The human resources department for your company needs a program that will determine how much to deduct from an employee’s paycheck to cover healthcare costs. Health care deductions are based on several factors. All employees are charged at flat rate of $150 to be enrolled in the company healthcare system. If they are married there is an additional charge of $75 to cover their spouse/partner. If they have children, the cost is $50 per child. In addition, all employees are given a 10% deduction in the total cost if they have declared to be a “non-smoker”. Your goal is to create a program that gathers the employee’s name, marital status, number of children and whether or not they smoke tobacco for a single employee. While gathering this information, if the user enters at least one invalid value, the program must display one error message telling the user they made a mistake and that they should re-run the program to try again. The program must then end at this point. However, if all valid values are entered, the program should calculate the total cost of the healthcare payroll deduction and then print a well-formatted report that shows the employee’s name, marital status, total number of children, and smoker designation, and total deduction amount.Copyright © 2019 John Bono, Ph.D. All rights reserved.
1
Programming Assignment 1/2
Scenario:
The human resources department for your company needs a program that will determine how much to
deduct from an employee’s paycheck to cover healthcare costs. Health care deductions are based on
several factors. All employees are charged at flat rate of $150 to be enrolled in the company healthcare
system. If they are married there is an additional charge of $75 to cover their spouse/partner. If they
have children, the cost is $50 per child. In addition, all employees are given a 10% deduction in the total
cost if they have declared to be a “non-smoker”.
Your goal is to create a program that gathers the employee’s name, marital status, number of children
and whether or not they smoke tobacco for a single employee. While gathering this information, if the
user enters at least one invalid value, the program must display one error message telling the user they
made a mistake and that they should re-run the program to try again. The program must then end at
this point. However, if all valid values are entered, the program should calculate the total cost of the
healthcare payroll deduction and then print a well-formatted report that shows the employee’s name,
marital status, total number of children, and smoker designation, and total deduction amount.
Other Requirements:
• Your solution may not use any functions or language constructs not covered during this
semester’s IT 106 without prior authorization from your instructor, even if you know other
functions or language constructs. We want everyone to be on the same “playing field”,
regardless of previous programming exposure, and get practice with algorithmic design to solve
problems (the intent of the course). Using something existing not discussed in class does not
give you as much practice as solving the problem yourself. Doing this may lead to a substantial
grade penalty, a grade of zero, or an Honor Code inquiry. When in doubt, ask!
Hints:
• This assignment has a lot of validation necessary. Think about how you can validate each item
based on what you have learned in lecture.
• This assignment will use multiple selection control structures.
• Your logic for the solution should properly use control structures to determine which portions of
the algorithm are executed. The algorithm should be designed to only exit once the algorithm
Copyright © 2019 John Bono, Ph.D. All rights reserved.
2
has finished. In other words, do not try to exit out of your algorithm midway. The algorithm
should only end when the last statement has been reached and evaluated. This also means you
should not rely on any type of exit, break, quit (or similar) statements in your logic.
To Do (Check Blackboard for Due Dates):
Programming Assignment 1: Solution Design
1) Create a defining diagram that shows the input, processing, and output
2) Create a solution algorithm using pseudocode
3) Show testing using the desk checking table method, to include test data, expected results, and a
desk checking table. Make sure your desk checking considers multiple cases including both valid
and invalid test data to prove your algorithm will work in all cases
Upload a Word document containing only items above to Blackboard.
Grading Criteria
Requirement Points
Defining Diagram with input, processing, and output 40
Efficient Solution Algorithm 40
Thorough Desk Checking Table including test data, and expected results 20
Programming Assignment 2: Solution Implementation
Write a well-documented, efficient Java program that implements the algorithm you identified. Include
appropriate documentation as identified in the documentation expectations document.
Note: You must use the JOptionPane class for input/output. Additionally, if you use System.exit as
shown in the textbook, it may only be used as the absolute last line in the program. You may not use
System.exit, or any variant that exits the program in the middle of the program. The program should be
designed to only exit once the algorithm has finished.
Upload the .java file of the final program to Blackboard. Be careful that you do not submit a .class file
instead of a .java file.
Your program must successfully compile using jGrasp. Partial credit is available. Any final program that
does not compile, for any reason, will receive an automatic zero. Other IDEs often place in additional
code that you are unaware of, doing too much of the work for you. You are strongly discouraged from
using IDEs other than jGrasp.
Grading Criteria
Requirement Points
Implementation of Java Program, using efficient practices where appropriate, such as the use
of constants, good variable names, no redundant code, etc.
70
Appropriate objective-style documentation 10
Appropriate intermediate comments 20
Copyright © 201
9 John Bono, Ph.D. All rights reserved.
3

This question has been answered.

Get Answer