1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Digiron [165]
3 years ago
15

You've been hired by Paycheck Penguins to write a C++ console application that determines the pays and taxes on a paycheck. Use

a validation loop to prompt for and get from the user a paycheck period in the range A-Z. Each letter corresponds to a two-week period. Use a validation loop to prompt for and get from the user an hourly real-number rate in the range 18-36 $/hour. Use a validation loop to prompt for and get from the user an integer number of hours worked in the range 60-120. Then calculate the gross pay, federal tax, FICA (Social Security and Medicare) tax, state tax, and net pay based on the hourly rate and time worked. Here are the formulas:
gross pay = hourly rate * time worked
federal tax = gross pay * 0.15
FICA tax = gross pay * 0.0765
state tax = gross pay * 0.0435
net pay = gross pay – federal tax – FICA tax – state tax

Format the following eight outputs into two formatted columns:

Paycheck period
Hourly rate
Hours worked
Gross pay
Federal tax
FICA tax
State tax
Net pay

The first column is a left-justified label with units ($/hour, hours, $, etc.) as needed. The second column is a right-justified value. Format all real numbers to two decimal places. Use formatted output manipulators to print the output. Declare and use constants for the federal tax rate, FICA tax rate, gross pay rate, and the column widths. Run the program five times with different inputs for hours worked and hourly rate. What are the results?

Computers and Technology
1 answer:
ra1l [238]3 years ago
4 0

Answer:

#include<iostream> //i/o library

using namespace std;

int main(){

double hourlyRate = 0;

char paycheckPeriod='a';

while(paycheckPeriod<'A' || paycheckPeriod>'Z'){

cout<<"Enter paycheck period(A-Z): ";

cin>>paycheckPeriod;

}

while(hourlyRate<18 || hourlyRate>36){

cout<<"Enter hourly rate (18-36): ";

cin>>hourlyRate;

}

int hours = 0;

while(hours < 60 || hours > 120){

cout<<"Enter number of hours (60-120): ";

cin>>hours;

}

double grossPay = hourlyRate*hours;

cout<<"Gross Pay: "<<grossPay<<endl;

cout<<"federal tax: "<<0.15*grossPay<<endl;

cout<<"FICA tax: "<<0.0765*grossPay<<endl;

cout<<"state tax: "<<0.0435*grossPay<<endl;

cout<<"Net pay: "<<grossPay-(grossPay*(0.15+0.0765+0.0435));

return 0; //This makes sure that the program terminates

}

Attached is the output

You might be interested in
How does the internet help you to improve your:
ivann1987 [24]

Answer:

Help you mentally active

Explanation:

bcoz we can use internet in good ways

6 0
2 years ago
Read 2 more answers
In Microsoft Word you can access the _______ command from the "Mini toolbar". A. insert citation B. save as C. underline D. word
tresset_1 [31]
Save as is the command that you would use to save anything when using microsoft
4 0
4 years ago
Read 2 more answers
The use of computers to combine data from multiple sources and create electronic dossiers of detailed information on individuals
valkas [14]
Data compilation I believe
4 0
4 years ago
How to find how much storage is left on pc?
FinnZ [79.3K]
Go to your general settings and click on data usage and it should show you how much storage is left.
6 0
3 years ago
Use the STL class vector to write a C function that returns true if there are two elements of the vector for which their product
Tema [17]

Answer:

Code is provided in the attachment form

Explanation:

Vector Multiplication code:

Vector_multiplication.c file contains C code.

See attachment no 1 attached below

Classification of Algorithm: For creating elements in vector c of size n, number of scalar  multiplications is equal to n. The size of original two vectors scales directly with the number of  operations. Hence, it is classified as O(n).

7 0
3 years ago
Other questions:
  • How do I learn coding??? ​
    5·2 answers
  • Which audio editing effect uses the option ""Get Profile"" to execute its function?
    6·1 answer
  • Technician A says that the engine block is the solid frame from which all automotive and truck engines are constructed and is ma
    10·2 answers
  • Dillard’s wants to learn about its consumers' attitudes toward online purchases. There are numerous studies that are available a
    9·1 answer
  • Another personal question- are there any messaging sites that MIGHT work if most things are blocked via the school? I doubt anyt
    11·2 answers
  • PLEASE HELP. I’ll mark you BRAINLIST <br> Please read the comment under this question
    9·1 answer
  • Discuss how sentiment analysis works using big data?<br>​
    13·1 answer
  • Var1 = 1<br> var2 = 2<br> var3 = "3"<br> print(var1 + var2 + var3)
    5·1 answer
  • Two technicians are discussing Newton's first law of motion. Technician A says that a lightweight vehicle requires as
    8·1 answer
  • The action of entering data into your computer. This can be text typed in a word processing document, keywords entered in a sear
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!