Đã Đóng

Shapes

Develop a program to compute the area and perimeter(circumference) of different types of shapes. Your program should contain at least the following classes: Shape, Circle, and Rectangle. Each type of shape should contain methods to compute the area and perimeter. Your program should use an array of Shapes to store at least five different shapes. For example, a circle of radius 2.0, a rectangle with length = 2 and width = 3, another circle with radius = 3.14, another circle with radius = 1.0, and a rectangle with length = 10 and width = 20.5. Your program should then iterate over the array printing the area and perimeter of each shape.

You must use a base class for Shape and derive Circle and Rectangle from Shape. Use appropriate inheritance relationships to complete the assignment

The program should ask the user for the details of each shape. Below is a sample run of your program.

What shape do you want (r or c): r

What is the length and width: 10 20

What shape do you want (r or c): c

What is the radius: 1.0

What shape do you want (r or c): c

What is the radius: 0.5

What shape do you want (r or c): r

What is the length and width: 5 5

What shape do you want (r or c): c

What is the radius: 10.0

The perimeter of shape 1 is 60.

The area of shape 1 is 200.

The perimeter of shape 2 is 6.28.

The area of shape 2 is 3.14

The perimeter of shape 3...

...

WILLING TO PAY $20!!! PLEASE WALK ME THROUGH IT VIA

MSN MESSENGER.

Kỹ năng: Lập trình C

Xem thêm: the five r, five r, five below, do five, walk, relationships\, rectangle, radius, derive, area of a circle, program shape, rectangle area complete program, assignment sample, contain, class printing, classes, inheritance program example, willing, class assignment, shapes, user class, willing pay, msn program, perimeter, program class array

Về Bên Thuê:
( 2 nhận xét ) Memphis, United States

Mã Dự Án: #11960

4 freelancer đang chào giá trung bình $21 cho công việc này

bgdnnet

Piece of cake

$20 USD trong 1 ngày
(21 Đánh Giá)
4.9
ranganathp

Consider ME IN! Consider IT Done! ready to start now select me

$20 USD trong 0 ngày
(5 Đánh Giá)
4.8
softserv

You will get exactly what you want!

$20 USD trong 1 ngày
(0 Đánh Giá)
0.0
johnfelix

I can give you a walk through and make you understand the same as per your requirement. regards john felix

$25 USD trong 1 ngày
(0 Đánh Giá)
0.0