Question: 6) In this exercise, you will write two programs: Program 1: Using a while loop, write a program that asks the user to enter five
6) In this exercise, you will write two programs: Program 1: Using a while loop, write a program that asks the user to enter five floating-point numbers. The program should create a file and save (i.e. write) all five numbers to the file. Sample output Enter five floating-point nunbers separated by 5 2.0 3.5 5.5 6 our nunbers have been written to the numbersFile.txt file. ss any key to continue Output written to file numbersFile.txt 3.5 5.5 Program 2: Using a while loop, write C++program that opens the file created by Program 1, reads the five numbers, and displays them. The program should also calculate and display the sum of the five numbers. Program screen output ollowing nunbers have been rea ron t .5 2 3.5 5.5 6 un18.5 ress any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
