6. Write a program to calculate Cumulative Grade Point Average (CGPA). The program reads student matrix number, number of subjects, and marks of each subject. Use selection structure to determine Grade Point for each subject as shown in Table 1.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write a program c
6. Write a program to calculate Cumulative Grade Point Average (CGPA). The program reads
student matrix number, number of subjects, and marks of each subject. Use selection structure
to determine Grade Point for each subject as shown in Table 1.
Table 1: Marks and Grade points
Marks
Grade
Grade Point
>= 80
A
4.0
>= 70
B
3.5
>= 60
3.0
>= 50
D
2.5
>= 40
E
2.0
< 40
F
0.5
Then calculates the CGPA, which is the cumulated value of GPA for all subject and displays
the results. The program must include the following functions:
1) float determine GPA(float mark)
accepts mark from main function, determine GPA according to Table 1
display the Grade for each mark and return the value of GPA to main function
main function calculates the cumulated GPA
2) void countPassFail(float mark, int *pass,int *fail)
accepts value of mark from main function, and also address of variable
pass and fail
determine if mark is equal or higher than 60 and increment the value of pass,
else increment the value of fail
3) void printing(int matricNo, float CGPA, int pass, int fail)
accepts matric number, CGPA calculated, number of passed and failed subjects
from main function
• display all the details as shown below:
Program Calculating CGPA
Enter your matrix No. : 14020010
Number of Subjects: 3
Enter Marks for Subject 1: 70
Grade is B
Enter Marks for Subject 2: 49
Grade is E
Enter Marks for Subject 3: 60
Grade is c
RESULT:
Matrix No. : 14020010
Number of Passed Subject
2
Number of Failed Subject
: 1
CGPA : 2.83
Transcribed Image Text:6. Write a program to calculate Cumulative Grade Point Average (CGPA). The program reads student matrix number, number of subjects, and marks of each subject. Use selection structure to determine Grade Point for each subject as shown in Table 1. Table 1: Marks and Grade points Marks Grade Grade Point >= 80 A 4.0 >= 70 B 3.5 >= 60 3.0 >= 50 D 2.5 >= 40 E 2.0 < 40 F 0.5 Then calculates the CGPA, which is the cumulated value of GPA for all subject and displays the results. The program must include the following functions: 1) float determine GPA(float mark) accepts mark from main function, determine GPA according to Table 1 display the Grade for each mark and return the value of GPA to main function main function calculates the cumulated GPA 2) void countPassFail(float mark, int *pass,int *fail) accepts value of mark from main function, and also address of variable pass and fail determine if mark is equal or higher than 60 and increment the value of pass, else increment the value of fail 3) void printing(int matricNo, float CGPA, int pass, int fail) accepts matric number, CGPA calculated, number of passed and failed subjects from main function • display all the details as shown below: Program Calculating CGPA Enter your matrix No. : 14020010 Number of Subjects: 3 Enter Marks for Subject 1: 70 Grade is B Enter Marks for Subject 2: 49 Grade is E Enter Marks for Subject 3: 60 Grade is c RESULT: Matrix No. : 14020010 Number of Passed Subject 2 Number of Failed Subject : 1 CGPA : 2.83
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY