Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bianca is preparing special dishes for her daughter's birthday. It takes her a minutes to prepare the first dish, and each following dish takes b

image text in transcribed

Bianca is preparing special dishes for her daughter's birthday. It takes her a minutes to prepare the first dish, and each following dish takes b minutes longer than the previous dish. She has t minutes to prepare the dishes. For example, if the first dish takes a = 10 minutes and b = 5, then the second dish will take 15 minutes, the third dish will take 20 minutes, and so on. If she has 80 minutes to prepare the dishes, then she can prepare four dishes because 10+ 15+20 + 25 = 70. A data file has been provided with the following data, where a, b, and t are described above. This data file times.txt is attached as part of this assignment. You should download this file to a convenient place on your hard drive. Your assignment is to prompt the user to enter the full pathname to a data file on disk. If the file does not exist in the specified location, your program should exit with a suitable error message. The first thing your program should do is output to the screen a copy of the data read in from the disk file. This is known as "echoing" the input data. Your program should then calculate the number of dishes she can prepare for each a, b, and t on a given line and output it in a text file called output.txt. So, output.txt should look like this with data: a b 1 number of dishes All data in files are separated by space and should be easily readable. Your program must work if I change the number of lines in my text file. You must use an appropriate loop and an exit condition for this. Deliverables: Please upload your program source code (.cpp file) as usual. Name your file a05.cpp. Be sure to comment your code as required, and to acknowledge any sources of help you may have received. Your header comments should include the identification of the assignment and your name(s). It should also include a comment indicating any sources of help you may have received. If there were none, the line should read: // Sources: None

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

3. Explain the forces that influence how people handle conflict

Answered: 1 week ago