Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help!!! I need help writing a program in C++ or Java with these instructions: The goal is for the program to be able to

Please help!!!

I need help writing a program in C++ or Java with these instructions: The goal is for the program to be able to guess the user's political party before they reach the end of the survey. This will require your program to gather a substantial amount of data before it can make accurate guesses.

In particular: 1. You should begin by presenting the user with questions that contain answer options that differ based on their political beliefs. Ex. What should the government do to help the poor?

A. Make it easier to apply for assistance.

B. Put more money into schools.

C. Incentivize welfare.

D. Nothing.

2. The last question should ask which political party they affiliate with. This way you will be able to gather and store data corresponding to the results you acquire. Create at least 4 political party storages.

3. As you gain more data on each political party, you should have a way of storing this information to create a program that will use this data to accurately survey users and guess their political affiliations.

4. Some answers to questions correspond with more than one political party. Find a way to make your program advanced enough so that it can weigh answers with differing levels of intensity depending on which parties they correspond best with.

5. Overall, for this assignment you will prepare data storage files, obtain and store data through the usage of questions, and then write code using machine learning to create a survey that will accurately guess a user's political party before they complete the survey.

6. At the end of the assignment, you should submit a program that simply surveys a user and guesses their political party. The more advanced your program is, the faster and more accurately it will guess the user's political party affiliation

Example:

Write a working program, either C++ or another language. Come up with several questions, the answers which determine the political leaning. For example:

cout << "What should the tax rate be?" << endl;

cout << "1 = flat income tax (everyone is taxed the same percentage regardless of income)" << endl;

cout << "2 for Sliding Tax (Wealthiest persons pay highest percentage)" << endl;

cout << "3 = I don't know" << endl;

cout << "4 = None " << endl;

cin >> choice;

if (choice == 1) {

rep++;rep++;}

if (choice == 2) {

dem++;dem++; }

if (choice == 3){

ind++;ind++;

rep++;}

if (choice == 4) {

green++;green++;

dem++;}

Save these answers to a file

Once you have the totals for each party, then pull the highest and guess the party. If wrong, you have to account for this by counting wrong. Try a couple more questions, adding up the wrong and correct, then guess again. At the end, write all results to files (wrong and right). These files will help you build a data set from which to build better predictability.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

Students also viewed these Databases questions