Need Quick Help

This is a discussion on Need Quick Help within the C++ Programming forums, part of the General Programming Boards category; Guys Iam an amatuer in C++ language. I need help with this program. Please if anybody can help me with ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    1

    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!

    LINK~~~~ http://www.megaupload.com/?d=6QQALGT9




    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.


    Algorithm~~~~

    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.
    Otherwise
    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!
    Last edited by virginharry; 11-22-2005 at 05:11 PM.

  2. #2
    Rabite SirCrono6's Avatar
    Join Date
    Nov 2003
    Location
    California, US
    Posts
    269
    Please download this and change it to .exe eh? We don't do homework anyways...

    - SirCrono6
    From C to shining C++!

    Great graphics, sounds, algorithms, AI, pathfinding, visual effects, cutscenes, etc., etc. do NOT make a good game.
    - Bubba

    IDE and Compiler - Code::Blocks with MinGW
    Operating System - Windows XP Professional x64 Edition

  3. #3
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,069
    Here you go:

    Code:
    a code for me.
    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.
    Sent from my iPadŽ

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    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."

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    Post another thread when you have a serious attempt at producing some code.
    This is done

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strcmp returning 1...
    By Axel in forum C Programming
    Replies: 12
    Last Post: 09-08-2006, 07:48 PM
  2. Do you know...
    By davejigsaw in forum C++ Programming
    Replies: 1
    Last Post: 05-10-2005, 10:33 AM
  3. Questions on basic Quick Sort
    By Weng in forum C++ Programming
    Replies: 4
    Last Post: 12-16-2003, 09:06 AM
  4. Quick Sort Help
    By NavyBlue in forum C Programming
    Replies: 1
    Last Post: 03-02-2003, 09:34 PM
  5. Replies: 0
    Last Post: 04-30-2002, 07:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21