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.6
55
5 months ago
Preview (3 of 9 Pages)
100%
Purchase to unlock

Page 1

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

Loading page image...

COMP122: Week 1 iLab-Part 2Rectangle Area and PerimeterCalculation

Page 2

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

Loading page image...

Page 3

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

Loading page image...

COMP122Week 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!

Study Now!

XY-Copilot AI
Unlimited Access
Secure Payment
Instant Access
24/7 Support
Document Chat

Document Details

Related Documents

View all