In c++, write a program that calculates 10,000 tries.

Assignment Help C/C++ Programming
Reference no: EM13161482

In C++, write a program that calculates 10,000 tries. These tries are based upon a rat trying to escape from a maze. Keep adding minutes until the rat is free and when he is free that is 1 try so we need 10,000. We start by randomly generating a number between 1 and 2. If 2, add 3 minutes to the try and go back to start and do it again until he is free. If 1, randomly generate a random number 1, 2 or 3. If 1, add 2 minutes and the rat is free so stop. If 2 or 3, add 5 minutes and go back to start and do it again until he is free. Once we get 10,000 tries, calculate the expected number of minutes that he will be trapped in the maze and the standard deviation of the amount of time the rat spends in the maze. 

Reference no: EM13161482

Questions Cloud

Why is a oil spill so dangerous : How would it harm a land environment like a park or a forest?
Describe how the popsicle stick looks and feels : Now take a popsicle stick and dip it into the water and oil to represent a marine animal accidentally swimming througfh an oil spill.
Compute the heat exchanger duty in kw : What is the latent heat of vaporization Tsat in kJ/mol? (Answers are 1366 kW and 28.4 kJ/mol) Please show work for good rating.
Which pair of terms most accurately describes life-history : which pair of terms most accurately describes life-history traits for a stable population of wolves?
In c++, write a program that calculates 10,000 tries. : In C++, write a program that calculates 10,000 tries. These tries are based upon a rat trying to escape from a maze. Keep adding minutes until the rat is free and when he is free that is 1 try so we need 10,000. We start by randomly generating a numb..
Creates an array named odds : Write code that creates an array named odds and stores all odd numbers between -6 and 38 into it using a loop. Make the array's size exactly large enough to store the numbers.
What is the gene make up of the two parents : A cross between two black guinea pigs produces some black guinea pigs and some white guinea pigs. What is the gene make up of the two parents?
Binary tree, print right view of it : Given a Binary Tree, print Right view of it. Right view of a Binary Tree is set of nodes visible when tree is visited from Right side.
Write an lc-3 machine language program : Write an LC-3 machine language program starting at location x3000 which divides the number in memory location x4000 by the number in memory location x4001 and stores the quotient at x5000 and the remainder at x5001.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Native method with deadlock detection and recovery

The naïve method with deadlock avoidance and the naïve method with deadlock detection and recovery - what will you measure and compare in order to determine the winner or which is better

  Illustrate example from ansi c programming language

Illustrate example from ANSI C programming language, without using nested procedures, to show the fact that "assignment-by-sharing in conjunction with quasi-dynamic object binding

  Add 10 people to the line

Add 10 people to the line and process them. Each time you process someone, print out their ticket information. After all 10 have been serviced, print the average wait time. Below is an example of the time calls you will need and a wait function.

  Insert the missing code in the c program

You are to insert the missing code in the C program given for combinational equivalence checking. This program will interface with the CUDD package and will parse netlist files in ISCAS85 circuit format. Next, BDDs will be created for each circuit an..

  Program to enter number of values to be processed

Write c++ statements to permit the user to enter n, the number of values to be processed; then assign the anonymous array of n double values, storing its address in doublPtr.

  C++ programming uml diagrams

The goal of this lab is to better familiarize you with polymorphism and the factory design pattern, two key components in Assignment

  Public transport fare ticketing system

Implement and test a public transport fare ticketing system.

  Execute tests and repetitions

Read data from standard input and store them in an array, Execute tests and repetitions

  Multiple heaps

Create an application that has two heaps. Place a linked list into each heap. Select one hundred random numbers. Place each of the random numbers into each heap - CSI 345 - Spring 2014 S2

  Write two short c programs and solve exam-style problem

Write two short C programs and solve four exam-style problems.

  Write a c program which takes a string from command line

Write a c program which takes a string from command line with mainfunction has no parameter and convert the string in upperca

  Write application which ask user to input grades of students

Write C++ application which asks user to input grades for 5 student (3 grades each) save them in five double one dimensional arrays (one array for each student),

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd