Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started