answersLogoWhite

0


Best Answer

this the question:

Write a program that will simulate the following situation 10,000 times so we can decide the answer to:

Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which he knows has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?

The pseudocode for this assignment would be:

Run a loop 10,000 times that:

  • Randomly picks a door that is the "prize door"
  • Randomly picks a door that is the "first choice"
  • Removes one of the doors that is both not the "prize door" nor the "first choice"
  • Randomly picks one of the remaining doors as your "second choice"
  • Compares the "prize door" to the "first choice" and "second choice" and saves it

After the loop is done, output a message that tells how many times the "prize door" was the "first choice" and how many times the "prize door" was the "second choice" so we can know what is the best choice.

The output of the homework should look like:

Number of times staying was the correct strategy: [NUMBER]

Number of times switching was the correct strategy: [NUMBER]

Therefore, the best thing to do is to [STRATEGY].

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you solve this game show program in Linux by C plus plus language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What Linux games are good for kids?

TuxPaint - basic painting program TuxType - typing practice program / arcade game Tuxmath - math arcade game GCompris - reading, geography, algebra, etc... Omnitux - geometry Canta - music Piano Booster - piano tutorial Dr. Geo - geometry KTurtle - simple programming language / IDE


When was The Linux Game Tome created?

The Linux Game Tome was created in 1995.


Can you run Altitude Game on Linux?

Yes. There is a version for Linux available on the game's download page.


When was Linux Game Publishing created?

Linux Game Publishing was created on 2001-10-15.


Is there a cooking game for Linux?

No.


How do you become a video game writer?

Video game is a software. A software is a program. So you need to know how to program. Programs are written with programming languages. Pick a language and master it. You might not need to build everything from scratch. There are tools that can make building game easier. But you still have to program.


How do you make a program of a game by using the C programming language?

Typically you won't use C to write games, particularly non-trivial games. C++ is the language of choice for most game developers.


Simple c language program?

Well, this is a very open question, please be specific, I will try try to answer this as well, a simple c language program can be any thing from printing your name on the screen to printing some patterns using symbols, or making a small game, or a simple calculator program. you can a clearer picture of what can be a simple c language program here:


Why dont games work on Linux Ubuntu?

Well, you have to make sure that the game you are downloading is completely compatible with linux at all. Make sure that whatever website the game is that you are downloading, includes that it does support linux computers.


How do you program games?

you learn how in schoolIf your school doesn't have a programming class, then you can independently learn to program. You should start with an easy programming language, like Ruby or Python. Or, if you don't want to learn a programming language, you can get Game Maker. Game Maker has a drag-and-drop interface and there is an optional programming language included that gives you more power over your games.


Is game programming cool?

well that all depends. programing takes a lot of time, effort, and patience but seeing the end result is just amazing. To program you have to be able to go back find and solve problems and you have to know the language pretty well. In my opinion it's pretty fun.


How do you make a game in Microsoft Word?

Microsoft Word is not a language in which you can program a game. You can actually type the code but that you can do in any text editor and without unnecessary formatting. So if you want to program a game, try some other environment like java or flash.