Help in projects for C++

Posted by: anubis

Help in projects for C++ - 02/26/08 12:15 PM

Hello, ok well I´m working on two projects for C++ and I was wondering who can help me out finish my project...It would be awesome I just need ideas, because I got stuck...thanks in advance...ok here they are:

I got stuck somewhere, but would like to know how would you write it..(i know I´m still learning \:\) )hehe..


1) During the summer your 6 year old sister asks you to help automate her lemonade stand. She wants to use the family PC to compute and print the bill. She sells a cup of ice for $0.25, a small glass of lemonade for $0.60, a large glass of lemonade for $1.00 and a cookie for $0.45. The interactive input/output should look exactly as shown below. Everything shown is output produced by the program except for the numbers (1, 1, 2, 4, 10.00) typed by the user in response to the prompts.




INPUT/OUTPUT
Enter number of cups of ice: 1
Enter number of small glasses of lemonade: 1
Enter number of large glasses of lemonade: 2
Enter number of cookies: 4

Total Amount Due = $4.65
Enter money paid: 10.00

=======================================
Lucky Lucy’s Lemonade Stand Bill

Cups of Ice
Quantity=1 Cost=$ 0.25
Small Glasses of Lemonade
Quantity=1 Cost=$ 0.60
Large Glasses of Lemonade
Quantity=2 Cost=$ 2.00
Cookies
Quantity=4 Cost=$ 1.80

Total Amount Due =$ 4.65
Money Paid =$10.00
Change Due =$ 5.35
=======================================
Posted by: anubis

Re: Help in projects for C++ - 02/26/08 12:24 PM

oh and the other I´m working on is about a game show, which I think its the one that is giving me problems.. :P

--Game Show

You are a contestant on a game show and have won a shot at the grand prize. Before you are three doors. $1,000,000 in cash has randomly been placed behind one door. Behind the other two doors are the consolation prizes of dishwasher detergent. The game show host asks you to select a door, and you randomly pick one. However, before revealing the prize behind your door, the game show host reveals one of the other doors that contain a consolation prize. At this point, the game show host asks if you would like to stick with your original choice or to switch to the remaining door.

Write a function to simulate the game show problem. Your function should randomly select locations for the prizes, select a door at random chosen by the contestant, and then determine if the contestant would win or lose if sticking with the original choice or switching to the remaining door. You may wish to create additional functions invoked by this function.
Next, modify your program so that it simulates playing 10,000 games. Count the number of times the contestant wins when switching vs. staying. If you are the contestant, what choice should you make to optimize your chances of winning the cash, or does it matter?

Hint 1: The probability is not always 50% or 33%.
Hint 2: Use the integers 0, 1, or 2 to represent the doors, and a variable to store which door is selected or contains a prize.
---

any help would be awesome (on codes)..
Posted by: anubis

Re: Help in projects for C++ - 02/26/08 12:25 PM

Actually on the first post I´m kind of ok,...I think it would be the second where I need ideas ... :o)
Posted by: anubis

Re: Help in projects for C++ - 02/26/08 01:03 PM

BTW I am working on it, I just need ideas, don´t think that I need the whole project done ...lol..