C Programming
-
All the questions below are inter linked and belong to the same C program.
a) The program should accept Student ID, Student Name, Course Code, Course Name and Grade for a student. The student should take FIVE [5] courses. [Grades allowed are A, B, C, D or E]. Store the Course Code, Course Name and Grade in THREE [3] different arrays. ONE OF THE COURSES IS PROGRAMMING.
(10 marks)
Copy Code
b) Sort the Course Code in the ascending order. Display the sorted Course Code with the respective Course Name, and Grade as below –COURSE CODE COURSE NAME GRADE …. …. … … …. …. ….. …. …. … … …. …. …..
(20 marks)
Copy Code
c) In the same program, find out how many courses got ‘A’, ‘B’, ‘C’, ‘D’ and ‘E’ grade. Show the result with an appropriate message.
(10 marks)d) In the same program, find out your grade Programming and display it.
(10 marks)Sample output
Enter Name
ROHILAH
Enter ID
80111
Enter code, course, grade1005
PYTHON
A1004
PROGRAMMING
B1001
CALCULUS
C1003
MULTIMEDIA
A1002 JAVA
D*************************************************
RESULTS FOR SEMESTER OCT0BER 2021
NAME: ROHILAH
ID: 80111
*************************************************
COURSE CODE COURSE NAME GRADE
1001 CALCULUS C
1002 JAVA D
1003 MULTIMEDIA A
1004 PROGRAMMING B
1005 PYTHON ANumber of course got A: 2
Number of course got B: 1
Number of course got C: 1
Number of course got D: 1
Number of course got E: 0My grade for C Programming: B
*************************************************What I have tried:
#include int main ()
{
char Name[20];
char Id[20];
char Code[10];
char Course[20];
char Grade;printf("Enter Name:\\n"); scanf("%s",Name); printf("Enter ID:\\n"); scanf("%s",Id); printf("Enter code,course,grade:\\n");
{
int i;
int n = 3;char array1\[n\]\[100\]; for (i = 0; i < 3; i++) scanf("%s", array1\[i\]); char array2\[n\]\[100\]; for (i = 0; i < 3; i++) scanf("%s", array2\[i\]);