History

The following advertisement appeared in the London Times on March 19, 1835:

Charles Babbage has too much cabbage!
He's opened a stall at Leadenhall. For not much
expense - they're only two pence - those with
means can help finance his machines.

The original Babbage's Cabbage's was the most exclusive produce stall in all of London, and sold only the finest cabbage that money could buy. In its day, members of the upper class travelled to Leadenhall Market from miles around to purchase cabbages from Mr. Babbage.

The company has since expanded throughout the United Kingdom, and its iconic produce markets are a familiar sight along roads in the countryside. Now, after 185 years in business, Babbage's Cabbage's has decided to expand into the U.S. market, having recently acquired the Super Supermarket grocery chain in an unexpected takeover bid.

In another major shift, the company will be employing digital computers at its U.S. locations, rather than the steam-powered computing machinery based on Charles Babbage's original designs that is still used in the U.K.

The Program

You have been hired to design and implement a program that can compute an employee's weekly gross pay, taxes, and net pay. The inputs to the program are an employee's first and last names, number of hours worked, and hourly rate of pay.

Gross pay is the number of hours worked (which may include fractions of an hour) times the hourly rate:

gross_pay = hours hourly_rate

Net pay is the gross pay minus deductions; assume deductions are taken for tax withholding (28% of gross pay) and parking ($7.50 per week):

taxes = 28% × gross_pay
net_pay = gross_pay − taxes − $7.50

The program should prompt the user to enter information for a single employee, then compute and display the results. The output must fully echo the user's inputs, and also display the gross pay, taxes, deductions, and net pay. (See the sample runs that follow for the desired formatting.)

The program must use constants for all literal values that are likely to change over the lifetime of the program (e.g., the tax rate). It must also have a modular design, with the main module coordinating the program as a whole and calling submodules as needed. Each submodule may only perform a task related to input, processing, or output and no combinations thereof. All information about the employee must be gathered by (and/or coordinated through) a single module called by main . Each of the three major processing steps (computation of gross pay, tax, and net pay) must be performed in its own processing module.

Sample Runs

The sample runs below give examples of the general flow of the program, and provide details on the desired wording of prompts and output formatting. Input supplied by the user appears in underlined bold. When given the same inputs, your program should match the output of the sample runs exactly.

You do not need to underline the user's input or display it in bold. This is simply a convention to help distinguish between the output of your program and the user's input; both will appear on the screen in the same plain style.

A "formatting guide" has been provided in the first sample to help indicate the width, alignment, and number of decimal places for each field, as well as spacing between fields. This guide will become more useful during the implementation phase, and should be omitted from the output.

Enter employee's first name: Horace
Enter employee's last name: Horsecollar
Enter number of hours worked: 38
Enter hourly pay rate: 12.50


12345678901234567890##21.00##321.00##4321.00##321.00##321.00##4321.00
Hourly Gross Net
Name Hours Rate Pay Taxes Deduct Pay
==================== ===== ====== ======= ====== ====== =======
Horsecollar, Horace 38.00 12.50 475.00 133.00 7.50 334.50
Enter employee's first name: Rachel
Enter employee's last name: Reins
Enter number of hours worked: 46.5
Enter hourly pay rate: 14.40

                           Hourly Gross                 Net
Name Hours Rate Pay Taxes Deduct Pay
==================== ===== ====== ======= ====== ====== =======
Reins, Rachel 46.50 14.40 669.60 187.49 7.50 474.61
Enter employee's first name: Samuel
Enter employee's last name: Saddle
Enter number of hours worked: 51
Enter hourly pay rate: 40


Hourly Gross Net
Name Hours Rate Pay Taxes Deduct Pay
==================== ===== ====== ======= ====== ====== =======
Saddle, Samuel 51.00 40.00 2040.00 571.20 7.50 1461.30

Deliverables

You must create an Analysis and Design document that includes an IPO chart, list of constants, list of formulas, structure chart, and pseudocode for the main module. Implement your program analysis and design with source code written in C/C++.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.