write the definition of a function twice, that receives an integer parameter and returns an
integer that is twice the value of that parameter -correct answer_int twice(int input) { return
input*2; } write a statement that declares a prototypes for the function add which has 2 int
parameters and returns an int -correct answer_int add(int, int); Write the definition of a function
isPositive , that receives an integer parameter and returns true if the parameter is positive, and
false otherwise. -correct answer_bool Is Positive(int x){ if (x > 0) { return true; } else { return
false; } } Write the definition of a function min that has two int parameters and returns the
smaller. -correct answer_int min (int a, int b){ if (a<b){ return a; } else { return b; } } Given the
integer variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to
another integer variable min. Assume that all the variables have already been declared and
that x, y, and z been assigned values ). -correct answer_if(x < y){ if(x<z){ min = x; }else{ min =
z; } }else{ if(y<z){ m have in = y; }else{ min = z; } } Write an if/else statement that adds 1 to the
variable minors if the variable age is less than 18, adds 1 to the variable adults if age is 18
through 64, and adds 1 to the variable seniors if age is 65 or older. -correct
answer_if(age<18){ minors = minors + 1; }else if(age>17&&age<65){ adults = adults +
1; }else{ seniors = seniors +1; } NOTE: in mathematics, the square root of a negative number
is not real; in C++ therefore, passing such a value to the square root function is an error. Given
a double variable named area Of Square write the necessary code to read in a value , the area
of some square, into area Of Square and print out the length of the side of that square.
HOWEVER: if any value read in is not valid input, just print the message "INVALID" -correct
answer_cin >> area Of Square; if(area Of Square>=0){ double length = sqrt(areaOfSquare);
cout << length; } else { cout << "INVALID"; } Clunker Motors Inc. is recalling all vehicles in its
Extravagant line from model years 1999-2002. Given an int variable modelYear and a string
model Name write a statement that prints the message "RECALL" to standard output if the
values of modelYear and modelName match the recall details. -correct
answer_if((modelYear>=1999&&modelYear<=2002)&&(modelName=="Extravagant")){ cout
<< "RECALL"; } Assume that x is a char variable that has been declared and already given a
value . Write an expression whose value is true if and only if x is a upper-case letter. -correct
answer_(x>='A'&&x<='Z') Declare a string variable named empty and initialize it to the empty
string . -correct answer_string empty;