Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C Programming

C Programming

Scheduled Pinned Locked Moved C / C++ / MFC
javapythonlearning
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PUGALENTHIY SUBRAMANIAM
    wrote on last edited by
    #1

    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, grade

    1005
    PYTHON
    A

    1004
    PROGRAMMING
    B

    1001
    CALCULUS
    C

    1003
    MULTIMEDIA
    A

    1002 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 A

    Number 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: 0

    My 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\]);
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups