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

Assignment part acreate a checkbook program using c

Assignment (part a) Create a Checkbook program using C : • Create a Check structure. Include:   o Check number (should be an integer).   o Date (use type char[ ]).   o To   o Amount   o Description • Add functions to:   ...

Computer applications divisionassignment c programmingstl

COMPUTER APPLICATIONS DIVISION Assignment: C++ PROGRAMMING STL Vector For this assignment, you will be starting with an example program that demonstrates the use of a STL vector. In addition to this, you may need to look ...

Write a console-based c program that can be used as a math

Write a console-based C++ program that can be used as a math tutor for a young student. The program should display two random numbers consisting of three digits each to be added in columnar format, such as: 247 +129 ---- ...

Write a program to draw a symmetric shape of your own using

Write a program to draw a symmetric shape of your own using C++ user-defined functions and arrays. The program should draw a shape in its original and opposite forms (black and white and then white and black). Please con ...

Transaction processing system tpsxyz electronics is one of

Transaction Processing System (TPS) XYZ Electronics is one of the most popular electronics companies In Sultanate of Oman the company offers affordable electronic gadgets such as mp3 players, portable movie players, mobi ...

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

Assignmentwhen writing c programs include comments in your

Assignment When writing C++ programs include comments in your code, make the program readable by indenting, use meaningful variable and function names, and produce meaningful output. This assignment will be to write a bm ...

Intro to programming in c assignmentsince this is the last

Intro to Programming in C Assignment Since this is the last assignment, there will be no late submission. All programs must be electronically submitted by 5:00pm on Tuesday, December 2nd with NO EXCEPTIONS in order to re ...

Computer sciencewhere do you think c and coding games in c

Computer Science Where do you think C++ and coding games in C++ is headed in the next five years? How about in the next 10 years? Do you think there are any significant improvements that need to be made to the code to en ...

  • 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