Question: 1. Create a program that allows a user to select the height and width of a rectangle border to build with any character. Limit height

1. Create a program that allows a user to select the height and width of a rectangle border to build with any character. Limit height and width values from 3 to 20. Make sure your program checks for illegal entries and allows a user to keep trying if inputs are out of range. Output just the perimeter of the rectangle.

2. It can be shown analytically (see a math major) that the long term probability of winning the dice game you have programmed is .4929293. Streamline the program you wrote above to run a large number of turns and calculate the empirical (experimental, simulated) probability. 1,000,000 times through the for loop took about 2 seconds on a computer similar to those in the classroom. If yours takes longer than 10 seconds there is probably something wrong in your program. It is a good idea to run your loop only 100 or so times the first few times through. Tip: Be careful of integer division! C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!