Question: Ok , so the following code is my homework. I did most of it but the teacher wants me to implement a small intentional bug

Ok , so the following code is my homework. I did most of it but the teacher wants me to implement a small intentional bug in it and I dont know how to do that. also she wants to know what is the program or the code about?

Also Debug at least one other program , what dose she mean ? dose she want a new coding program?

please help me and tell me what is the following code about and how can I implement a small intentional bug in it

// This program averages 3 test scores. The braces // were inadvertently left out of the if statement. #include  #include  using namespace std; int main() { int score1, score2, score3; // To hold three test scores double average; // TO hold the average score // Get the three test scores. cout << "Enter 3 test scores and I will average them: "; cin >> score1 >> score2 >> score3; // Calculate and display the average score. average = (score1 + score2 + score3) / 3.0; cout << fixed << showpoint << setprecision(1); cout << "Your average is " << average << endl; // ERROR! This if statement is missing its braces! if (average > 95) cout << "Congratulations! "; cout << "That's a high score. "; cout << "You deserve a pat on the back! "; return 0; } 

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!