Question: Pesky Bug Your friend has written a function that looks to see if there is a failing grade in a list of grades in an

 Pesky Bug Your friend has written a function that looks to

Pesky Bug Your friend has written a function that looks to see if there is a failing grade in a list of grades in an array. The code compiles and runs but both g1 and g2 state that there are no failing grades when g2 clearly has a 55 which is a failing grade. They thought it might be a C++ thing, but equivalent implementations in Python and Java gave the same results! What is the logic problem with your friend's code? A failing grade is anything less than 60 . bool hasFailingGrade(double grades[], unsigned int size) \{ if ( size ==0){ throw invalid_argument("There are no grades."); \} bool hasfailing = false for (unsigned int i=0;i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!