Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can u only have the outside of the box rather than the whole box b

Status
Not open for further replies.

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<<&quot;MAKING A BOX&quot;;
char character, restart;
textcolor(79);
clrscr();
int width,height,startx,starty,l,s,finish;
gotoxy(30,1);
cout<<&quot;1:please enter a character:&quot;;
cout<<&quot;\n>>>>>>>>>>----------:&quot;;
begin:
gotoxy(30,2);
cin>> character;
gotoxy(30,3);
cout<<&quot;2:please enter a width for both sides of the box:&quot;;
cout<<&quot;\n>>>>>>>>>>----------:&quot;;
cin>> width;
gotoxy(30,4);
cout<<&quot;3:please enter a length for both sides of the box:&quot;;
cout<<&quot;\n>>>>>>>>>>----------:&quot;;
cin>> height;
gotoxy(30,5);
cout<<&quot;4:Enter The x Value where you want to place the box:&quot;;
cout<<&quot;\n>>>>>>>>>>----------:&quot;;
cin>>startx;
gotoxy(30,6);
cout<<&quot;5:Enter The y Value where you want to place the box:&quot;;
cout<<&quot;\n>>>>>>>>>>----------:&quot;;
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 << &quot;\n\n\n\n\n\n\t\t\tDo you wish to do another (y/n)? &quot;;
cin >> restart;

if (restart=='n')
abort();
else

goto begin;






}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top