Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- int grade{ 4 };
- bool passExam{ false };
- float studPayment{ 0 };
- const float passPay{ 100 };
- const float failedPay{ 20 };
- int a{ 10 };
- int b{ 20 };
- int c{ 30 };
- int max{ 0 };
- max = a > b ? (a > c ? a : c) : (b > c ? b : c);
- std::cout << "Enter exam grade: \n";
- std::cin >> grade;
- //((expr) ? (exprTrue) : (exprFalse));
- //grade > 3 ? passExam = true : passExam = false;
- //passExam = (grade > 3 ? true : false);
- passExam = (grade > 3);
- studPayment = passExam ? passPay : failedPay;
- /*
- *if (grade > 3)
- {
- passExam = true;
- }
- else
- {
- passExam = false;
- }
- */
- //
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement