what would be wrong with not writing


What would be wrong with not writing returnstatement in a value returing function? Can you have a returnstatement in a void function? Does the return statement in the following function cause syntax error?

void p(double x, double y)

 

{

cout << x << " " << y << endl;

 

return x+y;

 

}

2. Write a function headers (not the bodies) for the following functions;

a. Return a sales commission, given the sales amount and the commission rate.

 

b.Display the calendar for a month, given the month and year.

 

c.Return a square root of number.

 

d.Test Whether a number is even, and return true if it is.

 

e.Display a message a specified number of times.

 

f.Return the monthly payment, given the loan amount, number of years, and annual interest rate.

 

g.Return the corresponding uppercase letter, given a lowercase letter.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: what would be wrong with not writing
Reference No:- TGS0497624

Now Priced at $12 (50% Discount)

Recommended (92%)

Rated (4.4/5)