Suppose you have a file called "MyData.txt". In this file, a list of unknown number of users' ages are listed. Write a C++ program to read the ages and save the following in a file called "OutData.txt: 1. Total number of users ages 2. The average value of all ages 3. Total number of children, where a user with age less than or equal to 13 is considered as a child. The generated output should be formatted as follows: Example MyData.txt OutData.txt 20 15 Number of Users is 5 12 Age average is 13.0 In This file, Number of children is 3 8. 10

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
Please solve this in C++ it’s for my practice
Suppose you have a file called "MyData.txt". In this file, a list of unknown number of users ages are listed. Write a C++ program to
read the ages and save the following in a file called "OutData.txt":
1. Total number of users ages
2. The average value of all ages
3. Total number of children, where a user with age less than or equal to 13 is considered as a child.
The generated output should be formatted as follows.
Example
MyData.txt
OutData.txt
20
15
Number of Users is 5
12
Age average is 13.0
8.
In This file, Number of children is 3
10
Use the editor to formot your answer
Transcribed Image Text:Suppose you have a file called "MyData.txt". In this file, a list of unknown number of users ages are listed. Write a C++ program to read the ages and save the following in a file called "OutData.txt": 1. Total number of users ages 2. The average value of all ages 3. Total number of children, where a user with age less than or equal to 13 is considered as a child. The generated output should be formatted as follows. Example MyData.txt OutData.txt 20 15 Number of Users is 5 12 Age average is 13.0 8. In This file, Number of children is 3 10 Use the editor to formot your answer
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning