You are on page 1of 3

Lab #1

Problem 1:
In program 1, we designed an algorithm to find the perimeter and area of a rectangle. Given the
length and width of a rectangle, the C++ program, in this, computes and displays the perimeter
and area.

1. Can you guess what the output of program 1?


2. Compile program 1 and run it, is the result the same as you expect in point 1? if no,
WHY?

Problem 2:
Study the following program and try to guess what the result of each statement. Run the program
and compare your expectation with the program output.
Problem 3:
Study the following program, what is the program job?
Run the program and understand the execution of each statement in it.
Problem 4:
Write a program that produces the following output:
**********************************
* Programming Assignment 1 *
* Computer Programming I *
* Author: ??? *
* Due Date: Thursday, Feb. 16 *
**********************************

Problem 5:
Write a program that writes your name in the same format as in the following output:
CCCCCCCCC ++ ++
CC ++ ++
CC ++++++++++++++ +++++++++++++++
CC ++++++++++++++ +++++++++++++++
CC ++ ++
CCCCCCCCC ++ ++

You might also like