Assignment Goals: To learn to manipulate data using structs and to enforce the skills offunctions, file input, and output formatting.Tasks:Write a program that performs the following tasks:1. Define...

1 answer below »
Assignment Goals: To learn to manipulate data using structs and to enforce the skills offunctions, file input, and output formatting.Tasks:Write a program that performs the following tasks:1. Define two structs dateType and employeeType.The dateType has the following members:year of type intmonth of intday of int.The employeeType has the following members:firstName of stringlastName of stringdob of dateTypesalary of double
2. Assume a data file hw2data.txt contains 20 employees’ data. Each line has the employeedata in the order of first name, last name, year of birth, month of birth, day of birth, and salary.Your program reads data from the hw2data.txt file and store them into appropriate structvariable(s).Hints: This assignment involves the use of nested structs and array of structs.
3. Define a function printEmployee that prints out one employee’s complete information in theorder of first name, last name, date of birth in the form of yyyy-mm-dd, and salary. In the mainfunction, call this function to output all 20 employees’ data in a neat form similar to the sampleoutput.Hints: Consider using manipulators (setw, left, right, setfill) to format the output.4. Find and display the average salary of the 20 employees.5. Find the oldest employee and output his/her name and year of birth.Hints: Assume the oldest employee’s year of birth is different from any other employees, so youdon’t have to compare year, then month, and day.The input data file hw2data.txt can be downloaded separately.Submission: Name your source file hw2main.cpp. ONLY submit your source file via theHomework2 Submission link on Blackboard. Include the integrity statement “I certify that thissubmission is my own original work” and your name and RAM ID as comments in the source file.Extra credit: Write functions to perform task 4 and 5. You have freedom to decide what value tobe returned from your function. It is suggested that the function for 4 or 5 finds and returnsappropriate value to the main function and the result is printed out in the main function.
Answered Same DayOct 02, 2020BCS230

Answer To: Assignment Goals: To learn to manipulate data using structs and to enforce the skills offunctions,...

Samrakshini R answered on Oct 05 2020
138 Votes
c++structures/bin/Debug/c++structures.exe
c++structures/c++structures.cbp
    
    
        
        
        
        
            
                
                
                
                
                
                    
                
            
            
                
                
                
                
                
                    
                
                
                    
                
            
        
        
            
            
        
        
        
            
            
            
            
        
    
c++structures/c++structures.layout
    
    
        
            
        
    
c++structures/hw2data.txtAlice Brown    1980 12 5 56980    
Bob Bush     1972 3 26 120500            
Carl Capra    1990 5 12 45200        
David Lieberman    1976 11 26 87000
John Menchin    1983 4 20 78000
George Smith    1955 7 17 156000
Elaine Sanders    1987 6 20 47382
Jack Cunningham    1979 7 28 84570
Susie Brown    1995 8 24 65000
Marvella Garcia    1980 3 27 87444
Tony Peterson    1988 1 31 57388
John Jones    1960 10 23 129600
Mary Evans    1992 4 17 67358
Nancy Drew    1982 8 19...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here