You will write a program to maintain student information in a classroom. The program will be menu driven and it will perform insert, delete, print students operations on classroom. The class may have up to 40 students. There are 3 quizzes, 1 midterm and 1 final during term. Each student is identified by a four digit student number and a name(20char) surname(20char). When your program is started it should print the following to the screen: 1. Insert student 2. Display class 3. Remove student 4. Generate Report 5. Exit ıf the user types in 1, the program should ask user to enter one student information. If the user types 2, the program should display the List of students with id name and surname (ordered by student id). İf the user types 3, the program should ask the user to enter student number which will be removed from the classroom. If the student number is not found the program should display message indicating that the user is not found. When menu item 4 is selected the program will generate and print the following report. Student id Name Surname quiz1 quiz2 quiz3 mt1 Final Numeric Score Grade 1354 45 78 50 60 70 61.12 D 4569 70 88 65 90 47 . 7842 35 45 90 55 60 . . . . . . . . . . . . . . . . . High Score 70 80 90 90 70 Low Score 35 45 50 55 47 Average 65.5 80 88.4 55.7 60 Numeric Score=%20 quiz+%30 mt1+%50Final Grade will be based on following table: 90-100 A 80-89 B 70-79 C 60-69 D < 60 F Hint: develop your program by utilizing functions. |
#include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> void insert_sts(); void display_class(); void remove_std(); void generate_report(); void main() { int selection; printf("*** Welcome to program ***"); printf("\n\n 1. Insert Student"); printf("\n 2. Display Class"); printf("\n 3. Remove Student"); printf("\n 4. Generate Report"); printf("\n 5. Exit"); printf("\nPlease make a selection : "); scanf("%d",selection); if(selection==1) insert_sts(); if(selection==2) display_class(); if(selection==3) remove_std(); if(selection==4) generate_report(); if(selection==5) exit(0); getche(); } void insert_sts() { char name[20],surname[20],stdno[10],quiz1[10],quiz2[10],quiz3[10],grade[10]; printf("\nEnter student name = "); scanf("%s",name); printf("\nEnter student surname = "); scanf("%s",surname); printf("\nEnter student number = "); scanf("%s",stdno); printf("\nEnter result of quiz 1 = "); scanf("%s",quiz1); printf("\nEnter result of quiz 2 = "); scanf("%s",quiz2); printf("\nEnter result of quiz 3 = "); printf("%s",quiz3); getche(); } |