Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

need help plz! Complete the program so that the user enters in the height & widt

ID: 645670 • Letter: N

Question

need help plz!

Complete the program so that the user enters in the height & width of the rectangle and the resulting area & perimeter are printed out. Make sure the calculations of area & perimeter are in a function named calculateRectangle and that you print out the results back in the main function. The calculateRectangle function should be a void function. Compile and run the program using the data in the example screen capture below. Take a screen capture of the program running and past in the document titled Lesson Set 6.2 Screen Captures.

Explanation / Answer

int main()

{

float area, perimeter, heigth, width;

cin >> heigth >>width;

// calculate rectangle being called

void cal_rect(&area, &perimeter, &heigth, &width);

cout<<("the area is %d",area);

cout<<("the perimeter is %d",perimeter);

return 0;

}

void cal_rect(int *area, int *perimeter, int *length, int *breadth)

{

area = length * breadth;

perimeter = 2 * (length + breadth);

}}