Question
In C++ programming, John is appointed as the new Election Commissioner. He needs to make the election process easier and faster. To achieve these objectives,
In C++ programming, John is appointed as the new Election Commissioner. He needs to make the election process easier and faster. To achieve these objectives, he needs an application to calculate the percentage of votes in all categories.
Develop an application using
class is created with the belowthree attributes
long int totalPeople
long int noOfWomen
long int noOfMen
Create a class and inherit the properties of class and implement the given methods as :
1. Method with name '' has two parameters with return type .
: method has to calculate the vote percentage. People voted for two parties A and B, Some did not cast their votes. Calculate the vote percentage using the given formula,
2. Method with the name '' has one parameter with return type .
: method has to calculate and return the vote percentage of women,
3. Method with name '' has one parameter with return type . : calcMenVotePercentage method has to calculate and return the vote percentage of men,
Create a function () to get input and print the output as shown in the sample output.
Enter the number of People: 100000
Enter the number of women: 50000
Enter the number of men: 50000
Enter the total votes by Party A: 40000
Enter the total votes by Party B: 30000
Enter the number of women votes: 30000
Enter the number of men votes: 33000
Vote Percentage: 70
Women Vote Percentage: 60
Men Vote Percentage: 66
Enter the number of People: 500
Enter the number of women: 150
Enter the number of men: 350
Enter the total votes by Party A: 200
Enter the total votes by Party B: 100
Enter the number of women votes: 75
Enter the number of men votes: 210
Vote Percentage: 60
Women Vote Percentage: 50
Men Vote Percentage: 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