Geometric Shapes

This program will out put different geometric figures enlisted there. But i am having hard time at last part and it also tells me I got it wrong in menu(). Someone please help me out. Thanks a lot
//complier directives

#include<iostream>

#include<iomanip>

#include<cstdlib>

using namespace std;

//function prototypes
void Rectangle(int Lengthf, int Widthf, char Symbolf);
void Square(int Sidef, char Symbolf);
void Right_Triangle(int Heightf, char Symbolf);
void Equilateral_Triangle(int Heightf, char Symbolf);
void Diamond(int Halfheightf, char Symbolf);

//main program

int main ()
{
//local identifiers

int Length, Width, Height, Halfheight, DesignCode,done;
char Symbol;
//input module
do
{
DesignCode = menu();
switch(DesignCode)
{
case 1;
cout<<"Please enter the length of the sides of the square:\t";
cin>>Length;
cout<<"Please enter the design character for the square:\t";
cin>>Symbol;
Square(Length, Symbol);
break;

case 2;
cout<<"Please enter the Length and Width of the rectangle seperated by a space:\t";
cin>>Length>>Width;
cout<<"Please enter the design character for the square:\t";
cin>>Symbol;
Rectangle(Length,Width,Symbol);
break;

case 3;
cout<<"Please enter the Height of the Right Triangle:\t";
cin>>Height;
cout<<"Please enter the design character for the square:\t";
cin>>Symbol;
Right_Triangle(Height,Symbol);
break;

case 4;
cout<<"Please enter the Height of the Equilateral Triangle:\t";
cin>>Height;
cout<<"Please enter the design character for the square:\t";
cin>>Symbol;
Equilateral_Triangle(Height,Symbol);
break;

case 5;
cout<<"Please enter the Halfheight of the Diamond:\t";
cin>>Halfheight;
cout<<"Please enter the design character for the square:\t";
cin>>Symbol;
Diamond(Halfheight,Symbol);
break;

case 6;
done=1;

}//end of switch
if(!done)
{
system("PAUSE");
system("CLS");
}
}while(!done);
return 0;
}//end of program

//funtion defination

//function heading
int menu()
{
cout<<setw(57)<<"Welcome to Acorn's World of Shapes":\n";
cout<<"Please setect your favorite shapes from the list below:\n";
cout<<"\t:\t\n";
cin>>choice;
1. Rectangle
2. Square
3. Right_Triangle
4. Equilateral_Triangle
5. Diamond
}
void Rectangle(int Lengthf, int Widthf, char Symbolf)
{
for(int i=0, i<Lengthf, i++)
for(int j=0, j<Widthf, j++)
cout<<Symbolf;
}
void Square(int Sidef, char Symbolf)
{
for(int i=0, i<Sidef, i++)
for(int j=0, j<Sidef, j++)
cout<<Symbolf;
}
void Right_Triangle(int Heightf, char Symbolf)
{
for(int i=0, i<Heightf, i++)
for(int j=0, j<Lengthf, j++)
cout<<Symbolf;
}
void Equilateral_Triangle(int Heightf, char Symbolf)
{
for(int i=0, i<Heightf, i++)
for(int j=0, j<Sidef, j++)
cout<<Symbolf;
}
void Diamond(int Halfheightf, char Symbolf)
{
for(int i=0, i<Halfheightf, i++)
for(int j=0, j<Sidef, j++)
cout<<Symbolf;
}
return choice;
Use code tags
1
2
3
4
5
6
7
8
9
10
11
12
int menu()
{
cout<<setw(57)<<"Welcome to Acorn's World of Shapes":\n";
cout<<"Please setect your favorite shapes from the list below:\n";
cout<<"\t:\t\n";
cin>>choice;
1. Rectangle
2. Square
3. Right_Triangle
4. Equilateral_Triangle
5. Diamond
} 


Lines 7 to 11 are not C++ commands. i assume that you want to print them. Also print them before you ask for choice. Also, there is an extra quote symbol on line 3
Last edited on
Please use code tags. You can get them from the <> button to the right of the posting box.

Now... about this bit of code...
1
2
3
4
5
1. Rectangle
2. Square
3. Right_Triangle
4. Equilateral_Triangle
5. Diamond


Is this what you're feeding into the compiler? Because I think you're missing a cout statement and some quotation marks.

-Albatross
When I compile the programme, it says there are many uncleared character such as choice, done, and others.
I wrote 1. Rectangle
2. Square
3. Right_Triangle
4. Equilateral_Triangle
5. Diamond
as c++ code but still doesn't really work. Any help please and thanks alot for your help
Topic archived. No new replies allowed.