Write the CarpetService application that provides the quote to estimate the cost to place the carpet for an area.

The application should provide the menu to allow users select one of the following shapes:

1. Rectangle
2. Square
3. Circle
4. Triangle
0. Exit

The program will terminate when users select option 0.

The program will display the message “ Invalid shape” then terminate the program Otherwise, display the menu to allow users select a number to determine the type of carpet with different unit prices

1. Morocco \$0.99
2. Soft Collection Santa Rosa \$1.65
3. Santa Rosa \$2.09
4. Glamorous \$2.49

If user types a number that is not in the range 1 – 4, the program will display the message “Invalid type”; then terminate the program

Otherwise, display the cost result on the screen with all the numbers in two decimal digits format As following: (example for a rectangle room 12.5 x 11.25)

Shape: RECTANGLE
Area: 140.63
Selected price: \$1.65
Carpet cost: \$232.04
Labor: \$35.16
Total: \$267.20

Instruction: We should have two classes

Class CarpetQuote

• Data member
• shape (shape’ s name, for example: RECTANGLE, QUARE, etc)
• unitPrice (the price of carpet per square feet)
• Constructor
• No-argument constructor: shape = “unknown” , unitPrice = 0.0
• Argument constructor: accept two parameters, int typeOfShape (1, 2, 3, 4) and int price (1,2,3,4): apply selection constructor using if..else or switch statement:
• Base on typeOfShape (1,2,3,4 ) -> shape’s name
• Base on price (1,2,3,4) -> unitPrice
• Method to calculate the carpetCost: carpetCost = area * unitPrice
• Method to calculate the labor (100 sq-feet -> \$25) Labor = area * 25 / 100
• Method to calculate tax: tax = 8.5% of carpetCost
• Method to calculate total of the quote: Total = carpetCost + tax + labor
• Method toString to build the string to display the quote as requested

Class CarpetService

• Display the menu that allow users to type a number 1 – 4 to select the shape
• Display the menu that allow users to type a number 1 – 4 to select the carpet type
• Create an object of CarpetQuote to pass shape type and carpet type in
• Display the result as requested by call toString method