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
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
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F95e4567c-028f-47e1-94de-8ef4971990ec%2F48787945-2c46-4a6d-8219-e974a1a1076c%2F8fqtpzr_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 5 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning