64 693
Assignments Done
99,3%
Successfully Done
In September 2018

Answer to Question #19379 in C++ for abdulla

Question #19379
The center for statistics needs to count the number of female children and the number of
male children in Bahrain. Write a C++ program that asks the user to input the gender
(male or female) followed by the age of each child.
The program then should count and display the number of female and male children.
Use F or f for female, M or m for male, S or s to stop entering date. The program should
display an error message if the input is not valid. A person is considered a child if his/her
age is less than or equal to 10 years.

Your program RUN (Input/Output) should be as follows:
Enter a child gender followed by his/her age (use S or s to stop):
F 9
Enter a child gender followed by his/her age (use S or s to stop):
M 45
Invalid Age! Try again
Enter a child gender followed by his/her age (use S or s to stop):
M 4
Enter a child gender followed by his/her age (use S or s to stop):
G 7
Invalid Gender! Try again
Enter a child gender followed by his/her age (use S or s to stop):
F 7
Enter a child gender followed by his/her age (use S or s to stop):
s
The number of female children is 2
The number of male children is 1
Expert's answer
Unfortunately, your question requires a lot of work and cannot be done for free.
Submit it with all requirements as an assignment to our control panel and we'll assist you.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions