Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Language: C++ This is what I have so far, but I get an error when it's time to check, Can't open the file... Note:

Programming Language: C++

image text in transcribed

image text in transcribed

This is what I have so far, but I get an error when it's time to check, "Can't open the file..."

Note: I changed the file name to StudentData.txt and the file is placed in the project folder.

int main() { std::ifstream inFile; std::ofstream outFile; double salary = 0; double percentage = 0; double updatedSalary = 0; char firstName[20]; char lastName[20];

inFile.open("StudentData.txt"); // 3. open file: must already in project folder if (inFile.fail()) // !!! 3.5 check if successful { std::cerr

std::cout

inFile >> lastName >> firstName >> salary >> percentage; updatedSalary = salary * (1 + (0.01 * percentage));

outFile

inFile >> lastName >> firstName >> salary >> percentage; updatedSalary = salary * (1 + (0.01 * percentage)); outFile

inFile >> lastName >> firstName >> salary >> percentage; updatedSalary = salary * (1 + (0.01 * percentage)); outFile

inFile.close(); outFile.close();

system("pause"); return 0; }

Three employees in a company are up for a special pay increase. You are given a file, say ch3_Bx5Data.txt, with the following data: Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 2 Lncs 8056

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013th Edition

3642401724, 978-3642401725

More Books

Students also viewed these Databases questions

Question

In ASP.NET a + is used to join a ___________?

Answered: 1 week ago