Prompt the user for two values which represent the voter


1. Write a C++ program; LargestSmallest.cpp; that inputs 6 real numbers from the user and finds and prints the smallest number and the largest number entered.
2. Write a program to find out and print, for a class of students, the number of families with 1, 2 ,3 ...up to 6 or more children. The data in entered by the user and consists of the number of children in each pupil's family, terminated by a 0. 
3. A lecturer needs a program to calculate the average of all her students' scores and print the score and the differences from the average. Assume that the class has 5 students. Write a program which allows the teacher to enter the 5 scores and then prints the score and it's difference from the average. 
4. In an election, there are 5 candidates numbered 1- 5. Each voter is allowed 2 votes: A first and second choice. The first choice gets 4 points and the second choice gets 2 points. One line of input corresponds to one voter's choices. For example, the input line: 1 2 means that, for this voter, candidate 1 is the first choice and candidate 2 is the second choice. The number of votes is unknown beforehand and data is terminated by an input line: 0 0
Write C++ code to do the following.
a. Prompt the user for two values which represent the voter's choices.
b. Check if both votes are valid candidates and store the relevant data
c. Print the number of rejected votes and the number of valid votes
d. Print the candidates and their scores and the winner.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Prompt the user for two values which represent the voter
Reference No:- TGS0141088

Expected delivery within 24 Hours