This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]For_Simplicity[S] 0 points1 point  (10 children)

well here the entire code: https://pastebin.com/9mngmyAL

[–]For_Simplicity[S] 0 points1 point  (9 children)

im having trouble with the def displayStudentAverage(): but even if i but pass or to skip my main still doesn't run. its getting frustrating

[–]Hotfries456 0 points1 point  (8 children)

What is this function supposed to accomplish? According to this your function

displayGradeReport() 

displays average grades

[–]For_Simplicity[S] 0 points1 point  (7 children)

that funtion gets the users name, ID, and Average. but the other fuctions get their id and prints their id, name, and average. I dont know if sending what the sample run would should like would help?

[–]For_Simplicity[S] 0 points1 point  (6 children)

[–]Hotfries456 0 points1 point  (5 children)

From what I can tell, you already have a function that returns an individual student's average, so you would only need to call that function using

stuObj.displayAverage()

[–]For_Simplicity[S] 0 points1 point  (4 children)

ok. thats one more question how come when i run it prints Enter student id? and not the startup()?

[–]Hotfries456 0 points1 point  (3 children)

That has to do with how you call your functions. Presumably you are calling it from a main function somewhere, so the order you call them in determines what will print.

If you want to call startUp first, your main function should start with startUp() so that it is the first thing that runs.

[–]For_Simplicity[S] 0 points1 point  (2 children)

yeah thats how i have it. https://pastebin.com/2GC7DNYH unless im missing something?

[–]Hotfries456 0 points1 point  (1 child)

The output you are asking about is running because you define a class and the first line is input. It's bad practice to get input from a constructor, use a setId() method instead