CramX Logo
COMP122: Week 1 iLab - Part 2 Rectangle Area and Perimeter Calculation - Document preview page 1

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

Document preview content for COMP122: Week 1 iLab - Part 2 Rectangle Area and Perimeter Calculation

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.

Mia Martinez
Contributor
4.8
0
12 months ago
Preview (3 of 9 Pages)
100%
Log in to unlock
Page 1 of 3
COMP122: Week 1 iLab - Part 2 Rectangle Area and Perimeter Calculation - Page 1 preview imageCOMP122: Week 1 iLab-Part 2Rectangle Area and PerimeterCalculation
Page 2 of 3
COMP122: Week 1 iLab - Part 2 Rectangle Area and Perimeter Calculation - Page 2 preview image
Page 3 of 3
COMP122: Week 1 iLab - Part 2 Rectangle Area and Perimeter Calculation - Page 3 preview imageCOMP122Week 1 iLab-Part 2Completethe following two programs:Programming Problem 1John wants to know the values of the area and perimeter of a rectangle. John can takemeasurements of the length and width of the rectangle in inches. John's measurements areexpected to be accurate to within 0.1 inch.1.Identify the inputs and outputs of the problem.Input are Length and BreadthOutput are Area and Perimeter2.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 parameter3. Design an algorithm inpseudocode to solve the problem. Make sure to include steps toget each input and to report each output.Float length and breadthFloat area and PerimeterArea = length * breadthPerimeter = 2 * length + 2 * breadthPrint Area , PerimterExit the program4. Identify two test cases, one using whole number values, and one using decimal numbervalues. For each of the two test cases show what inputs you will use and what yourexpected outputs should be.1stcaseEntering whole numbers output is displayedProper output is displayed
Preview Mode

This document has 9 pages. Sign in to access the full document!