Create a two & three -Dimensional Shapes Mini-system that consists of 6 shapes, Square, Rectangle, Triangle, Circle, Cube and Sphere and then calculate area, perimeter, volume , or draw the shape. After that, it does the following tasks:
1. The code ask the user to enter the required values should be in the main method.
2. All input values are must be positive.
3. The Triangle must a Right Isosceles (two sides are equal).
4. For each shape, the code calculates either
 Area
 Perimeter for Square, Rectangle, and Triangle
 Diameter, and Circumference for Circle.
 Volume for Cube and Sphere.
 The code draw using asterisks "*" and spaces for each shape except for circle, cube, and sphere only show the following message: “Drawing a circle in the text mode without a Drawing library is too hard to do!” .
5. The project' main method should provide a menu and sub menu that will allow the users to choose one of the six shapes shown below. The program exists when the user selects option 7. For each 2-D shapes, there is a submenu for area, perimeter, and draw. For each 3-D shapes, there is a submenu for area, volume, and draw.

Recommended Answers

All 4 Replies

You say you need help, but only posted your homework assignment. Please be more specific about what you want help with.

i don't know how i can start ! i did not really understand it !

Just to start:

class Shape2D
{
public:
   double area() = 0;
};

class Paralelogram : public Shape2D
{
public:
   double perimeter() = 0;
};

class Circles : public Shape2D
{
public:
   double diameter() = 0;
   double circunference = 0;
};

class Shape3D
{
public:
   double volume() = 0;
};

class Square : public Paralelogram
{
public:
   double area() {return with*with;}
   double perimeter() {/*...*/}
private:
   double with;
};

class Rectangle : public Paralelogram
{
public:
   double area() {/*...*/}
   double perimeter() {/*...*/}
private:
   double with, height;
};

//......

Hope this will help you.

break your problem into manageable pieces , think of it in term of x and y , start with the basic statement requiring user to enter the initial value then move into the next steps.
if you got stuck or some compiler error post your code or ask specific questions?
Goodluck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.