Any one who could help me to solve this in C++ PLZ

Discussion in 'Programmer's Corner' started by maksud, Apr 7, 2009.

  1. maksud

    Thread Starter New Member

    Feb 26, 2009
    4
    0
    Write a program to control the action of a chocolate machine. Display a message to ask what kind of chocolate is required: Plain (30p), Brazil nut (35p), Luxury (50p). Use keyboard to get the input character. This input must be validated as P, B or L depending on the choice. Then money must be requested, in the form: “Please insert 30p “depending on the selection. Display the message until the required amount has been input. If too much has been inserted, then display a message indicating the amount of change owing. And also display a message indicating ‘Thanks for Buying’. Try to use the function.
     
  2. Salgat

    Active Member

    Dec 23, 2006
    215
    1
    Was bored at job, botched together for you, have fun.
     
  3. maksud

    Thread Starter New Member

    Feb 26, 2009
    4
    0
    hi thank you some much ......thats really great job.but unfortunetly i made a mistake when i post the topics ....i need to do that using function and SWITCH command . i didn't mention that when i post it ....relly sorry for that ....could any one solve it by using function and SWITCH command .....that would helpful for me ......Thanks
     
  4. Salgat

    Active Member

    Dec 23, 2006
    215
    1
    Take the program I made and modify it. Replace the if tests with switch cases and place whatever you're supposed to into a separate function.
     
Loading...