Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Rectangle C++ https://www.mediafire.com/file/teuptg7074oehu6/Lab02File.zip/file Find the Rectangle.cpp file (it is in a zip file posted with the Lab02 instructions). This file contains some code that you

Rectangle C++

https://www.mediafire.com/file/teuptg7074oehu6/Lab02File.zip/file

Find the Rectangle.cpp file (it is in a zip file posted with the Lab02 instructions). This file contains some code that you will need to test and debug. To get this code into Visual Studio make sure you have a project for part 2 of the lab. Once you have the project, you can add the code in one of two ways:

1. You can add the file directly to the project.

a. To do this, find the folder with your project. Right-click on the project and then select Open Folder in File Explorer.

b. Copy the Rectangle.cpp file into that directory.

c. Right-click on the project again and select Add -> Existing Item and select the Rectangle.cpp file.

2. You can copy the code into a new file.

a. Create an empty .cpp file in your project and open it

. b. Open the Rectangle.cpp file with a text editor (like notepad).

c. Copy and paste the code from Rectangle.cpp into the new file.

Whichever way you do it, you should have the code in your project and it should not compile because of some errors in the code. Those will be dealt with soon.

Read through the comments in the file and determine what this program is supposed to do.

Create at least 3 tests for this program. Do this by picking some inputs and calculating the expected outputs (dont try to run the program for this). There is a space in the comments for you to record your tests.

You may end up having something like (and the numbers here are wrong):

Inputs:

length: 5.5 width: 10

Expected:

area: 40 perimeter: 95

Note: This program should compute a numeric answer that is reasonable for your inputs even if your inputs are not logical for this situation.

Note: We are assuming that the user will be entering numeric values for the inputs. Yes, we should handle the case where they are not numeric, but we are not there yet. Therefore, just limit your tests to numeric inputs (instead of text).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

How can you defend against SQL injection attacks?

Answered: 1 week ago