Instructions
Zululand has a congress with in theory 97 seats. These are apportioned among the three
states Alpha, Bravo and Charlie in proportion to their population. To be precise, each state
receives its share rounded down to the nearest whole number, even if this means the total is
less than 97. Write a C program to compute the seats as follows:
1. Prompt the user for the population of Alpha, then of Bravo, and then of Charlie.
2. Calculate the total population of Zululand.
3. Calculate the percentages for each state.
4. Calculate the number of seats for each state.
5. Print out the results in a suitable format.
Sample Run
(In preparing the handout, I converted user input to italics)
Enter population of Alpha: 123
Enter population of Bravo: 234
Enter population of Charlie: 345
Total population is 702
Alpha has 17.52% of the population and 16 seats
Bravo has 33.33% of the population and 32 seats
Charlie has 49.15% of the population and 47 seats
Total seats allocated is 95

yellowSnow commented: Well .. no victory for you here .. you're lazy and you deserve to fail! -1

Recommended Answers

All 2 Replies

hi, that's a very nice cut-and-paste you've done.

did you use the mouse right-click to paste? or did you use CTRL-C and CTRL-V? i prefer using the keyboard myself, it seems much more efficient.

commented: Ah .. sarcasm is alive and well. I love it! +6
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.