54.7k views
1 vote
Examine the following function header statements, then write an example call to the function.

A) Void viewWarning(void)
B) Double totalPrice(int quantity, double pricePerUnit)
C) Void getUserInput(int& value1, int& value2)

1 Answer

3 votes

Final answer:

The function headers describe functions with different parameters and return types. Example calls to each function are also provided.

Step-by-step explanation:

A) The function header statement void viewWarning(void) is a function that takes no input parameters (void) and returns no values (void). This means it is a function that performs a specific action and does not return any results. An example call to this function would be viewWarning();

B) The function header statement double totalPrice(int quantity, double pricePerUnit) is a function that takes two input parameters - an integer quantity and a double pricePerUnit - and returns a double value. This means it is a function that calculates the total price given the quantity and price per unit. An example call to this function would be double total = totalPrice(5, 2.99);

C) The function header statement void getUserInput(int& value1, int& value2) is a function that takes two input parameters - both integer references - and returns no values (void). This means it is a function that prompts the user for two values, which are then stored in the reference variables. An example call to this function would be getUserInput(value1, value2);

User Huzoor Bux
by
7.5k points