Question: using C++ Write a complete program that will ask the user how many sales amounts the user has. The program will then open the file
using C++
Write a complete program that will ask the user how many sales amounts the user has. The program will then open the file sales.txt and will read all keyboard-entered sales and write them to the file, followed by sales total, separated by spaces. No validateion of any sort needed. Sales are with dollars and cents.
// Example run 1:
Give the number of sales: 3
Give the 3 sales: 120.55 20.55 70.99
at the end, the above 3 sales followed by total 212.09 are written in the file sales.txt
// example run 2:
give the number of sales: 2
give the 2 sales: 65.57 45.38
at the end, the above 2 sales followed by total 110.95 are written in the file sales.txt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
