Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <Windows.h>
- using namespace std;
- int main()
- {
- int cyear, myear;
- int done = true;
- system("color b");
- cout << "Swedish Car Insurance Calculator\n";
- cout << "---------------------------------\n" << endl;
- Sleep(1500);
- cout << "Enter current year: " << endl;
- cin >> cyear;
- cout << endl;
- cout << "Enter model year for car: " << endl;
- cin >> myear;
- while
- (!done) {
- if ((myear) >= (cyear - 5) && (myear) <= (cyear)) {
- system("CLS");
- Sleep(1500);
- cout << "You should get a comprehensive car insurance!" << endl;
- }
- else if ((myear) <= (cyear - 5) && (myear) >= (cyear - 10)) {
- cout << "You should get a half car insurance!\n" << endl;
- }
- else if ((myear) <= (cyear - 10)) {
- system("CLS");
- Sleep(1500);
- cout << "You should get a veteran car insurance!" << endl;
- }
- else {
- system("CLS");
- Sleep(1500);
- int x;
- for (x=0;x<5;x++)
- cout << "Wrong input!\n" << endl;
- done = false;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement