Skip to content
Solved Assignments

COMP122: Week 1 iLab - Part 2 Rectangle Area and Perimeter Calculation

An iLab assignment focusing on calculating the area and perimeter of rectangles using C++ programming.

Preview 3 of 9 pages

See the first 3 pages exactly as they appear in the document.

  1. Page 1
    Read page 1 as text

    COMP122: Week 1 iLab - Part 2 Rectangle Area and Perimeter Calculation

  2. Page 2
  3. Page 3
    Read page 3 as text

    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. Input are Length and Breadth Output are Area and Perimeter 2. Identify the processing needed to convert the inputs to the outputs. area = length * width; perimeter = length * 2 + width * 2; These calculations are needed for area and parameter 3. Design an algorithm in pseudocode to solve the problem. Make sure to include steps to get each input and to report each output. Float length and breadth Float area and Perimeter Area = length * breadth Perimeter = 2 * length + 2 * breadth Print Area , Perimter Exit the program 4. Identify two test cases, one using whole number values, and one using decimal number values. For each of the two test cases show what inputs you will use and what your expected outputs should be. 1 st case Entering whole numbers output is displayed Proper output is displayed

6 more pages in the full document

Unlock it once and it stays in your library, ready to chat with or turn into flashcards.

Unlock the full document
See all

Study this document with CramX

Once it is in your library, every tool can work from it.