0

kk now no errors, but it doesnt make sense. lets say i punch in 49, it would spit out that the GPA is 5.0...why is that happening?

0

Because on line 12 you have hardcoded the input 100. Replace that with the grade variable.

0

Because on line 12 you have hardcoded the input 100. Replace that with the grade variable.

so what would i put inside???

0

I honestly feel like you arent learning lol. Thats a really basic part of programming. You are passing a variable into a function and doing operations on then returning a value. You are passing 100 into it and that is returning 5.0 because if you read inside 100 outputs 5.0. You want it so that your input is ran into the function so you go get the input from the user and save it to the variable grade. Then you want to pass grade into the function to get an output. To answer your question you have to replace 100 with grade. If I have to tell you this then all I gotta say is I hope you arent in computer science because you will be retaking this class.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.