Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ coding HW: Create an input file, called file1, and an output file, called file2, in the program. Read the data, 3 values at a

C++ coding HW: Create an input file, called file1, and an output file, called file2, in the program. Read the data, 3 values at a time, from the input text file until you read the sentinel data line. Arrange the three values that have been read in order from lowest to highest, and then write the set of three numbers to the output file. Use a series of if statements to find the smallest, the middle value, and the largest. When all lines of data have been processed, close both files. Then reopen the output file (file2) as input. Read the data back in and print it to the screen. Use a while (!file2.eof()) to control this last part. You will need a preliminary read before the while (!file2.eof()) and another read before the end of the while loop.

Run:

Create a data file of the following integers in Notepad to run the program:

10 20 30

17 21 18

30 20 49

40 25 35

55 45 35

25 55 5

-1 -1 -1

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 Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago