Question: C++ functions, with prototypes please 4. Function name: Diagonal Specification: This function has 2 parameters, representing - The width of a screen - The height
4. Function name: Diagonal Specification: This function has 2 parameters, representing - The width of a screen - The height of a screen When the function runs,it must calculate and return the diagonal length for the screen. Note: The calculation for the diagonal is sqrtwidth + height) . What to do in main0: Ask the user for the dimensions of a screen. Then, by calling the Diagonal) function, report the length of its diagonal. 5. Function name: AskYesNo Specification: This function has 1 parameter, representing a yes-or-no question to ask. When it runs, it must: . Prompt the user with the given question . Get one character of input. Do input validation, re-asking the question until the user types 'y or "n: . Return true or false depending on the user's response What to do in main: First, by calling the AskYesNo function, ask the user "Do you want to learn a fun fact about? [Replace the with a subject of your choice!] . Depending on the return value from the function call. print one of these: Ok, no fun fact today. OR Here is your nfact. Add the fun fact of your choicel] 6. Function name: InputWithinRange Specification: This function handles getting an integer input from the user. It has 2 parameters, representing the lowest valid number the highest valid number When it runs, it must prompt the user with a question in this form Enter a number fron Lowest to highest: (In the prompt, lowest and highest should be actual numbers, based on the value of the two parameters.) After the user's first input, the function must do input validation, forcing them to re-enter repeatedly until they give a valid number Once a valid number has been entered, the function must return the number entered
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
