Question: . Write a prototype for a function that has default parameters. Define a function that uses default and non-default parameters . Design and write a
. Write a prototype for a function that has default parameters. Define a function that uses default and non-default parameters . Design and write a program with calls to that function which will both include and omit the default parameters Q1: Default Parameters- Circle the correct answer? 1. Given the following declarations and prototype choose the correct function call int x: sales: void compute (string name, int& amountx.double rate-0.5) 2. Given the following prototype double cale (double bonus 0.10, b. result Circle the correct answer a. compute ("Joe15) b. compute ("Joe."15, 0.3) . compute ("Joe", 0.1) d. compute ("Joe", sales) a.result calc o -calc code", 2.0) string base the output is: "xyz"); . c. result-calc "code) d. result-calc (0.2, 15) Q2: Your school would like to develop a program that computes the maximum amount of financial aid a qualified student is entitled to receive in a semester if the student met certain income and grade point levels (on a 4.0 system). Specifically, if the student's GPA is at least a 2.0 but less than a 3.0, the student may receive half of the tuition cost in aid. If the student's GPA is at least 3.0, the student may receive aid up to all of the tuition cost. Design a program that would get and validate in the main function the following input: 1 the tuition amount (not to exceed 2000) 2) the GPA (which must be at least a 2.0). Use data validation loops. If the GPA is less than 2.0, output a message that the student doesn't qualify academically and end the program. Use a value-returning function named computeAid that takes two parameters, tuition and GPA. Set the GPA parameter to a default value of 2.0. The function will calculate the amount of financial aid as follows: aid tuition /4 GPA. If the GPA is less than 3.0, use a function call that passes only the tuition as an argument. If the GPA is 3.0 or greater, then pass two arguments, tuition and GPA
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
