Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 4 : 0 1 Lab Assessment ( 2 0 % ) . pdf 5 G 8 4 Question 2 Suppose you are working on

14:01
Lab Assessment (20%).pdf
5G
84
Question 2
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 20 students.
Write a function named "readStudents" that reads the student records from a file named "students.txt"(you 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:
\table[[ID,Name,Subject 1,Subject 2,Subject 3,Average Score],[1,John Doe,75.50,80.00,85.50,80.00],[2,Jane Smith,80.00,85.50,90.00,85.50]]
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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

What is meant by "indirect costs of financial distress"?

Answered: 1 week ago

Question

Has your organisation defined its purpose, vision and mission?

Answered: 1 week ago