CSC 155 HW 6 Computer Science I Student Name Section Instructor Part Maximum Points 1 25 points Due Date 2 25 points 3 25 points 4 25 points Total 100 points Your Score Part 1 Textbook Reading Assignment Thoroughly read Chapter(s) 5 and 6 in your Problem Solving with C + + textbook. Part 2 Glossary Terms - Functions Define, in detail, each of these glossary terms from the realm of computer programming logic and design and computer topics, in general. If applicable, use examples to support your definitions. Consult your notes or course textbook(s) as references or the Internet by visiting Web sites such as: http://www.askjeeves.com (a) Global Variable (b) Local Variable (c) Modular Program (d) Recursion (e) Scope or http://www.webopedia.com Part 3 Textbook Exercises ( Simple Program Design ) - Review of Program Statements For (1) through (5) , write a single C + + statement that accomplishes each of the following. (1) Print the message " please enter two numbers. " (2) Assign the quotient of variables num1 and num2 to variable num3 . (3) State a remark that the program performs an estimated tax computation. (4) Input two integer values from the keyboard and store these values in the integer variables first and second . (5) Write a single assignment statement to translate this algebraic expression. y 2 x 2 5 x 10 © Copyright 2011 by P.E.P. Page 1 of 2 CSC 155 Student Name HW 6 Computer Science I Section Part 4 Topics in Computer Programming - Essentials of the C + + Language (a) switch (i) character (q) 0 (b) comment (j) _ (r) ; (c) prototype (k) #include (s) main() (d) << ( l ) */ (t) / const (e) { } (m) (u) header (f) != (n) object - oriented (v) * = (g) 1 (o) logic (w) for (h) local (p) && (x) modulus Using only the items above fill in the following blanks with the most appropriate response by entering both the corresponding letter in the space provided below as well as the actual answer in the blank space. There is only one valid response for each question. _____ (1) _____ (2) _____ (3) _____ (4) _____ (5) _____ (6) _____ (7) _____ (8) _____ (9) _____ (10) _____ (11) _____ (12) _____ (13) _____ (14) _____ (15) _____ (16) _____ (17) _____ (18) A(n) _______________ statement is a program statement that provides an explanatory remark. The use of a header file requires the use of the ________________ preprocessor directive. The _______________ operator is one of five binary operators which C + + provides for creating arithmetic expressions. Each C + + program must include a(n) _______________ function. A variable name known only to the procedure in which it is declared is known as a(n) _______________ variable. _______________ programming focuses on objects, the necessary tasks to be performed on the objects and the messages sent to objects. A(n) function _______________ specifies the return type of the function, the name of the function and the type of any variables passed to the function. C + + supports three simple variable types: integer, floating point and _______________ . _______________ files contain predefined values and routines. Using a statement at the wrong time or with an inappropriate object creates a(n) _______________ error. if statements and _______________ statements are used to make a selection. The six conditional binary operators employed by C + + are: = = , > , < , > = , < = and _______________ . All true expressions are evaluated to 1 whereas all false expressions are evaluated to _______________ . Two or more conditions may be tested using the Or ( || ) operator or the _______________ operator. The _______________ qualifier can be used with values that should not change. The five binary operators employed by C + + to create arithmetic expressions are: + , - , * , % and _______________ . Programmers can use a while or a(n) _______________ statement to loop. The cout function displays whatever is passed to it and uses the insertion operator _______________ . © Copyright 2011 by P.E.P. Page 2 of 2