Advertisement
LilChicha174

Untitled

Jun 2nd, 2022
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.91 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.        
  5. class Student
  6. {
  7.     public:
  8.         Student(int num1, int num2, int num3){
  9.             score_from_lectures = num1;
  10.             score_from_test = num2;
  11.             score_from_labs = num3;
  12.         }
  13.         int score_from_lectures;
  14.         int score_from_test;
  15.         int score_from_labs;
  16.  
  17.         void evaluate(){
  18.             int result = score_from_labs + score_from_lectures + score_from_test;
  19.             if (result >=33)
  20.             {
  21.                 cout<<"Отлично";
  22.             }
  23.             else if(result >= 28){
  24.                 cout<<"Хорошо";
  25.             }
  26.             else if(result >= 15){
  27.                 cout<<"Удовлетворительно";
  28.             }
  29.             else cout<<"Неудовлетворительно";
  30.         }
  31. };
  32.  
  33. int main()
  34. {
  35.     Student persone(1,2,3);
  36.     persone.evaluate();
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement