Question
C++ Write a program that reads data from a data file called final.dat. The data file contains the following information: Name, Salary,Age. The program should
C++
Write a program that reads data from a data file called final.dat. The data file contains the following information: Name, Salary,Age.
The program should store information into a list. You are free to use any list container we learned in class( parallel arrays, array of struct, linked lists, STL lists). After storing the information into the list, the program should do the following:
Print the list out with an appropriate message before printing the list
Print the average age of everyone in the list
Print the name of the oldest person in the list
Sort the list in increasing order by age
Print the list after it has been sorted
Proper Indentations
final.dat
Shae 75000 25 Cory 40000 24 Carlos 25000 40 Angel 50000 35 Shawn 100000 60 Charles 85000 62 Christina 30000 20 Tommy 40000 33 Michael 37500 28 Nia 50000 40 Holly 55000 32 Parker 45000 34 Beatrice 66000 58 David 120000 31 Yolanda 90000 47 Gail 70000 68 Lindy 80000 30 Sherry 33000 27 Zack 53000 34 Harry 65000 49
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started