Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <Windows.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int cyear, myear;
  10. int done = true;
  11.  
  12. system("color b");
  13. cout << "Swedish Car Insurance Calculator\n";
  14. cout << "---------------------------------\n" << endl;
  15. Sleep(1500);
  16. cout << "Enter current year: " << endl;
  17. cin >> cyear;
  18. cout << endl;
  19. cout << "Enter model year for car: " << endl;
  20. cin >> myear;
  21.  
  22. while
  23. (!done) {
  24. if ((myear) >= (cyear - 5) && (myear) <= (cyear)) {
  25. system("CLS");
  26. Sleep(1500);
  27. cout << "You should get a comprehensive car insurance!" << endl;
  28. }
  29.  
  30. else if ((myear) <= (cyear - 5) && (myear) >= (cyear - 10)) {
  31. cout << "You should get a half car insurance!\n" << endl;
  32. }
  33.  
  34. else if ((myear) <= (cyear - 10)) {
  35. system("CLS");
  36. Sleep(1500);
  37. cout << "You should get a veteran car insurance!" << endl;
  38. }
  39.  
  40. else {
  41. system("CLS");
  42. Sleep(1500);
  43.  
  44. int x;
  45.  
  46. for (x=0;x<5;x++)
  47. cout << "Wrong input!\n" << endl;
  48.  
  49. done = false;
  50. }
  51. }
  52. return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement