Fermé

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 = [url removed, login to view], 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 [url removed, login to view]

The perimeter of shape 3...

...

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

MSN MESSENGER.

Compétences : Programmation C

Voir plus : five r, five below, do five, rectangle, radius , derive, area circle, program shape, rectangle area complete program, contain, inheritance program example, willing, shapes, willing pay, msn program, perimeter, area perimeter, perimeter shapes, area shapes, types, pay type, pay methods, length width, develop program, pay sample

Concernant l'employeur :
( 2 commentaires ) Memphis, United States

N° du projet : #11960

4 freelance ont fait une offre moyenne de 21 $ pour ce travail

bgdnnet

Piece of cake

20 $ USD en 1 jour
(21 Commentaires)
4.9
ranganathp

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

20 $ USD en 0 jours
(5 Commentaires)
4.8
softserv

You will get exactly what you want!

20 $ USD en 1 jour
(0 Commentaires)
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 en 1 jour
(0 Commentaires)
0.0