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

  Write c program which has parent process and child process

Write a C program that has a parent process, a child process, and a grandchild process. The parent process should print its id and the square or 5.

  Design and implement a library system

Design and implement a library system that does the following: ? Takes details of a student/library users: first name, last name, other names, user ID number, and nationality.

  Design a class named employeerecord

Design a class named EmployeeRecord that holds an employee's ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that

  File system with login authentication

Implement a simple file system with login authentication and access control - Construct a hash/salt/shadow based user/password creation system.

  Returns a count of the steps through the sort

Please write a c++ implimentation that returns a count of the steps through the sort. (do not worry about updating count, I will rewrite that segemnt. I need help with writing the shell sort.

  Draw the heap

Eric Rowe Starting with an empty minheap, draw the heap after each the completion of the following operations  and repeat for a maxheap (replace removeMin() with removeMax()). Upload your drawings here. Hand drawn is fine:

  You will create a linked list module

You will create a linked list module that exactly meets the specifications given in the supplied header (.h) file. The playlist program must accept a filename on the command line (argv).

  Stores a series of numbers in a binary tree.

Queue Converter, Write a program that stores a series of numbers in a binary tree. Then have the program insert the values into a queue in ascending order. Dequeue the values and display them on the screen to confirm that they were stored in the prop..

  Prepare a program that uses at least two functions

Prepare a program that uses at least two functions that can be called from your main.

  Write program in c to calculate diameter-compression load

Write a program in C to calculate diameter in centimeters of steel rod, an aluminum rod, and a copper rod, which can withstand a particular compression load.

  Program to add numbers and display sum

For each of problems write C++ code to do the required task. Receive the number and find out whether it is odd or even.

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

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