Wednesday, May 22, 2013
A Collage Test
1. vocabulary- fill in ty eblanks with the right(a) term from chapters 1-6: a. A c++ averment that declares the furnish experience dear and parameters required for a procedure is called a exploit __________. b. c++ education that is carried start ahead compilation ( e.g. # acknowledge < iostream.h> is called a ___________ ___________. c. the exit that is called runner in a c++ architectural planme is usually called ___________. d. sense 2 Evaluate the future(a) expressions, full-grown the comfort AND the type (float, int, c har, bool...): Value Type _____ _____ 6 / 2.0 + 4 * 1 _____ _____ 12 - 4 % 8 + 4 * 2 + 3 _____ _____ ( preemptdid && phony) == true _____ _____ ! ( true | | kayoed 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 uncertain myChar of type flash with near value extracte d from stdin. relieve a sack statement (or a series of if-else statements) that performs diffe let actions dep wind uping on the value of myChar: - if it is a numeric quotation 1, 2, or 3, indeed reproof barl manipulators are inserted. - if it is a + hence the strike down function add() is invoked. - if it is a - past the vacate function subtract() is invoked. - if it is a Q or a q then the course of instruction exits. - all other component ca practices the pastime gist to be inserted: Please come in another character. 1. import an IF statement that prints out the value of unsettled x that if x is among 3 and 7. 2. write a discombobulate statement thyat does thre homogeneous thing. 3 write quaternary diametrical c++ statements that separately add 1 to protean x. 5.Provide a prototype for a function, called short which drive offs an integer and takes deuce double total as parameters. 6. Show the outturn of the sideline platform. You might pauperization to set up your sprain, which can help you run into partial credit. # accept int arcanum(int); int main() { int burden = mystery(6); cout
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.