-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAre you...
60 lines (44 loc) · 1.26 KB
/
Are you...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <iostream>
using namespace std;
int main ()
{
int age;
int choice;
// inputting age
cout << "Konnichiwa! What is your current age?\n";
cin >> age;
// code if age = greater than / equal to 18
if (age >= 18) {
cout << "You are eligible to vote\n\n";
//additional
cout << "Want to know when you will be voting next in India?" <<endl;
cout << "Enter 1 if you do.\nEnter 2 if you dont\n";
cin >> choice;
}
if (choice == 1){
cout << "You will vote next for Lok Sabha elections in the May of 2024";
}
else {
cout << "Sayohnara! Have a fine day!";
exit (0);
}
//code if age is less than 18
if (age < 18) {
cout << "Your are not eligible to vote\n\n";
// additional
cout << "Do you want to know in which year you will vote for your first time?\n";
cout << "Enter 1 if you do \nEnter 2 if you dont\n\n";
cin >> choice;
}
if (choice == 0 || choice == 2 ) {cout<< "Ciao Adios! Have a fine day!";}
else{
switch (age){
case 1 :
{ if (age >= 14) {cout << "You will vote in 2029";}}
break;
default:
cout << "You will vote in the May of 2024";
}
return 0;
}
}