Thread: need help~~

  1. #1
    Registered User
    Join Date
    Aug 2015
    Posts
    3

    Need help please

    Hello?
    I have to do C progamming but still cannot understand.So please help me.



    Here is Example, A Cup of Coffee
    Melbourne people love their coffee. A coffee lounge will provide a set menu of such items as cappuccino, latte, macchiato, espresso etc. However you might like something different.
    Your first option could be the size, small, medium or large cup.
    your second option might be the type of milk, normal, skinny, soy or none.
    The third option might be the strength, one two or three shots of coffee.
    The fourth option might be the condiments, no sweetener, white sugar, brown sugar, chocolate sprinkles or hundreds and thousands (which are added to make up a Happy Chino).
    Each of the options might have a set price. For instance, one shot of coffee might cost $0.00 while two shots might be $1.00 and three shots could be $2.00. You will make up your own prices. Soy milk might cost $0.50 over ordinary milk and hundreds and thousands might cost an extra $0.20. Sugar would be free.

    If I ordered a large cup $2.00
    Soy milk $1.50
    Double shot $0.50
    Brown sugar $0.00
    The total cost of my coffee would be $4.00





    Your Job

    Choose a type of food with which you are familiar (but not coffee as this will be used for demonstrations) and let your teacher know of your choice.
    Construct your C program based on the flow chart on the following page and ensure that it demonstrates the processes listed in the marking guide. Remember that you are expected to use the concepts taught to you in class. While additional research and use of advanced C concepts which have not been covered in class is encouraged, you will need to be able to verify that the use of these processes is your own work.
    Some Food Ideas from which you can choose if you wish:

    hamburgers, fish, Dim Sims, Soup, a Chinese dish, a dish from your own country, pastry, pie, chips, sausages, vegetarian dish, ice cream, BBQ, a drink, rice, fruit, jelly, oysters, dessert, beer, wine, an Indian dish, a salad roll.







    Predefined Function Referred to in the Flow Chart

    start-Initialise variables-Instructions-Ingredient Selection 1-Ingredient Selection 2-Ingredient Selection 3-Ingredient Selection 4-Order complete? (If yes)-Cost, Items bought-Stop
    (If not) Add one to
    Number of items ordered.- Return back to Ingredient Selection 1



    * Ingredient Selection*
    Options list-Input Pick-Data valid? (If yes) Add to cost
    (If no) Warning and change red color screen.









    Marking Guide
    The display output has clear and understandable initial instructions . 2 marks

    The customer has at least four sets of selection to choose from. 2 marks


    The customer can to continue to order if that is his/her wish.
    2 marks

    The correct total charge and number of items ordered are displayed. 2 marks

    The customer sees a selection of screen and text colours that change to make the display more informative and interesting. 2 marks

    The C program has sufficient comments (at least eight) to explain the purposes of its different parts. 2 marks

    Entered data is validated and does not cause a program crash. 2 marks

    The C program uses the Switch function . 2 marks

    The C program is carefully and correctly indented. 2 marks

    Output information is correctly formatted
    (e.g. $56.00 not $ 56.000000). 2 marks


    Thanks~!
    Last edited by passion0224; 09-01-2015 at 12:45 AM.

  2. #2
    Registered User StepUp's Avatar
    Join Date
    Aug 2015
    Location
    Iran , Tehran
    Posts
    3
    Why you post ur problem in both C/C++ Forums ?
    1 is enough
    LOL

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,838
    What exactly are you having trouble understanding?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Aug 2015
    Posts
    3
    Actually, I am a beginner about C program and I did not learn about switch function and still confuse about scanf. I know that is really basic but I cannot get it.

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,838
    Quote Originally Posted by passion0224
    Actually, I am a beginner about C program and I did not learn about switch function and still confuse about scanf. I know that is really basic but I cannot get it.
    For the switch statement, your learning material should have something about it, so you should revise that part. If it really does not, then perhaps your instructor wants you to be proactive in finding your own learning material, so you could try tutorials online, e.g., the one on this website.

    For scanf: you need to be more specific as to what confuses you.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed