Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 4 : 0 1 Lab Assessment ( 2 0 % ) . pdf 5 G 8 4 Question 2 Suppose you are working on
:
Lab Assessment pdf
Question
Suppose you are working on a program that manages student records. Each student record contains the following information:
Student ID an integer
Student Name a string
Scores in three subjects each score is a float
You are required to write a program that performs the following tasks:
Define a structure named "Student" that contains the above information.
Define an array of "Student" structures to hold the records of students.
Write a function named "readStudents" that reads the student records from a file named "students.txtyou are required to create the file first and stores them in the array of "Student" structures.
Write a function named "printStudents" that prints the student records in the following format:
tableIDName,Subject Subject Subject Average ScoreJohn Doe,Jane Smith,
Write a function named "writeStudents" that writes the student records from the array of "Student" structures to a file named "report.txt in the same format as above.
Calculate and print the average score of each subject.
Your program should have a main function that calls the above functions in the following order:
readStudents
printStudents
writeStudents
The program should display the average scores for all students to the output console.
Dashboard
Calendar
To Do
Notifications
Inbox
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