EBK PROBLEM SOLVING WITH C++
EBK PROBLEM SOLVING WITH C++
9th Edition
ISBN: 9780133834505
Author: SAVITCH
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 11, Problem 12PP

Solution to Programming Project 11.12

To combat election fraud, your city is instituting a new voting procedure. The ballot has a letter associated with every selection a voter may make. A sample ballot is shown.

1. VOTE FOR MAYOR

A.

Pincher, Penny    ▢

B.

Dover, Skip    ▢

C.

Perman, Sue    ▢

2. PROPOSITION 17

D.

YES    ▢

E.

NO    ▢

3. MEASURE 1

F.

YES    ▢

G.

NO    ▢

4. MEASURE 2

H.

YES    ▢

I.

NO    ▢

After submitting the ballot, every voter receives a receipt that has a unique ID number and a record of the voting selections. For example, a voter who submits a ballot for Sue Perman, Yes on Proposition 17, No on Measure 1, and Yes on Measure 2 might receive a receipt with

ID 4925 : CDGH

The next day the city posts all votes on its Web page sorted by ID number. This allows a voter to confirm their submission and allows anyone to count the vote totals for themselves. A sample list for the sample ballot is shown.

4925 CDGH
4926 AEGH
4927 CDGI
4928 BEGI
4929 ADFH

Write a program that reads the posted voting list from a file and outputs the percent of votes cast for each ballot item. You may assume that the file does not have any header lines. The first line will contain a voter ID and a string representing votes. Define a class named Voter that stores an individual’s voting record. The class should have a constructor that takes as input a string of votes (for example, “CDGH”), a voter ID, and accessor function(s) that return the person’s ID and vote for a specific question. Store each Voter instance in an array or vector. Your program should iterate over the array to compute and output the percent of votes cast for each candidate, proposition, and measure. It should then prompt the user to enter a voter ID, iterate over the list again to find the object with that ID, and print his or her votes.

Blurred answer
Students have asked these similar questions
This is a JAVA programming assignment. Program a GeneticAlgorithm to find an integer number between 0 and 31 that maximizes the function f (x) = x2.The initial procedure is given as below.• Population size: 6• Crossover probability: 100%• Mutation probability: 5%• Terminating criteria:o When your program produces an average of candidates is equal to or greater than29, then you can accept it as a terminating condition.• Fitness function:o You can use the function itself (f (x) = x2)as your fitness function.1. For the 1st generation, you need to print the process and result of selection, crossover, andmutation operation.you need to print the corresponding integer values and bits (binary values)of selection, crossover, and mutation operation. You also need to decide andprint the crossover point and the mutation point.2. From the 2nd generation, you do not have to print all results of selection, crossover,mutation operations. You can just print the result of each generation. Please provide…
write a c program Count Dracula buys blood from the public. But since he prefers certain types to others, he pays as follows:                 Type                      Rate/liter                 A                             P 3000.00                 B                             P 1800.75                 C (for AB)               P 2880.25                 O                            P 1500.00 Write a C program to input a client’s blood type and the volume (liter) of blood extracted. Output how much the client will be paid.
This is an exercise to design and write a Python program in good programming style for a simulation of stock price over a period of 100 days. In this exercise, you are asked to simulate the stock price starting at $100.00 for 100 days with a daily fluctuation based on the Normal Distribution with mean = 0.0 & sigma = 0.0125. The program will show the daily stock price, the 7-day minimum, the 7-day maximum, the 7-day average, and the 50-day average. The program should also give an indication of "***" when the stock price drops beyond the 50-day average!

Chapter 11 Solutions

EBK PROBLEM SOLVING WITH C++

Ch. 11.1 - Given the following definitions: const int x = 17;...Ch. 11.2 - What is the difference between a (binary) operator...Ch. 11.2 - Prob. 13STECh. 11.2 - Suppose you wish to overload the operator = so...Ch. 11.2 - Prob. 15STECh. 11.2 - Give the definition for the constructor discussed...Ch. 11.2 - Here is a definition of a class called Pairs....Ch. 11.2 - Following is the definition for a class called...Ch. 11.3 - Give a type definition for a structure called...Ch. 11.3 - Write a program that reads in five amounts of...Ch. 11.3 - Change the class TemperatureList given in Display...Ch. 11.3 - Prob. 22STECh. 11.3 - If a class is named MyClass and it has a...Ch. 11.4 - Prob. 24STECh. 11.4 - The following is the first line of the copy...Ch. 11.4 - Answer these questions about destructors. a. What...Ch. 11.4 - a. Explain carefully why no overloaded assignment...Ch. 11 - Modify the definition of the class Money shown in...Ch. 11 - Self-Test Exercise 17 asked you to overload the...Ch. 11 - Self-Test Exercise 18 asked you to overload the...Ch. 11 - Prob. 1PPCh. 11 - Define a class for rational numbers. A rational...Ch. 11 - Define a class for complex numbers. A complex...Ch. 11 - Enhance the definition of the class StringVar...Ch. 11 - Define a class called List that can hold a list of...Ch. 11 - Define a class called StringSet that will be used...Ch. 11 - This programming project requires you to complete...Ch. 11 - Redo Programming Project 6 from Chapter 9 (or do...Ch. 11 - Solution to Programming Project 11.12 To combat...Ch. 11 - Repeat Programming Project 11 from Chapter 10 but...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
If N is an integer power of the power of 2, is N / 2 same as N 1?

Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)

Distance File Modify the program you wrote for Programming Challenge 2 (Distance Traveled) so it writes the rep...

Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)

(Continuously compounded interest) Suppose that you discover in your attic an overdue library book on which you...

Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY