Given the function declaration (prototype), does the compiler complain or compile if you call this using the following line? If the compiler complains, what is the complaint?

```
//if score >= min_to_pass, returns 'P' for passing,
//else returns 'F' for failing.
char grade (int score, int min_to_pass);
int main() double fscore;
char fgrade;
int need_to_pass;

//omitted code to get values for variables
//fscore and need
fgrade = grade(fscore, need);
return 0;
```
What will be an ideal response?


The compiler complains about using a double for a parameter for a function
calling for an int parameter. The reason is the C++ strong type checking. There is
a possible loss of information when a double is sent to any kind of integer
(char, int, long) parameter, or assigned to an integer. Warning messages
from the Gnu g++ compiler are:
Line 14: warning: float or double used for argument 1
double grade(int, int);

Computer Science & Information Technology

You might also like to view...

What are the four common basic building blocks, besides content, for a Web page?

What will be an ideal response?

Computer Science & Information Technology

When creating network diagrams, what icon description typically represents a network switch?

a. An icon that has a hockey-puck shape with two arrows pointing inward and two arrows pointing outward. b. An icon that resembles a brick wall. c. An icon that is rectangular in shape, with squiggly lines on the front. d. An icon that is rectangular, which contains four arrows pointing in opposite directions.

Computer Science & Information Technology

Describe the three key assumptions regarding software projects that every agile software process must address.

What will be an ideal response?

Computer Science & Information Technology

Most support workers and technology users are considered to be a mixture of the personality types on the Myers-Briggs dimensions.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology