Threed90

Scholarship

Dec 14th, 2019
114
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     float profit = 0;
  7.     float averageGrade = 0;
  8.     float minSalary = 0;
  9.     scanf_s("%f", &profit);
  10.     scanf_s("%f", &averageGrade);
  11.     scanf_s("%f", &minSalary);
  12.  
  13.     float social = minSalary * 0.35;
  14.     float execellent = averageGrade * 25;
  15.  
  16.  
  17.     if (profit<minSalary && averageGrade >= 5.5)
  18.     {
  19.         if (social > execellent)
  20.         {
  21.             printf_s("You get a Social scholarship %.2f BGN", social);
  22.         }
  23.         else
  24.         {
  25.             printf_s("You get a scholarship for excellent results %.2f BGN", execellent);
  26.         }
  27.     }
  28.     else if (profit < minSalary && averageGrade>4.5)
  29.     {
  30.         printf_s("You get a Social scholarship %.2f BGN", social);
  31.     }
  32.     else if (averageGrade >= 5.5)
  33.     {
  34.         printf_s("You get a scholarship for excellent results %.2f BGN", execellent);
  35.     }
  36.     else
  37.     {
  38.         printf_s("You cannot get a scholarship!\n");
  39.     }
  40.  
  41.  
  42.     system("pause");
  43.     return 0;
  44. }
RAW Paste Data