Site icon Cliff Notes

Allan Hancock College Program that Contains a Class Called Rectangle Driver Code

Allan Hancock College Program that Contains a Class Called Rectangle Driver Code

Question Description

Write a program that contains a class called Rectangle. The class uses a constructor that takes its two sides. Each time a new rectangle is instantiated, the class assigns a unique number to it, it calculates its area and perimeter and stores all the data.

The program should ask the user to create a new rectangle or to display an already stored rectangle. Each time a rectangle is called, all its info should be displayed: its unique number, its sides, its area, and its perimeter.

The user should keep creating or recalling rectangles until they want to quit the program.

The program should self-guard itself against invalid inputs such as strings or negative numbers.

The driver code must be included.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Exit mobile version