Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TASK: Write a C program that reads information related to students and their grades from afile and print the contents together with the average of

TASK: Write a C program that reads information related to students and their grades from afile and print the contents together with the average of the scores

Create a struct with the type Student to hold thefollowing information:

Name of the student

grade from english course

grade from math course

grade from physics course

Assume that you know how many records there are in thefile, hence create an array of structs statically

Assume that you know the order of the information andthe type of information at each line: name, scores ofenglish, math and physics courses

Write a function to read the contents from scores.txt andstore them in the structs you created

Provide the checks for successfully reading fromthe file

Write a function to print the contents of a struct variableon the screen

Print the contents of the students on the screen

Print the average of each score on the screen

The output looks like this

The following file is scores.txt

Gintoki Sakata 45 30 80 Ace Portgas D. 60 80 75 Spike Spiegel 65 45 65 Killua Zoldyck 70 55 80 Takashi Natsume 80 90 75 Levi Ackerman 80 75 75

Use the functions written .

#DEFINE SIZE 6

#DEFINE NUM_OF_SCORES 5

struct student(){}

void store_info(FILE* file, student*,..stu)

void print (student* stu){}

typedet str

int main(){}

Please code what is given in the Task in C. It is important that you also include a screenshot of the output. THANK YOU

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

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

Identify three ways to manage an intergenerational workforce.

Answered: 1 week ago

Question

Prepare a Porters Five Forces analysis.

Answered: 1 week ago

Question

Analyze the impact of mergers and acquisitions on employees.

Answered: 1 week ago