Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include "windows.h"
- #include <fstream>
- using namespace std;
- int main()
- {
- char grade = 'D';
- printf("What grade did you get? \n");
- cin >> grade;
- switch (grade) {
- case 'A':
- printf("Congratulations you passed with flying colours! \n");
- grade = 'pass';
- break;;
- case 'B':
- printf("You did really well, aim for an A next time \n");
- grade = 'pass';
- break;
- case 'C':
- printf("You passed, you can do better! \n");
- grade = 'pass';
- break;
- case 'D':
- printf("You failed, better luck next time \n");
- grade = 'fail';
- break;
- case 'E':
- printf("You failed, better luck next time \n");
- grade = 'fail';
- break;
- case 'F':
- printf("You failed, better luck next time \n");
- grade = 'fail';
- break;
- }
- if (grade == 'fail') {
- printf("Think about what you could do to improve next time. Okay? \n");
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment