Pseudocode and Flowchart

I need help to write a good psudocode and a flowchart for the following programme please::::::::::::
//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);
int menu();

//main program

int main ()
{
//local identifiers

int Length, Width, Height, Halfheight, DesignCode, done=0;
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 Length and Width of a rectangle separated by a space:\n";
cin>>Length>>Width;
cout<<"Please enter the design character for the rectangle:\n";
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 Right Triangle :\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 Equilateral Triangle:\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 Diamond:\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()
{
int choice;
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";
cout<<setw(33)<<" 1. "<<"Square\n";
cout<<setw(33)<<" 2. "<<"Rectangle\n";
cout<<setw(33)<<" 3. "<<"Right Triangle\n";
cout<<setw(33)<<" 4. "<<"Equilateral Triangle\n";
cout<<setw(33)<<" 5. "<<"Diamond\n";
cin>>choice;
return choice;
}
void Square(int Sidef, char Symbolf)
{
for(int i=0; i<Sidef; i++)
{
for(int j=0; j<Sidef; j++)
cout<<Symbolf<<" ";
cout<<endl;
}
}
void Rectangle(int Lengthf, int Widthf, char Symbolf)
{
for(int i=0; i<Widthf; i++)
{
for(int j=0; j<Lengthf; j++)
cout<<Symbolf<<" ";
cout<<endl;
}
}
void Right_Triangle(int Heightf, char Symbolf)
{
for(int i=0; i<=Heightf; i++)
{
cout << setw(Heightf);
for(int j=0; j<i; j++)
cout<<Symbolf;
cout<<endl;
}
}
void Equilateral_Triangle(int Heightf, char Symbolf)
{
for(int i=0; i<=Heightf; i++)
{
cout << setw(Heightf-i+1);
for(int j=0; j<i; j++)
cout<<Symbolf<<" ";
cout<<endl;
}

}
void Diamond(int Halfheightf, char Symbolf)
{
for(int i=0; i<=Halfheightf; i++)
{
cout << setw(Halfheightf-i+1);
for(int j=0; j<i; j++)
cout<<Symbolf<<" ";
cout<<endl;
}
for(int i=Halfheightf-1; i>0; i--)
{
cout << setw(Halfheightf-i+1);
for(int j=0; j<i; j++)
cout<<Symbolf<<" ";
cout<<endl;
}
}//end of program
No. This is a thinking question, and you need to think your way through it in order to learn it.

Sorry, and good luck.
Topic archived. No new replies allowed.