#include <iostream>
using namespace std;
int main(){
int choice1, choice2;
int repParty =0, demParty=0, indParty=0, greenParty=0 ; //Representing political affiliations
cout << "What should the tax rate be?" << endl;
cout << "1 = Everyone to pay the same tax" << endl;
cout << "2= Wealthiest persons to pay more taxes)" << endl;
cout << "3 = I don't know" << endl;
cout << "4 = None " << endl;
cin >> choice1;
if (choice1 == 1) {
repParty++;}
if (choice1 == 2) {
demParty++; }
if (choice1 == 3){
indParty++;indParty++;
repParty++;}
if (choice1 == 4) {
greenParty++;greenParty++;
demParty++;
}
cout<<"b. What government to uplift poverty?\n"<<endl;
cout<<"1=Equal distribution of resources.\n";
cout<<"2=Investing more funds in schools.\n";
cout<<"3=Incentivize welfare.\n";
cout<<"4= Nothing\n";
cin>>choice2;
if (choice2 == 1) {
repParty++;}
if (choice2 == 2) {
demParty++; }
if (choice2 == 3){
indParty++;indParty++;
repParty++;}
if (choice2 == 4) {
greenParty++;greenParty++;
demParty++;
}
int arr[4] = {repParty,demParty,indParty,greenParty};
int max =arr[0], index=0;
for(int i=0; i<4; i++){
if(arr[i]>max){
max = arr[i];
index = i;
}
}
string arr1[4] = {"rep","dem","ind","green"};
cout<<"The closest political party is \t"<<arr1[index]<<endl;
}
Comments
Leave a comment