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!

needing serious help on an assignment which is very difficult for me

Status
Not open for further replies.

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<<&quot;Please enter a character:&quot;;
cout<<&quot;\n-------------:&quot;;
cin>> character;
cout<<&quot;Please enter a width:&quot;;
cout<<&quot;\n-------------:&quot;;
cin>> width;
cout<<&quot;Please enter a height:&quot;;
cout<<&quot;\n-------------:&quot;;
cin>> height;

cout<<&quot;Enter The x Value:&quot;;
cout<<&quot;\n&quot;;
cin>>startx;
cout<<&quot;Enter The y Value&quot;;
cout<<&quot;\n&quot;;
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 << &quot;\n\n\n\n\n\n\t\t\tDo you wish to do another (y/n)? &quot;;
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.
 

Most colleges frown upon collaboration on programming assignments. Some even consider it grounds for expulsion.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top