click below
click below
Normal Size Small Size show me how
CCS0003_REVIEWER-2
Computer Programming 1
Question | a | b | c | d |
---|---|---|---|---|
A step-by-step problem solving procedure that does not follow any standards or rules. | Algorithm | Pseudocode | Flowchart | Program |
The 2 most commonly used tools for planning a program’s logic. | Flowchart and Pseudocode | ASCII and EBCDIC | Java and Visual Basic | Word Processor and Spreadsheet |
Writing a program in a language like C++ is called as what? | Coding | Translating | Interpreting | Compiling |
A parallelogram is the flowchart symbol representing ______? | Both Input and Output | Input | Output | None of the choices |
It is a flowchart symbol for decision | Parallelogram | Diamond | Rectangle | Lozenge |
It transforms source code written in a programming language into machine code. | Transformer | Compiler | Interpreter | All of these |
It is an algorithm that uses graphical symbols to depict the flow of the step-by-step solution to a problem. | Pseudocode | Flowchart | Program | Algorithm |
A type of data that handles 1 or more characters | Integer | String | Float | Boolean |
A control structure wherein one or ore statements are executed repeatedly based on the evaluation of a condition or an expression. | Sequential | Looping | Conditional | Decision |
A control structure wherein programs are executed sequentially by default. | Sequential | Looping | Conditional | Decision |
The process of locating an error, and correcting and verifying the correction. | Compiling | Debugging | Programming | Testing |
Which of the following is a typical input instruction? | Get AccountNumber | Calculate BalanceDue | Print CustmerID | Total = val1 + val2 |
A loop structure wherein the condition is tested at the beginning (pre-test) of the block | Do-while | while | For | Both a and b |
Which of the following is an invalid variable name? | Semestergrade | Semester grade | semesterGrade | SemesterGrade1 |
An object that causes the program to wait for a keyboard input. | Cout | Keyin | Pause | None of the choices |
The statement: cin << myNum… | Takes input and assigns it to myNum | Produces error >> | Takes input and assigns it to cin | None of the choices |
The statement: cin << num1 << num2… | Takes inputs and store them to num1 and num2, respectively | Produces error >> | Takes1 input and stores it to num1 | None of the choices |
The case where nothing is done. | Switch | Null case | Noll case | None of the choices |
Header file of the function cos(x)… | <string> | <cmath> | <conio> | <iostream> |
Numeric variable used to count values. | Counter | Accumulator | Math | Integer |
Numeric variable used to add together values. | Counter | Accumulator | Math | Integer |
What does the expression myNumber==21 do? | Compares myNumber to 21 | Assigns 21 to myNumber | Set myNumber to 21 | Designate 21 to myNumber |
If initially sum=5 and the next statement states sum+=5, what is the final value of sum? | 5 | 0 | 10 | -5 |
OT *= daily + 50 is equivalent to: | OT = OT * daily + 50 | OT = OT *(daily +50) | OT = (OT * daily) + 50 | OT * daily = 50 |
If m=7, what will be the value of j after executing this operation: j=++m? | 8 | 7 | 15 | 1 |
The process of assigning a value of 0 to a variable before using it. | Initializing | Updating | Sentinel | Counter |
An expression that compares two operands or expressions. | Logical | Relational | Equality | Assignment |
. The symbol of the logical operator OR. | {} | && | II | ! |
Convert the while loop below into for loop: x=1; while(x<10){ cout<<x<<"\t"; ++x; } | for (int x=1; x<=10; x++) cout << x << “\t”; | for (int x=1; x<10; x++) cout << x << “\t”; | for (int x=1; x>10; x++) cout << x << “\t”; | for (int x=1; >=10; x++) cout << x << “\t”; |
What would be the output of the program fragment below: x=10; while(x>5){ cout<<x<<"\n"; x++; } | 10 9 8 7 6 | 10 9 8 7 6 5 | 10 9 8 7 6 | 10 9 8 7 6 5 |
Convert the do-while loop below into while-loop: x=0; do{ cout<<x<<"\t"; x++; }while(x<10); | while (x < 10){ cout << x << “\t”’ x++; | while (x > 10){ cout << x << “\t”’ x++; | x=0; while (x < 10){ cout << x << “\t”’ x++; | x=0; while (x > 10){ cout << x << “\t”’ X++; |
A loop syntax that evaluates all boolean expressions and determines if loop should continue or not. | Variable Initialization | Condition | Variable Update | All of these |
Iteration is a repetition of | Statement | Block of Statements | Operator | Both A & B |
What are the general types of looping structures in C++? | Infinite loop, counting loop, nested loop | while loop, do-while loop, for loop | Counting loop, sentinel-controlled loop, result oriented loop | None of these |
What is the value of factorial in the 3 rd iteration? int factorial = 1; for (int i=1; i<=n; ++i){ factorial *= i; | 2 | 24 | 120 | 6 |
Assess the program fragment below: int i = 0; while (i < 0) { cout("hello"); } | Error | No Output | Infinite Loop | Output hello |
What is the output of the program fragment below? int i,n=5; float sum=0; for(i=1;i<=n;i++) sum += 1.0/ i; cout<<"Sum : "<<sum; | Sum: 2.28333 | sum: 2.28333 | Sum is: 2 | sum is: 2 |
What is the output of the program fragment below? int i,n =5 ,sign=-1; float sum=0; for(i=1;i<=n;i++) { sign *= -1; sum += sign*1.0/i; } cout<<"log 2 : "<<sum; | Log 2: 0.783333 | log 2: 0.783333 | Log 2 is: 0.783333 | log 2 is: 0.783333 |
What is the output of the program fragment below? while (i < 3) { x += 1; i += 1; } cout << x; | 7 | 3 | 4 | 6 |
A loop structure where condition is tested at the beginning (pre-test) of the block. | do-while | while | Both A & B | None of these |
A loop structure where condition is tested at the end (post-test) of the block | do-while | while | Both A & B | None of these |
A data value used to signal the start or end of data series. | Sentinel | Terminator | Starter | None of these |
Forces an immediate exit from a switch, while, do-while and for statements. | continue | exit | break | All of these |
This statement causes next iteration of the loop to begin immediately | continue | exit | break | All of these |
A ____ loop is a loop that never ends. | Fixed | Controlled | Infinite | finite |