10 likes | 91 Views
A program to determine the initial cash amount based on a man's visit to multiple casinos, losing money each time, and paying entrance and coat retrieval fees. Test various cash amounts starting from €5.
E N D
A man goes in to a casino. He pays a euro entrance fee, he loses half his money, and he pays a euro to get his coat from the cloakroom when he leaves. He goes to a second casino. Again, he pays a euro to enter, loses half his money in the casino, and he pays a euro to get his coat from the cloakroom. He goes to a third casino, pays a euro to enter, lose half of his money, pays his last euro to get his coat from the cloakroom and leaves, having spent all his cash.Write a program to determine the amount that the man started with by testing different cash amounts (whole numbers). Start with €5.