Question: help please Game designers often require a random die roll. Engineering applications sometimes need a set of random values within a specified range. To create
Game designers often require a random die roll. Engineering applications sometimes need a set of random values within a specified range. To create a random die roll on a 6-sided die (i.e. to generate numbers between 1 and 6) use rand() % 6 + 1 . It is generally believed that more than 70% of games are coded using C++ 4) Write down an expression that generates a random number between 1 and 10. Now, write a C++ program which generates a random number between 1 and 10. It then asks the user to enter a guess, if the input matches the generated value, the user wins otherwise s/he loses. Note: Each time you run this program, you'll get the same generated value; therefore, use a different seed on each new run 7) The table below shows the normal boiling points of several substances. Write a program that prompts the user for the observed boiling point of a substance in C and identifies the substance if the observed boiling point is within 5% of the expected boiling point. If the data input is more than 5% higher or lower than any of the boiling points in the table, the program should output the message "Substance unknown". Water Mercury Copper Silver Gold Normal boiling point ( c) 100 357 1187 2193 2660
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
