Answered step by step
Verified Expert Solution
Question
1 Approved Answer
visual studio (C++) I also attached txt. file below below is the txt.file 1 -1 -1 2 0 0 3 0 1 4 0 -1
visual studio (C++)
I also attached txt. file below
below is the txt.file
1 -1 -1 2 0 0 3 0 1 4 0 -1 5 1 -1 6 0 1 7 0 -1 8 1 -1 9 -1 0 10 1 1 11 -1 1 12 1 -1 13 1 -1 14 0 1 15 -1 -1 16 1 -1 17 1 -1 18 0 0 19 -1 0 20 1 1 21 -1 0 22 1 0 23 0 0 24 1 0 25 0 0 26 -1 0 27 -1 -1 28 -1 1 29 -1 1 30 -1 0 31 0 -1 32 1 0 33 1 -1 34 1 0 35 1 1 36 1 -1 37 1 0 38 1 -1 39 0 1 40 -1 1Voting Record Analysis 1: Performance Rating 2: Similarity Rating 3: Summary Report 0: Exit Voting Record Analysis Given a text file containing the voting record of two congressman over a series of issues, write a program that would read and analyze this data. Each row on in the text file represent an issue. The first number on each row shows the issue number. The second number is the vote of congressman A and the third is the vote of the congressman B Congressman A Performance: 0.275 Congressman B Performance: 0.35 Voting Record Analysis 1: Performance Rating 2: Similarity Rating 3: Summary Report 0: Exit On a particular issue, having -1 as vote value means congressman voted Nay. 1 means the congressman voted Yea. 0 means the congressman missed the vote Similarity Rate: 0.166667 You will need to create 3 arrays (parallel) that can hold information about each issue (each row of data in the file). (40 points) Voting Record Analysis 1: Performance Rating 2: Similarity Rating 3: Summary Repor t 0: Exit You may assume that there can be up to 100 rows in the files we will use with your program and it will always have 3 columns as specified above. Below are the required 3 features of the program. For more information please refer to the screenshot of the running program. Yea12 Miss: 11 Congressman B Feature #1 : Performance Rating (50 points) The performance rating of a congressman is determined by dividing the number of times that congressman has missed voting on an issue by the total number of issues listed in the file. Performance rating should be reported for both congressman and the program should declare which congressman (A or B) has higher rating. Be careful that when you divide two integers, the result will be an integer. We want rating to be a decimal number. I ea15 Miss: 14 Voting Record Analysis 1: Performance Rating 2: Similarity Rating 3: Summary Report 0: Exit would recommend creating variable of type double and assign the values to these double variables to be used in rating calculation. 6 Feature #2: Similarity Rating (50 points) This feature find the number of times the two congressmen voted the same way and divides it by the total number issues in the file excluding where both congressmen mis the vote. In other words, the issues where both congressmen miss the vote should be ignored in this analysis. That means for this analysis, (1) both congressmen missed the vote will not be counted towards the number of times they voted the same way and (2) those issues should also be excluded from the total number of issues in the file 9 -1 0 10 11 11 -1 1 12 1-1 13 1 -1 14 15 -1 -1 16 1-1 Feature #3: Summary Report: (50 points) This feature reports on how many issues congressman A and B voted Yea, Nay or missed the vote 0 1 Feature #0: Exit: (10 points) I should be able to exit out of the program by entering zero on the main menu. 18 0 0 19 -1 0 Make sure that your code is commented and indented properly (-50) Make sure that each feature is in its own function. File inputloutput should also be in its own function (-60)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started