Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions