Question: Functions 1. Explain these terms: - Decomposition - Parameters - Arguments - Function prototype 2. What are pre-conditions and post-conditions? Pre-conditions and post-conditions become (slightly!)

 Functions 1. Explain these terms: - Decomposition - Parameters - Arguments
- Function prototype 2. What are pre-conditions and post-conditions? Pre-conditions and post-conditions

Functions 1. Explain these terms: - Decomposition - Parameters - Arguments - Function prototype 2. What are pre-conditions and post-conditions? Pre-conditions and post-conditions become (slightly!) more important when the function in question has reference parameters. For the following function, write down a brief description of their purpose, as well as their pre-conditions and post-conditions. double calc_average (double sum, int count) \{ return sum/count; \} 3. What is a default argument and where does it need to be? 4. Can you ever have multiple functions with the same name in C++ ? Explain 5. Look at the code below, then design a function called get_last_name () to get the last name of a person whose first name you already have. Remember, repeating code is a good indication to make a function and substituting the repeating code with a function call. - Is this function a void function or does it need to return a value? - Does this function get any arguments/have any parameters? - What are the statements inside the function? - What does the function call look like? int main() 1 string fname1 = "John", fName2 = "Kate", fName 3= "Jackson"; string 1Name1, 1Name2, 1Name3; cout > 1Namel; cout "Hello " fName 2 ", what is your last name?: "; cin >> lName2; cout "Hello " fName 3 ", what is your last name?: "; cin >> IName3; return 0 ; \}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!