# Comp 122 Week 1 Ilab Essay

668 Words3 Pages
COMP122
Week 1 iLab - Part 2

Complete the following two programs:

Programming Problem 1

John wants to know the values of the area and perimeter of a rectangle. John can take measurements of the length and width of the rectangle in inches. John's measurements are expected to be accurate to within 0.1 inch.

1. Identify the inputs and outputs of the problem.
Inputs
Double Length
Double Width
Output:
Double Area
Double Perimeter

2. Identify the processing needed to convert the inputs to the outputs.
Area= length*width
Perimeter= 2*(length+width)

3. Design an algorithm in pseudocode to solve the problem. Make sure to include steps to get each input and to report each output.
A. Declare input and output variable
B.
Design an algorithm in pseudocode to solve the problem. Make sure to include steps to get each input and to report each output.
A declare input and output variable
B. read reports measurements in centimeters
C. converted into yards, feet, and inches
D. output variable.

4. Identify two test cases other than the example given above. For each of the two test cases show what inputs you will use and calculate what your expected outputs should be.