Advertisement
DidiMilikina

02. Scholarship

Oct 31st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     double salary, average_score, min_salary;
  9.     double social_scholarship_size = 0;
  10.     double excellent_scholarship_size = 0;
  11.     bool gotten_Scholarship = false;
  12.  
  13.     cin >> salary >> average_score >> min_salary;
  14.  
  15.     if (average_score >= 5.5)
  16.     {
  17.         excellent_scholarship_size = average_score * 25;
  18.         gotten_Scholarship = true;
  19.     }
  20.    
  21.     if (average_score >= 4.5 && salary < min_salary)
  22.     {
  23.         social_scholarship_size = min_salary * 0.35;
  24.         gotten_Scholarship = true;
  25.     }
  26.    
  27.  
  28.     if (gotten_Scholarship)
  29.     {
  30.         if (social_scholarship_size > excellent_scholarship_size)
  31.         {
  32.             cout << "You get a Social scholarship " << floor(social_scholarship_size) << " BGN" << endl;
  33.         }
  34.         else
  35.         {
  36.             cout << "You get a scholarship for excellent results " << floor(excellent_scholarship_size) << " BGN";
  37.         }
  38.     }
  39.     else
  40.     {
  41.         cout << "You cannot get a scholarship!" << endl;
  42.     }
  43.    
  44.  
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement