JasperHF

Untitled

Jul 31st, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include "windows.h"
  4. #include <fstream>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. char grade = 'D';
  10. printf("What grade did you get? \n");
  11. cin >> grade;
  12. switch (grade) {
  13. case 'A':
  14. printf("Congratulations you passed with flying colours! \n");
  15. grade = 'pass';
  16. break;;
  17. case 'B':
  18. printf("You did really well, aim for an A next time \n");
  19. grade = 'pass';
  20. break;
  21. case 'C':
  22. printf("You passed, you can do better! \n");
  23. grade = 'pass';
  24. break;
  25. case 'D':
  26. printf("You failed, better luck next time \n");
  27. grade = 'fail';
  28. break;
  29. case 'E':
  30. printf("You failed, better luck next time \n");
  31. grade = 'fail';
  32. break;
  33. case 'F':
  34. printf("You failed, better luck next time \n");
  35. grade = 'fail';
  36. break;
  37.  
  38. }
  39. if (grade == 'fail') {
  40. printf("Think about what you could do to improve next time. Okay? \n");
  41. }
  42.  
  43. system("PAUSE");
  44. return 0;
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment