#include using namespace std; int main() { int numStudents; float numHours, tota
ID: 3652824 • Letter: #
Question
#include using namespace std; int main() { int numStudents; float numHours, total, average; int student,day = 0; // these are the counters for the loops cout << "This program will find the average number of hours a day" << " that a student spent programming over a long weekend "; cout << "How many students are there ?" << endl << endl; cin >> numStudents; for( student = 1; student <= numStudents; student++) { total = 0; for(day = 1; day <= 3; day++) { cout << "Please enter the number of hours worked by student " << student <<" on day " << day << "." << endl; cin >> numHours; total = total + numHours; } average = total / 3; cout << endl; cout << "The average number of hours per day spent programming by " << "student " << student << " is " << average << endl << endl << endl; } return 0; } Exercise 1: Note that the inner loop of this program is always executed exactly three timesExplanation / Answer
can you please paste the code in a quick formatted way. I have C to C++ converter
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.