Indicate which of the following are valid function declarations. Explain what is wrong with those that are invalid.

round_tenth (double x);

double make_changes (X, Y);

int max (int x, int y, int z);

char sign (double x);

void output_string(apstring s);

Find all the error in each of the following functions:

Code Snippet:
int average (int n1, int n2);
{
return N1 + N2 / 2;
}

Code Snippet:
int total (int n1, int n2);
{
int sum;
return 0;
sum = n1+n2;
}

Write a function for each of the following:

Round a real number to the nearest tenth.

Round a real number to the nearest hundredth.

Convert degrees Fahrenheit to degrees Celsius.

Compute the charge for cars at a parking lot; the rate is 75 cents per hour or any fraction thereof.

Write a program that uses the function you wrote for calculating parking lot charges to print a ticket for a customer who parks in the parking lot. Assume the input is in minutes.

Write two functions (square and cube) to write a program which prints the square and cube of any user given integer.

Write a program that contains a function that allows the user to enter a base (a) and an exponent (x) and then have the program print the value of a to the x power.

What role do parameters play in a function?

Explain the difference between formal parameters and actual parameters.

Why is it a good idea to write functions that are as general as possible?