answersLogoWhite

0

#include<iostream>int main () {

int age, female=0, male=0, fcount=0, mcount=0;

char sex;

for (int voter=0; voter<10; ++voter) {

std::cout << "Enter the voter's age and gender: ";

std::cin >> age >> sex;

switch (sex) {

case 'm':

case 'M': ++mcount; male += age; break;

case 'f':

case 'F': ++fcount; female += age; break;

}

}

std::cout << "Average male age: " << male / mcount << std::endl; std::cout << "Average female age: " << female / fcount << std::endl;

}

User Avatar

Wiki User

7y ago

What else can I help you with?

Related Questions

Forty percent of all registered voters in a national election are female A random sample of 5 voters is selected The probability that the sample contains 2 female voters is?

0.3456


Beside the you the people program are schools doing enough to edgecate voters?

no


The average number of voters per precinct is?

400


What is The average number of voters per precinct?

400


A researcher is curious about the average IQ of registered voters in the state of Florida The entire group of registered voters in Florida is an example of a?

Population


What are the average numbers of voters per precinct?

The question needs more detail.


What is the average age of voters on American idol?

to try out you have to be ages 16-28


Who was the first president to be elected with the help of woman voters?

President Warren Harding was the first American president to be elected with the support of female voters. The election was in 1920. Harding was the Republican representative in the presidential election for that term.


How do Jewish voters vote?

They tend to be more liberal than average on economic and cultural issues.


What is the smallest voting district in the US called?

The smallest voting district in the US is called a precinct. Kansas had the smallest average precinct size with 437 voters per precinct. The District of Columbia had the largest average size at 2,704 voters per precinct.


What are voters who have not decided on a candidate at the start of a presidential campaign?

Swing Voters


What does the term Grass Roots refer to?

the structure of grass roots is that it come from the soil and is born from the grass