ipl-logo

Pt1420 Unit 5

401 Words2 Pages

ProgramDescription: We are making a program that would allow a user to enter student names and Final grades (e.g. A,B,C,D,F) from their courses. we do not know how many students need to be entered. we also do not know how many courses each of the students completed. I am Designing my program to calculate the Grade Point Average (GPA) for each student based on each of their final grades. The program is output the Student name along with the GPA. Analysis: We can make this program by simply calculating total score divide by total subjects Required Input: 1 .Every student detail should be in one line and each student name must end with semicolon(:) 2.Grade of student has to be specified after semicolon in any format. 3.after all calculation type hyphen(-). That will work as end of data. Output: …show more content…

Char s[]: that will take the input string. 2. Char name[]: that will store the student name. 3. total: storing the total score of student. 4. totalsubjects: that will store the total subjects of student. Calculation and formulas: 1.to calculate total score : total+=’E’-grade; 2.to calculate average: total/totalsubjects My program will run until s[0] is not equal to hyphen(-). And we are using the gets function to take information of student that take full line as input so by this we can any number of subjects. Test plan: Expected output: Sally:

Open Document