00 Com Ed 6 Midterm

164 views

Published on

Programming with C++

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
164
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

00 Com Ed 6 Midterm

  1. 1. JOJI ILAGAN CAREER CENTER F OUNDATION , INC . COLLEGE OF BUSINESS AND TOURISM Gov. Chavez St., Davao CityCom Ed 6 – Programming with C++MIDTERM EXAMINATION JEFF REY A. COMIDOY2nd Sem SY 2012-2013 Com Ed Instructor75 Points I. Choose the letter of the correct answer.1. When a C++ program must choose whether to take a particular action, you usually implement the choice with an IF statement. a. Single Selection b. Double Selection c. Repetition Structure d. None of these2. Let a program decide which of two statements or blocks are executed. a. Single Selection b. Double Selection c. Repetition Structure d. None of these3. allows the programmer to specify that an action is to be repeated while some condition remains true. a. Single Selection b. Double Selection c. Repetition Structure d. None of these4. C++ that provides three types of selection structures, which one of the following: a. Single Selection b. Double Selection c. Repetition Structure d. None of these5. A “special” character that sounds the system bell or an alert. a. n b. t c. r d. a6. A “special” character that position the screen cursor to the beginning of the current line; do not advance to the next line. a. n b. t c. r d. a7. A “special” character that move the screen cursor to the next tab stop. a. n b. t c. r d. a8. A “special” character that position the screen cursor to the beginning of the next line; it advances to the next line. a. n b. t c. r d. a9. Data type that can be stored as integer number. a. int b. char c. double d. variable10. Data type that can be stored as character. a. int b. char c. double d. variable11. Data type that can be stored as floating point number a. int b. char c. double d. variable12. Location in memory where a value can be stored for use by a program. a. int b. char c. double d. variable13. A program that initializes the tested variable before testing the condition. a. If Loop b. Do While Loop c. While Loop d. For Loop14. A program evaluates the test condition expression. If it is true, the program executes the statement( s) in the body. a. If Loop b. Do While Loop c. While Loop d. For Loop15. A program execute first the statement( s) in the body before evaluating the test condition expression. a. If Loop b. Do While Loop c. While Loop d. For Loop II. Write the code of the following problem using For loop (2 pts), While loop (2 pts), Do While loop (2 pts)1. Ask the user 10 numbers and add all the 10 numbers. Output the total.2. Ask the user 5 cocktail mixes using loops. Output one name in every line.3. Ask the user a number from 1 to 10 and output “Correct” if it is equals to 5.4. Ask the user to input 5 numbers and multiply every number to itself. Output the five results.5. Output “Please Press A” on the monitor and exits the program when the user presses A. III. (30 pts) Write an algorithm (10 pts), flowchart (10 pts) and C++ code (10 pts). Ask the user two numbers and add the numbers. Show the total.

×