Need Quick Help
Guys Iam an amatuer in C++ language. I need help with this program. Please if anybody can help me with it. Please write a code for me. Its a simple program but I dont know how to do it. Please its really important for me to do this stuff! THanks alot!
I have the output to how this program looks and Iam supposed to write a code for this. Please help me out buddies!
Here is the link to this Program output please download it and change the extension to .EXE . THankx alot guys! Waiting for early reply!
Guys I also have the algorithm see if this helps! THanx alot!
Input & Output~~~
The user will enter
1 for a triangle
2 for a rectangle
or 0 to quit
Any other number is unacceptable.
Use a loop to force the user to enter a valid value
Use a menu format for a prompt
If the user enters 1 or 2, she should be prompted to read a single character that will be used to create the figure.
any keyboard character may be specified
For a triangle, the user will enter the height of the triangle.
The output is a triangle created with height representing the number of lines on the screen. For example, a height of three would look like:
For rectangles, the user will enter the height and width of the rectangle.
The output is a rectangle created with height representing the number of lines on the screen and the width is the number of characters on each line. For example, a height of three and a width of four would look like:
Main should print the total number of characters used or an error message.
Create a main program loop controlled by the users response in the next step
Use a menu to ask the user to select 0, 1 or 2 (quit, triangle, rectangle)
Use a call-by-reference utility function to force the user to enter a number between 0 and 2.
If the user said to quit, leave the main loop.
use a call-by-reference function to ask the user to enter a character to be used when displaying the figure.
Use a call-by-reference function to ask the user to enter a height and (for rectangles only) a width.
Call a function that creates the image and returns
the number of characters used to create the image
or, 0 if the image was not created
An error has occured (return 0) if
the height is less than 1 or larger than 20
the width is less than 1 or larger than 40
This function must call another function to create one line of the image
main should check the value returned
Print the number of characters used
say something if an error occurred (zero return value)
Please if someone can write the full code help me out! I need serious help here!
Please download this and change it to .exe eh? We don't do homework anyways...
Here you go:
Never, ever, ever ask people to right code for you without a good attempt and never, ever, ever post something that contains an executable. Post your source code and make it a valid attempt.
Welcome to the forum, Harry.
You will find folks willing to help you with your program, but nobody is going to write the whole thing for you. :(
Please read the Forum Guidelines and Homework Policy.
While you're at it, take a look at Posting Code?...
Now start writing your program, and come back when you get stuck.
You're going to need some cin statements, some cout statements, some if-statements, some loops, etc.
I'd suggest you start-out making a rectangle of fixed-size.
Then when that works, add the code that allows the user to specify the rectangle dimensions.
Then when that works, do the same with the triangle.
Then when that works, add the code that allows the user to select between the rectangle, triangle, or quit.
You might want to develop your program in a different sequence.The important thing is to work on one part of the program at a time. Don't try to write the whole thing at once.
Keep adding functionality 'till you've covered eveything in the "specifications."
Post another thread when you have a serious attempt at producing some code.
This is done