click below
click below
Normal Size Small Size show me how
CCS3 - Mod3
Reviewer
| Question | Answer |
|---|---|
| Two slash signs inserted by the programmer in his C++ program indicate that the rest of the line is a comment. | True |
| The library that defines various mathematical functions in C++. | math |
| main() is an exit point of all the function where program execution begins. | False |
| The ordinary arithmetic operations such as addition, subtraction, multiplication, division and modulus division needs the #include<math.h> pre-processor directive | False |
| The code "#include <iostream>" is an example of what part of a C++ program? | Preprocessor directive |
| #include, and #define are examples of preprocessor directives. | True |
| Identify what part of the structure of C++ program is the bold and underlined text. #include<iostream> | Preprocessor directive |
| The symbols that indicates the beginning of main's function definition. | { |
| He was the developer of C++ programming language. | Bjarne Stroustrup |
| Which of the following is not true about C++? | It is interpreted. |
| The relational operator that can be used to test for equality of two expressions. Group of answer choices == = != <> | == |
| Consider the following program snippet. What will be the output? int A = 1, B = 2, C = 3, X = 4, Y = 5, Z = 6; A++; B--; --C; X = Y++ + --Z; cout << ++A + Z--; | 8 |
| A sequence of letters, digits or underscore that may be used as a name of a variable, function, or class. | Identifiers |
| It is an expression that has a value that cannot change during program execution. | Constants |
| C++ performs mathematical expression based on the order of precedence. Given the expression 3 + (9 – 7) * 5 / 2, which operator will be performed first? | - |
| Let a = 2, b = 5, c = 15 and d = 17. What will be the result of the following expression after it is evaluated? !((2<5) || (15 >7)) | False |
| Which of the following symbols is a logical operator? | ! |
| C++ performs mathematical expression based on the order of precedence. Given the expression 3 + (9 – 7) * 5 / 2, which operator will be performed last? | + |
| True or False: !(c>a) where c=2, a =4 | True |
| The expression x += y is the same as ______. | x = x + y |
| C++ is not case-sensitive programming language. | False |
| These are parts of the source code disregarded by the compiler. Their purpose is only to allow the programmer to insert notes or descriptions embedded within the source code. | Comments |
| The code "// This is my first program" is an example of what part of a C++ program? | Comment |
| The following statements about int main() function is TRUE except ________. | Semicolon is required at the end of this statement. |
| C++ is a free-form language is a programming language in which the positioning of characters on the page in program text is significant. | False |
| The library that contains the declarations of the standard input and output functions in C++. | iostream |
| American computer scientist known for his invention of the C programming language | Dennis Ritchie |
| The return keyword tells the program to return a value to the function int main() | True |
| Statically typed is a programming language characteristic in which variable types are explicitly declared. | True |
| True or False: (a==9) && !(b>c) where a=9 b=8 c=7 | False |
| All are arithmetic operators, except ______ | != |
| Primitive data types are built-in that can be used directly by the user to declare variables. | True |
| The following symbols are referred to as relational operators except ______. | || |
| What value is placed in var? int x = 5, y = 19; var = y-x > x-y ? y-x : x-y ; | 14 |
| The following symbols are relational operators except ______. | && |
| Identify what part of the structure of C++ program is the bold and underlined text. cout<<”\nThe sum of” << x << “and” << y << “is” << sum; | Statement |
| Blank lines have effect on a C++ program because they improve readability of the code. | False |
| The special character that terminates each statement in a C++ program. | semicolon(;) |
| Which of the following is not an example of program statements seen inside a main() function? | preprocessor directive such as #define FALSE 0 |
| C++ programs are compiled not interpreted. | True |
| The standard value that the return statement should return to signify successful execution of the program. | 0 |
| Comments tell the compiler to preprocess the source code before compiling. | False |
| C++ was developed by Bjarne Stroustrup as an enhancement to what programming language? | C language |
| The keywords in C++ are case sensitive and should be in uppercase. | False |
| Let a=2, b=5, c=15, d=17: Evaluate the given expression: cout << !((a<b)||(c>d)); | 0 (FALSE) |
| The following statements are TRUE in creating identifiers except _______ | Special characters are allowed. |
| Given the declaration int num=5; Which of the following is the other way to initialize variables? | int num(5); |
| It is a named location in memory that is used to hold a value that may be modified by the program. | Variable |
| All variables in C++ must be declared prior to their use. | True |
| These are names that are given to various elements of a program created by the program. | Identifier |
| Namespace std contains all the classes, objects and functions of the standard C++ library. | True |
| Which of the following symbols is best used to make a 20-line statements as block comment? | /**/ |
| Let a=5: a+=5; What is the Value of a? | 10 |
| All variables must be declared before it will be used. Which of the following is a correct declaration of variables? | float Wt, Ht; |
| Consider the following statements: int x = 22,y=15; x = (x>y) ? (x+y) : (x-y); What will be the value of x after executing these statements? | 37 |
| Which of the following is not an example of an assignment statement? | a == b |
| A global may be used in any part of the program. | True |
| An identifier must not be one of the keywords. Which of the following is NOT considered as an identifier? | switch |
| Identify what part of the structure of C++ program is the bold and underlined text. //this gets the sum of two numbers | Comment |
| Identify what part of the structure of C++ program is the bold and underlined text. #define PI 3.14159 | Preprocessor directive |
| The following statements are true about C++ except __________. | It is a low-level language. |
| Preprocessor directives usually begin with slash (/) symbol | False |
| Identify what part of the structure of C++ program is the bold and underlined text. #include<conio.h> | Preprocessor directive |
| Preprocessor directives are not statements, so they do not end with a semicolon (;) | True |
| Which of the following can be considered as a valid identifier? | Final_Grade |
| Which statement makes sure that x is an even number? | x += x%2 == 0 ? 0 : 1 ; |
| All are relational operators, except ______ | <> |
| C++ performs mathematical expression based on the order of precedence. Given the expression 3 + (9 – 7) * 5 / 2, what will be the answer in performing the expression? | 8 |
| It is used to define symbolic names for constants. | #define |
| #include <iostream> is the correct way of writing the preprocessor directive to include the contents of iostream in a C++ program | True |
| Identify what part of the structure of C++ program is the bold and underlined text. /* this solves the area of a circle you need to enter the radius as input and it displays the area*/ | Comment |
| Identify what part of the structure of C++ program is the bold and underlined text. int main( ) | main() function |
| Which of the following is a valid identifier? | Gr_Level |
| An operator that is also called ternary operator. | Conditional Operator |
| Which of the following is NOT a primitive data type in C++ programming? | string |
| What value is placed in choice? int a=5, b=10, c=15 ; choice = a>b && a>c ? a : (b > c ? b : c) ; | 15 |
| Identify what part of the structure of C++ program is the bold and underlined text. area= PI*r*r; | Statement |
| Which of the following demonstrates the correct use of #define directive if I want to assign 9.8 as gravitational acceleration constant?Note: Use g to represent gravitational acceleration constant | #define g 9.8 |
| Returning 0 when we run a C++ program indicates that our program has not run successfully. | False |
| Let a = 10. What will be the value of a after the following expression a -= 5; is executed? | 5 |
| These are used to override the order of precedence and force some parts of an expression to be evaluated before other parts. | ( ) |
| True or False: (a!=4) || !(b>c) where a=1, b=2, c=0 | True |
| Which of the following user-defined identifiers is invalid in C++? | first-name |
| What value is placed in sum? double sum = 10.0, price=100; sum += price>=100 ? price*1.1 : price; | 120 |
| All C++ statements that need to be executed are written within main ( ). | True |
| #include <iomanip> instructs the preprocessor to include a section of standard C++ code allowing to perform standard input and output operations | False |
| Identify what part of the structure of C++ program is the bold and underlined text. return 0; | return statement |
| All lines beginning with two slash signs (//) do have any effect on the behavior of the program. | False |
| These are the fixed values that do not change during the program’s execution. | Constants |
| The backslash constant that represents a new line. | \n |