Guest_imported
New member
- Jan 1, 1970
- 0
i have truble with c++ programming and need help with some stuff this is the requirements
please help as i am new in cpp programming and you guy's are my only chance
The program must draw a box on the screen according to the user’s requirements. The box will be hollow and its sides, top and bottom are drawn using the same character. The user will be able to choose the position and size of the box, and the character used to draw the box.
The program must have a menu with the following options:
Char to input the character used to draw the box border
Co-ord to enter the box coordinates (left, top, right and bottom)
Draw to draw the box
Q to quit the program
When the program draws the box, it will not erase the interior of the box. When the user changes the position and size of the box, the program will not erase the previous box, except where the new box’s border or the menu overwrites the previous box’s border.
The program must be easy to use in all respects. The program logic should be straightforward and not unnecessarily complex. The source code should be tidy and have consistent indentation, a heading showing the programs title, purpose, date and author, and a brief comment on each loop and decision.
The user can choose the colour in which the box border is drawn.
The user can choose to erase the interior of the box.
this is what i have done so far
#include <iostream.h>
#include <conio.h>
#include <iomanip.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
char character;
int width,height,startx,starty,l,s,finish;
cout<<"Please enter a character:";
cout<<"\n-------------:";
cin>> character;
cout<<"Please enter a width:";
cout<<"\n-------------:";
cin>> width;
cout<<"Please enter a height:";
cout<<"\n-------------:";
cin>> height;
cout<<"Enter The x Value:";
cout<<"\n";
cin>>startx;
cout<<"Enter The y Value";
cout<<"\n";
cin>>starty;
l=1;
while (l<=height)
{
s=1;
gotoxy(startx,starty);
while(s<=width)
{ s=s+1;
cout<<character;
}
l=l+1;
starty++ ;
}
cout << "\n\n\n\n\n\n\t\t\tDo you wish to do another (y/n)? ";
cin >> finish;
finish = toupper(finish); // converting to upper case
}
could someone give me some of the code to finish it off like the menu's etc.
please help as i am new in cpp programming and you guy's are my only chance
The program must draw a box on the screen according to the user’s requirements. The box will be hollow and its sides, top and bottom are drawn using the same character. The user will be able to choose the position and size of the box, and the character used to draw the box.
The program must have a menu with the following options:
Char to input the character used to draw the box border
Co-ord to enter the box coordinates (left, top, right and bottom)
Draw to draw the box
Q to quit the program
When the program draws the box, it will not erase the interior of the box. When the user changes the position and size of the box, the program will not erase the previous box, except where the new box’s border or the menu overwrites the previous box’s border.
The program must be easy to use in all respects. The program logic should be straightforward and not unnecessarily complex. The source code should be tidy and have consistent indentation, a heading showing the programs title, purpose, date and author, and a brief comment on each loop and decision.
The user can choose the colour in which the box border is drawn.
The user can choose to erase the interior of the box.
this is what i have done so far
#include <iostream.h>
#include <conio.h>
#include <iomanip.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
char character;
int width,height,startx,starty,l,s,finish;
cout<<"Please enter a character:";
cout<<"\n-------------:";
cin>> character;
cout<<"Please enter a width:";
cout<<"\n-------------:";
cin>> width;
cout<<"Please enter a height:";
cout<<"\n-------------:";
cin>> height;
cout<<"Enter The x Value:";
cout<<"\n";
cin>>startx;
cout<<"Enter The y Value";
cout<<"\n";
cin>>starty;
l=1;
while (l<=height)
{
s=1;
gotoxy(startx,starty);
while(s<=width)
{ s=s+1;
cout<<character;
}
l=l+1;
starty++ ;
}
cout << "\n\n\n\n\n\n\t\t\tDo you wish to do another (y/n)? ";
cin >> finish;
finish = toupper(finish); // converting to upper case
}
could someone give me some of the code to finish it off like the menu's etc.