Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

problem 1) prepare a C program that acts as a monty hall game host that continuously hosts the game and the user of the program acts as the player. The program would loop over the playing of this game.

1) In every game, doors are labelled by 1,2 and 3 respectively. A game begins by putting the prize behind the door at random, then prompts the user to pick a number from {1,2,3}, that indicates the user picks.

2) Program then decides a door to open. The door should be one behind which there is no prize and that is not picked by the user.

3) In case there are two such doors available, program picks one at random. Program next prompts the user to decide if he wants to switch.

4) Based on the user’s decision, program outputs if a user won the prize or not. The loop over game play finishes if the user picks the invalid door number, as in a number outside {1,2,3}, at the beginning of a game. When the loop is over, program outputs the total number of games which have been played, number of games in which the user has won, and the relative frequency winning.

5) Then prepare the second program which stimulates the playing of two games by two specific users, first user consistently decides on "switch" and second user consistently decides on "not switch". For each user, 10000 game plays would be stimulated, and in each game, the initial pick by a user is made random, the program should print how many games each user has won and winning frequencies for each user.

6) The program outputs total number of games which have been played, the number of games in which the user has won, and the relative.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M94705

Have any Question? 

Related Questions in C/C++

Question 1you are facing the following problem you are

Question 1 You are facing the following problem: You are given a robot and your task is to "guide" the robot through a 2-dimensional maze such that the robot can reach a desired goal state. Assume that the maze is define ...

C program codeoverviewfor this assignment write a program

C++ program code Overview For this assignment, write a program that will simulate a single game of Craps. Craps is a game of chance where a player (the shooter) will roll 2 six-sided dice. The sum of the die will determi ...

Fix a programthe program is already done and it runs welli

Fix a program The program is already done and it runs well.. I just need someone to fix it for me, the problem happens when you insert invalid day or invalid ticket type, I want you to end the program *at that point* as ...

Computer scienceprogram-write a c program that willpresent

Computer Science Program- Write a C++ program that will: Present the user with a menu of choices: 1. Random number 2. String 3. Type Casting 4. Integer Math Then, in an if-else if structure (or switch) write the code for ...

Here are two examplesifcounter7continueifcounter7break1

Here are two examples: if(counter==7) continue; if(counter==7) break; 1. Write a for loop that counts only the odd numbers out of the first five numbers entered from the keyboard, but does not count (skips) the number 7. ...

Discussion questionsplease respond to all of the following

Discussion Questions Please respond to all of the following prompts: • What is a friend function and how is it declared? • Which operators cannot be overloaded and why? • What is a macro in C++ programming and what are s ...

Assignment simple 5-card poker gamein this assignment you

Assignment: Simple 5-Card Poker Game In this assignment, you will develop a simple poker game, complete with basic AI, using the object oriented programming principles discussed in class. Flow of Play Your poker game's p ...

A write an array implementation of self-adjusting lists in

a. Write an array implementation of self-adjusting lists. In a self-adjusting list, all insertions are performed at the front. A self-adjusting list adds a find operation, and when an element is accessed by a find, it is ...


Program Write a C++ program that will: Ask the user for the name of an input file. Read in this name and open that text file for input. Ask the user which of two options they want to do: Read in student data Count lines ...

Text exercise 413 gas mileagebulldrivers are concerned with

Text Exercise 4.13 (Gas Mileage) • Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several trips by recording miles driven and gallons used for each trip. Develop a C++ ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate