fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void qualify()
  5. {
  6. cout << "Congratulations! You qualify for the credit card!";
  7. cout << " Your annual interest rate is 12%" << endl;
  8. }
  9.  
  10. void noQualify()
  11. {
  12. cout << "You do not qualify for credit card.";
  13. cout << "You must earn at least 17,000 per year";
  14. cout << " and have worked at your current job for 2 years." << endl;
  15. }
  16. int main()
  17. {
  18. double salary;
  19. int years;
  20.  
  21. cout << "This program will determine if you qualify";
  22. cout << " for our credit card." << endl;
  23. cout << "What is your annual salary? " << endl;
  24. cin >> salary;
  25. cout << "How many years have you worked at your";
  26. cout << " current job?" << endl;
  27. cin >> years;
  28.  
  29. if (salary >= 17000.0 && years >= 2)
  30. qualify();
  31. else
  32. noQualify();
  33. return 0;
  34. }
Success #stdin #stdout 0s 5320KB
stdin
30000
3
stdout
This program will determine if you qualify for our credit card.
What is your annual salary? 
How many years have you worked at your current job?
Congratulations! You qualify for the credit card! Your annual interest rate is 12%