Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a complete C++ program that does the following. and please include the comments to explain what you did. thankyou! Use C++'s Random Number Generator
Write a complete C++ program that does the following. and please include the comments to explain what you did. thankyou!
Use C++'s Random Number Generator (RNG to generate random windspeed values, and print the Beaufort Wind Category for each value. The sample program random and clock cpp will help with this part of the assignment. The Beaufort Wind Scale (http scale) defines 12 s://en.wikipedia.org/wiki/Beaufort wind categories: 1mph calm 1-3 ght air 4-7 ight breeze 8-12 gentle breeze 13-18 moderate breeze 19-24 fresh breeze 25-31 strong breeze 32-38 high wind 39-46 gale 47-54 severe gale 55-63 Storm 64-72 violent storm >73 hurricane Assignment 1: 1) Using a for loop, use rand() to generate 10 random windspeed values between 0 and 100, and print the wind speed and theBeaufort Wind Scale label for each value. 2) Once you have that working, add a few lines of code to prompt the user for a seed value, and run your program several times, seeding the RNG with different values. a) If you use the seed value of 1, you should getthe same random sequence that you got in part 1. b) If you use a different seed (say, 100) you should get a difference sequence; if you run again with the same seed, you should get that same sequence. 3) Modify your program so if the user gives you a negative number for the seed, you seed the RNG from the system clock (see the sample program). name your program random winds cpp
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started