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
Lemur [1.5K]
3 years ago
13

This program uses hours, pay rate, state tax and fed tax to determine gross

Computers and Technology
1 answer:
Kryger [21]3 years ago
8 0

Answer:

See explaination

Explanation:

#include <fstream>

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

// Fill in the code to define payfile as an input file

ifstream payfile;

float gross;

float net;

float hours;

float payRate;

float stateTax;

float fedTax;

cout << fixed << setprecision(2) << showpoint;

// Fill in the code to open payfile and attach it to the physical file

// named payroll.dat

payfile.open("payroll.dat");

// Fill in code to write a conditional statement to check if payfile

// does not exist.

if(!payfile)

{

cout << "Error opening file. \n";

cout << "It may not exist where indicated" << endl;

return 1;

}

ofstream outfile("pay.out");

cout << "Payrate Hours Gross Pay Net Pay"

<< endl << endl;

outfile << "Payrate Hours Gross Pay Net Pay"

<< endl << endl;

// Fill in code to prime the read for the payfile file.

payfile >> hours;

// Fill in code to write a loop condition to run while payfile has more

// data to process.

while(!payfile.eof())

{

payfile >> payRate >> stateTax >> fedTax;

gross = payRate * hours;

net = gross - (gross * stateTax) - (gross * fedTax);

cout << payRate << setw(15) << hours << setw(12) << gross

<< setw(12) << net << endl;

outfile << payRate << setw(15) << hours << setw(12) << gross

<< setw(12) << net << endl;

payfile >> hours ;// Fill in the code to finish this with the appropriate

// variable to be input

}

payfile.close();

outfile.close();

return 0;

}

You might be interested in
When connecting past and present issues, it is best to follow a series of steps. Which step is missing from the pattern? 1. Iden
Evgen [1.6K]

Establish Cause & Effect

4 0
3 years ago
In ancient times what did kings and tribals chiefs use to communicate
mel-nik [20]

Answer:

they used sign language to communicate and also pegion was used to communicate

8 0
3 years ago
Which access control type would you use to grant permissions based on the sensitivity of the information contained in the object
hram777 [196]

Answer:

Mandatory Access Control (MAC) is a means of restricting access to system resources based on the sensitivity (as represented by a label) of the information contained in the system resource and the formal authorization (i.e., clearance) of users to access information of such sensitivity.

5 0
3 years ago
When you evaluate the use of digital media, how has it affected the newspaper business? The rise of digital media has caused new
Harrizon [31]

Answer:

The rise of digital media has caused newspaper subscriptions to decline significantly because people are finding their news online.

It is A

3 0
3 years ago
If num1 and num2 are the same, print equal.
boyakko [2]

num1 = some value

num2 = some value

if num1 == num2:

   print("equal")

You just need to provide the values for the numbers. I hope this helps!

4 0
3 years ago
Other questions:
  • In the story, what are the song pauses a metaphor for?
    7·1 answer
  • What will be the value of i after the C statements at the right have been executed
    6·1 answer
  • C++
    8·1 answer
  • if an open cut or wound is exposed to contamination washing it in hot water and hand soap is not sufficient to keep safe
    14·2 answers
  • Nonverbal messages from the movie it​
    5·2 answers
  • For as long as you can remember, you've never been able to get a taco on Tuesday at your local taco truck. The lines are always
    8·1 answer
  • Which online article citation is correctly formatted according to MLA standards?
    15·2 answers
  • Which type of software is created on user dimension​
    5·1 answer
  • MmfbfMMMMMMMMMMMMMMMMMmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
    14·1 answer
  • Everyone in a healthcare organization has the responsibility to prevent abuse and neglect from occurring no matter what his or h
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!