//noah robinson //beginning orogramming //lowest score drop #include using namespace std; void getScore(doubl

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

//noah robinson //beginning orogramming //lowest score drop #include using namespace std; void getScore(doubl

Post by answerhappygod »

//noah robinson//beginning orogramming//lowest score drop
#include <iostream>
using namespace std;
void getScore(double &score){ cout << "Enter a grade between 1 and 100"; cin >> score; while (score < 0 || score > 100) { cout << " Enter a scorebetween 0 and 100" << endl; cin >> score; }}void calcAverage(double score, double score2, double score3, doublescore4, double score5){ double lowest = findLowest(score, score2,score3, score4, score5); double average = (score + score2 + score3 +score4 + score5 - lowest) / 4; cout << " the average is " <<average << endl;}double findLowest(double score, double score2, double score3,double score4, double score5){ double lowest; lowest = score; if (score2 < lowest) lowest = score2; else if (score3 < lowest) lowest = score3; else if (score4 < lowest) lowest = score4; else if (score5 < lowest) lowest = score5; return lowest;}int main(){ double score, score2, score3, score4,score5; getScore(score); getScore(score2); getScore(score3); getScore(score4); getScore(score5); calcAverage(score, score2, score3, score4,score5); return 0;}i need help debugging im not sure of whats happening with the findlowest function in c++ pls
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply