Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

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++

Write a c application that does the followingitem 1 prompts

Write a C++ application that does the following: ITEM 1: Prompts the user to choose one of the following series: 1 + 1/2 + 1/3 + ... + 1/n ((((x * 2) * 2) * ...) * 2) series of n multiplications x + (x * 1) + (x * 2) + ( ...

1 three employees in a company are up special pay increase

1. Three employees in a company are up special pay increase. You are given a file, with the following data: Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 Each input line consists of an employee ...

C projectphase 11- you need to take input from user study

C project Phase 1 1- You need to take input from user study year (proper value check from 1 to 4) 2- Take input semester (proper value check 1 to 8) 3- Calculate GPA (use Loop, calculate GPA for semester 1,2,3...) Exampl ...

1 create a c visual studio console application with the

1. Create a C++ visual studio console application with the name Project2. (As usual, to make the grader happy, it is critical that your project as well as your zip file contain your name and the exercise or project numbe ...

Assignmentthis is the programthis program will use 2

Assignment This is the program: This program will use 2 different data structures to perform the same tasks; a vector and a dynamically sized array Write a complete C++ program that will: Declare a vector of integers wit ...

Create your own unique while-end repetition structure you

Create your own unique While-End repetition structure. You decide the theme. You should provide both the pseudocode and the flowchart of your example. Be sure to provide an overview of what your repetition structure is d ...

Assignmentthis assignment gives you the opportunity to

Assignment This assignment gives you the opportunity to practice array of pointers, linked lists and self referential structures. Write a program that initializes two parallel arrays as follows: char * String[] = { "Abbi ...

Write a program that reads numbers from cin and then sums

Write a program that reads numbers from cin and then sums them, stopping when 0 has been entered. Construct three versions of this program, using the while ,do - while , and for loops. Add the following to your program: ...

Object-oriented programming assignmentintroduction -nbspa

Object-Oriented Programming Assignment Introduction -  "A logical matrix or (0, 1) matrix is a matrix with entries from the Boolean domain B = {0, 1}. Such a matrix can be used to represent a binary relation between a pa ...

The second portion instruction shown below which is the

The second portion (instruction shown below) which is the actual C++ program is needed by this Saturday. Write a C++ program that is menu-driven that allows for the following menu choices:Load an exam: Loading an exam sh ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen