Guest_imported
New member
- Jan 1, 1970
- 0
this is my box program
what the problem is that the interior of the box should not be there, eg when u try out the program and use the symbol e the whole box will be covered up with e's
so could somene give me some code to this program just to shiow the outside of the box
thanx
craig g
#include <iostream.h>
#include <conio.h>
#include <iomanip.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
cout<<"MAKING A BOX";
char character, restart;
textcolor(79);
clrscr();
int width,height,startx,starty,l,s,finish;
gotoxy(30,1);
cout<<"1lease enter a character:";
cout<<"\n>>>>>>>>>>----------:";
begin:
gotoxy(30,2);
cin>> character;
gotoxy(30,3);
cout<<"2lease enter a width for both sides of the box:";
cout<<"\n>>>>>>>>>>----------:";
cin>> width;
gotoxy(30,4);
cout<<"3lease enter a length for both sides of the box:";
cout<<"\n>>>>>>>>>>----------:";
cin>> height;
gotoxy(30,5);
cout<<"4:Enter The x Value where you want to place the box:";
cout<<"\n>>>>>>>>>>----------:";
cin>>startx;
gotoxy(30,6);
cout<<"5:Enter The y Value where you want to place the box:";
cout<<"\n>>>>>>>>>>----------:";
cin>>starty;
textcolor(2);
clrscr();
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 >> restart;
if (restart=='n')
abort();
else
goto begin;
}
what the problem is that the interior of the box should not be there, eg when u try out the program and use the symbol e the whole box will be covered up with e's
so could somene give me some code to this program just to shiow the outside of the box
thanx
craig g
#include <iostream.h>
#include <conio.h>
#include <iomanip.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
cout<<"MAKING A BOX";
char character, restart;
textcolor(79);
clrscr();
int width,height,startx,starty,l,s,finish;
gotoxy(30,1);
cout<<"1lease enter a character:";
cout<<"\n>>>>>>>>>>----------:";
begin:
gotoxy(30,2);
cin>> character;
gotoxy(30,3);
cout<<"2lease enter a width for both sides of the box:";
cout<<"\n>>>>>>>>>>----------:";
cin>> width;
gotoxy(30,4);
cout<<"3lease enter a length for both sides of the box:";
cout<<"\n>>>>>>>>>>----------:";
cin>> height;
gotoxy(30,5);
cout<<"4:Enter The x Value where you want to place the box:";
cout<<"\n>>>>>>>>>>----------:";
cin>>startx;
gotoxy(30,6);
cout<<"5:Enter The y Value where you want to place the box:";
cout<<"\n>>>>>>>>>>----------:";
cin>>starty;
textcolor(2);
clrscr();
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 >> restart;
if (restart=='n')
abort();
else
goto begin;
}