Department the person works in

Assignment Help Basic Computer Science
Reference no: EM131848551

Suppose that the file inData.txt contains the following data:

Giselle Robinson Accounting
5600 5 30
450 9
75 1.5

The first line contains a person's first name, last name, and the department the person works in.

In the second line, the first number represents the monthly gross salary, the bonus (as a percent), and the taxes (as a percent).

The third line contains the distance traveled and the traveling time.

The fourth line contains the number of coffee cups sold and the cost of each coffee cup.

Write statements so that after the program executes, the contents of the file outData.txt are as shown below. If necessary, declare additional variables. Your statements should be general enough so that if the content of the input file changes and the program is run again (without editing and recompiling), it outputs the appropriate results.

Write statements that close the input and output files.

The file inData.txt is provided for you with the following data:

 Giselle Robinson Accounting
5600 5 30
450 9
75 1.5

Run your program, and ensure that outData.txt is created and has the following lines:

Name: Giselle Robinson, Department: Accounting

Monthly Gross Salary: $5600.00, Monthly Bonus: 5.00%, Taxes: 30.00%

Paycheck: $4116.00

Distance Traveled: 450.00 miles, Traveling Time: 9.00 hours

Average Speed: 50.00 miles per hour

Number of Coffee Cups Sold: 75, Cost: $1.50 per cup

Sales Amount = $112.50

#include <iostream>

using namespace std;

int main() {

   double distancetravel, travelTime, averageSpeed;

   int numofCoffeeCupSold;

   double coffeeCupcost, salesAmount;

   ifstream inFile;

   ofstream outFile;

   infile.open("inData.txt");

   outFile.open("outData.txt");

   string firstName, lastName, department;

   double grossSalary, bonus, taxRate, bonusPercent, taxRatepercent, payCheck;

   outFile << "Please enter your first name, last name, and department" << endl;

   inFile >> firstName >> lastName >> department;

   cout << "Please enter your gross salary, bonus, and tax rate" << endl;

   inFile >> grossSalary >> bonus >> taxRate;

   bonus = grossSalary * bonusPercent/100;

   taxRate = grossSalary * (taxRatepercent/100);

   payCheck = grossSalary - bonus - taxRate;

   outFile << firstName << lastName << department << endl;

    outFile << "The bonus is " << payCheck << endl;

    outFile << "The tax rate is " << taxRate;

   outFile << "Enter number of coffee cups sold and the coffee cup cost" << endl;

   inFile >> numofCoffeeCupsSold >> coffeeCupcost;

   salesAmount = numofCoffeeCupsSold * coffeeCupcost;

   outFile << "Number of Cofee Cup Sold" << numofCoffeeCupsSold

       << ", cost : $" << coffeeCupCost << "per cup" << endl;

   outFile << "Sales Amount = $" << salesAmount << endl;

   return 0;

}

Reference no: EM131848551

Questions Cloud

Research the history of the pipe and filter style of command : Research the history of the pipe and filter style of commands. In a 2- to 3-page report, explain the strengths and limitations of the approach.
Source arrays into an ordered destination array : For the OrdArray class in the orderedArray.java program (Listing 2.4 on page 59), you are asked to add the following methods
What will be approximate capital gain of this bond : what will be the approximate capital gain of this bond over the next year if its yield to maturity remains unchanged?
Research potential hris types and hris vendors : Research potential HRIS types and HRIS vendors that may suit the needs for Mr. Bell and Gladwell Grocery Stores.
Department the person works in : The first line contains a person's first name, last name, and the department the person works in.
Evaluates difference between leadership and board governance : Write a 700- to 1,050-word paper that evaluates the difference between leadership and board governance in establishing strategic planning for a health care orga
Discuss about the traditional hierarchy organization : Write an original research report consisting of one of the following topic areas: 1) Traditional Hierarchy organization; 2) Holacratic organizations etc.
Explain the importance of system development life cycles : Explain the importance of system development life cycles. Begin the discussion with an overview of systems development.
Full mesh and partial mesh in ospf configuration : What is the different between full mesh and partial mesh in ospf configuration over frame relay?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd