Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago