Joji ilagan career center foundation6final

117 views
90 views

Published on

.

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
117
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Joji ilagan career center foundation6final

  1. 1. JOJI ILAGAN CAREER CENTER FOUNDATION, INC. COLLEGE OF BUSINESS AND TOURISM Gov. Chavez St., Davao CityCom Ed 6 – Programming with C++FINAL EXAMINATION JEFF REY A. COMIDOY2nd Sem SY 2012-2013 Com Ed Instructor75 Points I. Choose the letter of the correct answer.1. Used to repeat a block of codes being able to have repeatedly executed block of codes belongs to what structure? a. Iteration structures b. Conditional structures c. Jump statements d. Selective structures2. The “if” keyword is used to execute a statement or block only if a condition is fulfilled. What structure do this belong? a. Iteration structures b. Conditional structures c. Jump statements d. Selective structures3. Using “break” we can leave a loop even if the condition for its end is not fulfilled. It can be used to end an infinite loop. This structure is called… a. Iteration structures b. Conditional structures c. Jump statements d. Selective structures4. The objective of this structure is to check several possible constant values for an expression. What do you call this structure? a. Iteration structures b. Conditional structures c. Jump statements d. Selective structures5. In what structure this syntax belongs: for (initialization; condition; increase) statement; a. Iteration structures b. Conditional structures c. Jump statements d. Selective structures6. In what structure this syntax belongs: if (condition) statement a. Iteration structures b. Conditional structures c. Jump statements d. Selective structures7. What structure in C++ does this syntax “break” belongs? a. Iteration structures b. Conditional structures c. Jump statements d. Selective structures8. In what structure this syntax belongs: switch (expression){case constant1: group of statements 1;... a. Iteration structures b. Conditional structures c. Jump statements d. Selective structures9. In what structure this syntax belongs: do statement while (condition); a. Iteration structures b. Conditional structures c. Jump statements d. Selective structures10. In what structure does “exit” code in C++ belongs? a. Iteration structures b. Conditional structures c. Jump statements d. Selective structures II. Fill in the blanks. Answer the following C programming source code. (10 pts)#1____ <conio.h>#include <iostream.h>#include <stdio.h>using namespace std;void 2____ (){ int n; 3____(“Enter the starting number “ ); 4____(“%d”, &5____); while (n>0) { 6____(“%d, ”, 7____)8____ --n; } 9____("FIRE!n"); getch(); 10____ 0;} III. Application (30 pts) A. Rewrite the Test II code using for loop. (5 pts) B. Rewrite the Test II code using the do-while loop. (5 pts) C. Write the source code in C++ programming format (10 pts) D. Write the C++ code using for loop. (5 pts) E. Write the C++ code using do-while loop. (5 pts) IV. Hands-on (25 pts). Type your Test III-C source code in C++ and run your program. Debug if necessary.

×