I got a program about GPA calculator. I need to come up with 5 sets of test data. How shall I do it. I know it must be in table form which includes int input, process and output. But can anyone tell me what does the table must consists of.
dude what you mean by 5 different grades. we need to input their course name, mark obtained, and credit hour. Shall I calculate the GPA for every one subject. And repeat the process for all 5 ?
I mean. Ive looked around at some GPA calculator sites. They require you to input just like you said, course name, credit hour and the grade that you got. Then it calculates stuff. So I dont really understand what you mean by
I also don't understand bro. they asking for 5 test data. how am i suppose to do it.
shal i do like this:
subject name
credit hour
mark
for 5 times
or
{
subject 1:
subject name
credit hour
mark
subject 2:
subject name
credit hour
mark
subject 3:
subject name
credit hour
mark
subject 4:
subject name
credit hour
mark
subject 5:
subject name
credit hour
mark
}
for 5 times
Aha okay now I think I get it. They're basically asking you to do it for 5 different people. So you would need a for-loop that runs 5 times.
Have you gone through loops in your class, or arrays? Tell me what you can and cant use and I'll lead you in the right direction.
Edit: After reading it again. They want you to do it on one person, but 5 different subjects. So for example math, English, Programming, History and P.E. They want you to enter each of those as the subject name, then the credit hour, and the mark that you got.
I've used functions, arrays, for loops, if else statement in my program. since they ask me to use all of it to run the program. my program is about GPA calculator for 5 subjects such as programming, chemistry, physics, calculus and english.
Yes. Then create a string array. An integer array, and a array of type Double(unless credit hours is also just integers). Create a for loop that runs 5 times. Asks the user for subjects, storing each subject in each element of the array. Same thing for The other two arrays. Then you do the calculations like basic math.
ok dude i'm not pretty clear with it. shall i do it for 5 students with 5 subjects OR 5 students who taking 5 subjects and repeat the same process for all 5 students....?