Advertisement
Spocoman

04. Train The Trainers

Sep 12th, 2023
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8.     int juryCount, counter = 0;
  9.     cin >> juryCount;
  10.     cin.ignore();
  11.  
  12.     string command;
  13.     getline(cin,command);
  14.    
  15.     double score = 0, totalAverage = 0;
  16.  
  17.     while (command != "Finish") {
  18.         string presentation = command;
  19.         double average = 0;
  20.  
  21.         for (int i = 0; i < juryCount; i++) {
  22.             cin >> score;
  23.             average += score;
  24.         }
  25.  
  26.         printf("%s - %.2f.\n", presentation.c_str(), average / juryCount);
  27.         totalAverage += average;
  28.         counter++;
  29.         cin.ignore();
  30.         getline(cin, command);
  31.     }
  32.  
  33.     printf("Student's final assessment is %.2f.\n", totalAverage / (counter * juryCount));
  34.  
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement