Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Could you please tell me how to write this program with C++ (How many brothers and sisters they have) 4 Write a program to behave
Could you please tell me how to write this program with C++
(How many brothers and sisters they have)
4 Write a program to behave exactly as shown with these 5 samples runs. The user input is shown in bold face. This program should ask the user how many brothers and sisters they have, input that value, and output the appropriate response to make the program behave as shown below, along with the part asking for the names of your siblings, if appropriate. (You don't need to code in the names. Just input them.) The sample output is intended to demonstrate ranges of behavior. 80, all negative inputs should produce output like shown in the rst example, and all inputs greater than 3 should produce output like shown in the last example. Similarly, all inputs between 1 and 3 should produce output like shown for those numbers. Don't forget to include comments. User input is shown in bold. There should be lfs and loops in this code. Hint: Use loops so that you don't have the code for each sibling, such as don't do "What's the name of your sibling #1 name:" and "What's the name of your sibling #2 name:". Let the loop supply the number using a loop. Sample Output: How many brothers and sisters do you have? -1 How could that be? How many brothers and sisters do you have? 0 Oh, you were an only child! How many brothers and sisters do you have? 1 Sounds like a nice size family What's the name of your #1 sibling? Mark How many brothers and sisters do you have? 3 Sounds like a nice size family What's the name of your #1 sibling? Jane What's the name of your #2 sibling? Sue What's the name of your #3 sibling? Bob How many brothers and sisters do you have? 4' A big family! What's the name of your #1 sibling? Paul What's the name of your #2 sibling? David What's the name of your #3 sibling? Karen What's the name of your #4 sibling? AndyStep 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