click below
click below
Normal Size Small Size show me how
CCS3 - Mod4
Reviewer
| Question | Answer |
|---|---|
| Refer to the program below: Line No. vii /*This program will compute for the remainder of two numbers*/ If the program is corrected, what will be the value of z, if x = 3 and y = 5? | 3 |
| The ">>" symbol used in cin statement is called ______. | Extraction operator |
| Multiple insertion operations (<<) may be chained in a single statement | True |
| The "<<" symbol used in cout statement is called ______. | Insertion operator |
| To insert a line break, a new-line character shall be inserted at the exact position the line should be broken. | True |
| cout automatically add line breaks at the end. | False |
| Given: const char SCHOOL[20] = “FIT”; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << num1; | 3 |
| The standard C++ library includes the header file ______, where the standard input and output stream objects are declared. | iostream |
| _______ is a function that inserts new line character and flushes the stream. | endl |
| _______ is a function that inserts new line character and flushes the stream. | endl |
| Determine the output in executing the program. #include<iostream> using namespace std; int main(){ cout<<"@@@@@"<<"\n"; cout<<"@@"<<endl<<"@@"; cout<<"\n"<<"@@@@@"; return 0; } | @@@@@ @@ @@ @@@@@ |
| Which library is used for basic input-output library in this program? | iostream |
| Determine the output: #include<iostream> #include <math.h> using namespace std; int main(){ cou<<pow (4,2)); return 0; } | 16 |
| Explicit type conversion is a conversion performed by the compiler without programmer's intervention. | False |
| What is the process of converting one predefined type into another? | Type casting |
| The function that maps a real number to the least succeeding integer is floor. | False |
| Integer is larger than float data type in size. | False |
| Converting larger data type into smaller one is implicit type conversion. | False |
| In implicit type conversion, if the operands are of two different data types, then an operand having lower data type is automatically converted into a higher data type | True |
| setprecision function is part of <iostream> header. | False |
| The floor functions maps a real number to the greatest preceding integer. | True |
| Given: const char SCHOOL[20] = “FIT”; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << num2; | 7 |
| The extraction operator will extract characters from the keyboard until you didn’t press _____ key. | Enter |
| Refer to the program below: Line No. x z = x%y; Which of the following line provides the operation for the remainder? | x |
| Refer to the program below: Line No. iii using namespace std; Which of the following lines contains the namespace used by the program? | iii |
| What is the output of this program? #include < iostream > using namespace std; int main () { int i; cout << "Please enter an integer value: "; cin >> i + 4; return 0; } | Error |
| Refer to the program below: Line No. iv int main(); ix cin>>x, y; Which of the following lines contains error/s? | iv and ix |
| Which of the following escape sequences represents the horizontal tab? | \t |
| Given: const char SCHOOL[20] = “FIT”; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << num1 << “+” << num2; | 3+7 |
| Given: const char SCHOOL[20] = “FIT”; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << “My school is” << endl << SCHOOL; | My school is FIT |
| The general form to perform type casting in C++ is (datatype) expression; | True |
| Determine the output: #include<iostream> #include <math.h> using namespace std; int main(){ cout<<abs(-10.6); return 0; } | 10.6 dapat but mali . So, 10 ang sagot |
| Which function in the program finds the power of the given number? | pow() |
| What is the output when line 9 is executed? | 1 |
| The function that takes a single argument and returns the absolute value of that number in double. | fabs() |
| The function that maps a real number to the least succeeding integer is floor. | False |
| Determine the output: float myVar = 3.1416; cout << int (myVar); | 3 |
| Which header file do you need to include to use typecasting? | None |
| What is the data type used for the variables? | float |
| If you will embed the snippet below in a correct program structure, what is the output of the program? x=7;y=6; cout<<x/y; cout<<x%y; | 11 |
| Given: const char SCHOOL[20] = “FIT”; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << “My school is “ << SCHOOL; | My school is FIT |
| Given: string name = "Jayar"; What header is needed to be declared to be able to output the content of the string type variable name? | string |
| Given: const char SCHOOL[20] = “FIT”; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << “Number is” << “ “ << num2; | Number is 7 |
| What can be used to input a string with blank spaces? | getline() |
| If you will embed the snippet below in a correct program structure, what is the output of the program? x=1;y=0;z=2; cout<<x<<y<<z-x<<endl; cout<<y<<x<<x*y; | 101 010 |
| Given: const char SCHOOL[20] = “FIT”; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << num1 + num2; | 10 |
| What is type casting? | Converting one data type into another |
| What is the output when line 12 is executed? | -2 |
| To use the functions pow() and sqrt(), what should be included in the preprocessor directive part of the C++ program? | math.h |
| How many parameters are used in pow() function? | 2 |
| Determine the output: #include <iostream> #include <cmath> using namespace std; int main() { cout << " Ceil is : " << ceil(2.3) << endl; cout << " Ceil is : " << ceil(-2.3) << endl; return 0; } | Ceil is : 3 Ceil is : -2 |
| When constants and variables of different types are mixed in an expression, they are converted to the same type. | True |
| Converting larger data type into smaller one is implicit type conversion. | False |
| What two functions will not work when we remove the iostream header file? | cin and cout |
| Given: const char SCHOOL[20] = “FIT”; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << “Code =” << num1; | Code =3 |
| Given: const char SCHOOL[20] = “FIT”; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << “Number is” << num2; | Number is7 |
| If the program is corrected, what will be the value of z, if x = 10 and y = 2? | 0 |
| Determine the output of i: i=6; i++; i++; cout <<--i; | 7 |
| The operator used for taking the input is known as the insertion. | False |
| The standard output by default is the screen, and the C++ stream object defined to access it is | cout |
| Given: const char SCHOOL[20] = “FIT”; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << num1; | 3 |
| The implicit conversion of an operand to a specific type is called type casting. | False |
| Determine the output: double myVar = 7.62; cout << int (myVar); | 7 |
| Which library is used to make sqrt() and pow() to work? | math.h |
| Explicit type of type conversion is also called as standard type conversion. | False |
| What should be the correct statement for Line 1? | cout<<"Enter temperature in Celsius:"; |
| What is the output of the given program below? #include <iostream> using namespace std; int main() { cout<<A; cout<<B; cout<<C; return 0; } | ABC |
| What is the size of int data type in C++? | 4 |
| We can perform implicit type conversion on: ____________ | Converting char to int |
| Determine the output: #include <iostream> #include <cmath> using namespace std; int main() { cout << "Floor is : " << floor(2.3) << endl; cout << "Floor is : " << floor(-2.3) << endl; return 0; } | Floor is : 2 Floor is : -3 |
| The function that takes a single argument and returns the absolute value of that number in double. | fabs() |
| The standard output by default is the printer. | False |
| cout automatically add line breaks at the end. | False |
| It is commonly known as the output operator. | Insertion operator |
| Which is a valid typecast? | (char)a; |
| The general form to perform type casting in C++ is (datatype) expression; | True |
| Which of the following is not true in implicit type conversion? | It is a force type conversion |
| Why can typecasting be dangerous? | You might temporarily lose part of the data - such as truncating a float when typecasting to an int. |
| What is the output when line 8 is executed? | 1 |
| round() is used to round the given number to the closest highest integer. | False |
| What should be the correct statement for Line 3? | cout<<"Temperature in Fahrenheit is "<<fah; |
| Which of the following lines is considered as a comment? | vii |
| Given the declaration, int num1, num2; cin >> num1>>num2; The cin statement waits for two inputs from the keyboard separated by a _______. | space |
| The backslash constant that represents a new line. | \n |
| Explicit type of type conversion is also called as standard type conversion. | False |
| Explicit type conversion is a conversion performed by the compiler without programmer's intervention. | False |
| To use the functions pow() and sqrt(), what should be included in the preprocessor directive part of the C++ program? | math.h |
| ________ type conversion is a conversion performed by the compiler without the programmer's intervention. | Implicit |
| Which function in the program finds the power of the given number? | pow() |
| Explicit type conversion requires a type casting operator. | True |