Itc111 Lab Midterm
Itc111 Lab Midterm
RIZAL TECHNOLOGICAL
UNIVERSITY
Cities of Mandaluyong and
Pasig
ITC11L
(COMPUTER PROGRAMMING
1) LABORATORY_MIDTERM
Student Name /
Group Name:
Section:
Professor:
A. Directions: Complete the programs below that satisfy the given problem specification and output. Paste
your completed source code in the Code portion then highlight the statement(s) that you filled in the
incomplete program with chosen color. Work independently. Please observe INTEGRITY & HONESTY
ALL THE TIME. (50 points)
Program No. 1
The program should ask the user the initial number of asterisks it will display in the first row after the input. The
program then should display a decreasing number of asterisks in the succeeding row until it reaches a single
asterisk. The program should also display the total number of asterisks printed on screen.
Incomplete Program Sample Output
#include<iostream>
int main() {
{ total = _____________
return 0;
Code
Program No. 2
The program should display the Multiplication Table of a number entered by the user.
Incomplete Program Sample Output
#include<iostream>
int main() {
int x, no;
x = 1;
while (_________) {
_________
return 0;
Code:
Program 3: Create a program that will allow the user to enter five numbers and display the product of “odd
numbers”; and displays the sum of even inputted numbers using WHILE LOOP. Sample output is shown below.
***use WHILE loop and If-then-else
4. Create a simple program that will display the sample output below.
B. Write a while and for statements for each of the following cases: (5pts each)
a. Use a counter named i, initialize variable i to 10 and the value of i is decremented by 1. (while) b.
Use a counter named x and with initial value of 1, a final value of 20, and an increment of 1. (for)
c. Use a counter named count that has an initial value of 1, a final value of 100, and an increment of 5.
(for).
C. Write, compile, and run a C++ program that allows the user to enter his/her name & age. You can modify
the “cout”.
SAMPLE OUTPUT:
***END OF EXAM***