Program to calculate area and perimeter of rectangle


Complete the following two programs:

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

1) Identify inputs and outputs of the problem.

2) Identify processing needed to convert inputs to the outputs.

3) Design an algorithm in pseudo code to solve problem. Ensure to include steps to get each input and to report each output.

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 would use and what your expected outputs should be.

5) Write a program to implement your algorithm. Test your program using your test cases. Did your program produce the values predicted in your test cases? Describe.

Question 2)

Shirlee is working with the measurement tool which reports measurements in centimetres. As Shirlee is unfamiliar with centimetres, she would like her centimetre measurements to be converted into yards, feet, and inches. She will also like the result to be properly rounded to the nearest inch. As an example, if the measurement is 312 centimetres, this must be converted to 3 yards, 1 foot, and 3 inches.

1) Identify the inputs and outputs of the problem.

2) Identify the processing needed to convert inputs to the outputs.

3) Design the algorithm in pseudo code to solve the problem. Ensure to include steps to get each input and to report each output.

4) Identify two test cases other than example given above. For each of the two test cases show what inputs you would use and compute what your expected outputs must be.

5) Write the program to implement your algorithm. Test your program using your test cases. Did your program produce the values predicted in your test cases? Describe.

For each of the two programming problems, create the program using Visual C++.Net. Ensure to capture the sample of your program's output. The best way to do this is to click on the console window you want to capture and then press the Alt and PrintScreen keys at the same time. Then paste your captured screen image into a Word document. For each of the two programs, put the screen capture followed by a copy of your source code into your Word document.

Your final programming document must contain in the following order:

1) Answers to all of the questions listed above.

2) Screen capture of first program followed by source code.

3) Screen capture of second program followed by source code.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Program to calculate area and perimeter of rectangle
Reference No:- TGS04651

Expected delivery within 24 Hours