Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE IN C: You will write a program to help teachers calculate their class's average. The program should be able to take multiple classes with

CODE IN C: You will write a program to help teachers calculate their class's average. The program should be able to take multiple classes with different number of students per class (depends on the user), go through each class, get their digit grades, output the average and the letter grade on how each class performs on average.
I break the problem down into 3 parts to get you started. The screenshot outputs are to help you understand what is expected. Each part can be built upon the previous one. You don't need to replicate it exactly.
Part 1: One class and digit grade inputs.
Ask the user (teacher) to input the number of students in the class (N).
Go through each student in the class, ask for their grade (range from 0->100).
Print out the class's average.
Part 2: Multiple classes allowed.
Fix the program so that it will allow you to input grades not for one class, but multiple classes.
Ask the user to input the number of classes to process.
For each class, ask the user to input the number of students.
The number of students per class can be the same or different depends on the user.
The rest should be the same.
Part 3: Check how well the whole class behave on average.
If you get to this point, you should get the average for a class.
Depends on the average, we'tl output what letter grade the class falls in. Range:
Under 60: F
6069:D
7079:C
8089:B
90>100:A
Expected Outputs (Left: Invalid input example. Right: Final output):
Invalid input
Final output
@,7079:C
@,8089:B
@,90100:A
Expected Outputs (Left: Invalid input example. Right: Final output):
Invalid input
Final output
Requirements:
The number of students cannot be less than 3.
If they are less than 3, exit the program using exit((0);.
You will need to import stdlib.h library on top to use exit function.
No arrays allowed. No functions allowed except for printf and scanf.
We can assume that the teacher will input the grades in the correct range (0100). But you can put a range check to make your program better (optional).
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_2

Step: 3

blur-text-image_3

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

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

Discuss some of the concerns about the future of Social Security.

Answered: 1 week ago