organize the C++ code and write comments on each of the statemetens about what they do in the program? I've added a picture of the task that the code is written according to it. #include using namespace std; int main (){
organize the C++ code and write comments on each of the statemetens about what they do in the
I've added a picture of the task that the code is written according to it.
#include <iostream>
using namespace std;
int main (){
int teller = 0;
int sickDays = 0;
int temp =0;
cout << "How many tellers worked at Nation's Bank during each of the last three years ?" << endl;
cin >> teller;
for(int i = 0; i<teller; i++){
for(int j= 0; j< 3; j++){
cout << "How many days was teller " << i+1 << " out sick during year " << j+1 << " ?" << endl;
cin >> temp;
sickDays += temp;
}
cout << endl << endl;
}
cout << "The " << teller << " tellers were out sick for a total of " << sickDays << " days during the last three years." << endl << endl;
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images