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
Which of the following best explains the different between Cut and Copy? a. When you copy text you are permanently deleting it,
Vilka [71]
B. When you copy text it remains in its original location and places it on the clipboard. Cutting text removes it from its original location and places it on the clipboard

5 0
2 years ago
Read 2 more answers
Disk ________ realigns separated data so that related file pieces are unified.
PilotLPTM [1.2K]
Disk defragmentation realigns separated data so that related file pieces are unified. <span> Defragmentation is is the process of consolidating fragmented files on the user's hard drive.</span>This Microsoft Windows utility includes <span>rearranging the fragments and restoring them into fewer fragments or into the whole file.
</span>
4 0
2 years ago
The explicit location make the query easier to understand and interpret
Step2247 [10]

I am assuming this is a true or false question? If so, the answer is true.

6 0
2 years ago
Fill in the blank. The process that a wireless router uses to translate a private IP address on internal traffic to a routable a
AleksandrR [38]

Answer:

Network Address Translation (NAT)

Explanation:

With the aid of Network address translation(NAT), the IP addresses of a particular local network are translated or mapped into a single or multiple global or public IP addresses. Therefore, a wireless router could use NAT to translate its private IP address on internal traffic (network) to a routable address for the internet.

With NAT, businesses can use many internal IP addresses since they are just for internal purposes and will be eventually converted into a single or a few multiple routable IP addresses.

Three types of NAT are possible:

(i) Static NAT : There is a one - to - one mapping between private IP addresses and routable (public) IP addresses. One private IP is mapped to one public IP address.

(ii) Dynamic NAT : There is a many- to - many mapping between private IP addresses and routable (public) IP addresses. Multiple private IPs are mapped to many public IP addresses.

(iii) Port Address Translation (PAT) : Many - to - one relationship between the private IP addresses and public addresses. Many private IP addresses can be mapped or translated into a single public IP address. This type of NAT is also called NAT overload.

6 0
3 years ago
"which key do you hold down to select a group of contiguous files"
zloy xaker [14]
The "Ctrl" key is the answer.
4 0
2 years ago
Other questions:
  • Categories of general purpose application software and examples each​
    13·1 answer
  • George is a contractor who creates websites and web applications. What is George working as?
    7·2 answers
  • You can type notes of what to cover when presenting the show in the______ pane.
    15·1 answer
  • I would A lot of knowledge and education for computers and <br> Technology
    10·2 answers
  • Assume that LO and HI have already been assigned as constants with LO &lt; HI, and x has been declared as DWORD in the data segm
    7·1 answer
  • 1.) what is the minimum number of bits required to represent -3,997 using 2's complement form?
    6·1 answer
  • Information flows:
    11·1 answer
  • PLEASE HELP!!!!! (Environmental Science Semester 1)
    7·2 answers
  • Cuantos MB son 8,192 kb?​
    13·1 answer
  • Once the CPU has fetched the data requested, what are the next steps in the process?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!