100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

Create a C program to calculate the degree classification for users at an institute

Rating
-
Sold
-
Pages
1
Uploaded on
23-05-2021
Written in
2020/2021

Create a C program to calculate the degree classification for users at an institute in certain country. The program should meet the following requirements: (a) Display a welcome message on the computer screen (2 marks) (b) The number of modules used for the degree classification calculation is 10 in total. Read each module mark ( x ) one by one, calculate the average mark (Σx/10 ) for the set of modules and print it on the screen. (9 marks) (c) If the average mark is 70% or greater, display a message on the screen: “Congratulations, You got a first class degree!” If the average mark is 50% or greater but less than 70%, display a message on the screen: “Congratulations, You got a second class degree!” If the average mark is 40% or greater but less than 50%, display a message on the screen: “Congratulations, You got a third class degree!” If the average mark is below 40%, display a message on the screen: “Sorry… you haven’t got a degree…”

Show more Read less
Institution
Module








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Module

Document information

Uploaded on
May 23, 2021
Number of pages
1
Written in
2020/2021
Type
Other
Person
Unknown

Subjects

Content preview

/***********************
Create a C program to calculate the degree classification for users at an institute
in certain country. The program should meet the following requirements:
(a) Display a welcome message on the computer screen (2 marks)
(b) The number of modules used for the degree classification calculation is
10 in total. Read each module mark ( x ) one by one, calculate the average mark
(Σx/10 ) for the set of modules and print it on the screen. (9 marks)
(c) If the average mark is 70% or greater, display a message on the screen:
“Congratulations, You got a first class degree!”
If the average mark is 50% or greater but less than 70%, display a message on the
screen: “Congratulations, You got a second class degree!”
If the average mark is 40% or greater but less than 50%, display a message on the
screen: “Congratulations, You got a third class degree!”
If the average mark is below 40%, display a message on the screen: “Sorry… you
haven’t got a degree…”
************************/

#include <stdio.h>
int main(){
printf("Welcome to the system!\n");
float module[10],sum=0,avg;
int count=0;
while (count <10){
printf("Please enter module %i mark \n",count+1);
scanf("%f",&module[count]);
if (module[count]>= 0 && module[count]<=100){
sum += module[count];
count++;
}else{
printf("Please enter a valid mark\n");
}
}
avg = sum/10;
printf("Your average is %f %% \n",avg) ;
if (avg >=70)
printf("Congratulations, You got a first class degree!\n");
else if (avg >=50 && avg< 70)
printf("Congratulations, You got a Second class degree!\n");
else if (avg >=40 && avg< 50)
printf("Congratulations, You got a third class degree!\n");
else if(avg< 40)
printf("Sorry... you havent got a degree...\n");
return 0;}
$10.29
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
afafmatoug

Get to know the seller

Seller avatar
afafmatoug
Follow You need to be logged in order to follow users or courses
Sold
1
Member since
4 year
Number of followers
1
Documents
8
Last sold
3 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions