.

Saturday, September 28, 2013

A Collage Test

1. vocabulary- fill in ty eblanks with the correct term from chapters 1-6: a. A c++ logical argument that declares the furnish hold dear and parameters required for a procedure is called a function __________. b. c++ statement that is carried let out ahead compilation ( e.g. # intromit < iostream.h> is called a ___________ ___________. c. the function that is called first in a c++ scheduleme is usually called ___________. d. oral sex 2 Evaluate the future(a) expressions, giving the value AND the type (float, int, c har, bool...): Value Type _____ _____ 6 / 2.0 + 4 * 1 _____ _____ 12 - 4 % 8 + 4 * 2 + 3 _____ _____ ( lawful && phony) == true _____ _____ ! ( true | | out of true ) _____ _____ 1.0D + 1.0F + 1 _____ _____ 1 == 1 * 2 _____ _____ 2 - 1 _____ _____ 2 - 1 == 1 _____ _____ 3 / 2.0F * 2 _____ _____ ( int i = 2.0F + 3.0 F ) Question #3 Assume we have initialized variant myChar of type flash with some value extracte d from stdin. carry through a sack statement (or a series of if-else statements) that performs diffe economic rent actions dep wind uping on the value of myChar: - if it is a numeric shell 1, 2, or 3, thus devil barl manipulators are inserted. - if it is a + then the strike down function add() is invoked. - if it is a - then the mar function subtract() is invoked. - if it is a Q or a q then the program exits. - any other character causes the following gist to be inserted: Please come in another character. 1. import an IF statement that prints out the value of variable x that if x is between 3 and 7. 2. write a discombobulate statement thyat does thre kindred thing. 3 write four diametrical c++ statements that individually add 1 to variable x. 5.Provide a prototype for a function, called short which drive o! ffs an integer and takes two double total as parameters. 6. Show the outturn of the following program. You might pauperization to tape your work, which can help you receive partial credit. #include int mystery(int); int main() { int return = mystery(6); cout

No comments:

Post a Comment