Question 14 10 pts Assume that function random() is available to generate a random number from 0 to 1000 (i.e., set myRa

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Question 14 10 pts Assume that function random() is available to generate a random number from 0 to 1000 (i.e., set myRa

Post by answerhappygod »

Question 14 10 Pts Assume That Function Random Is Available To Generate A Random Number From 0 To 1000 I E Set Myra 1
Question 14 10 Pts Assume That Function Random Is Available To Generate A Random Number From 0 To 1000 I E Set Myra 1 (44.95 KiB) Viewed 44 times
answer in psuesdo code
Question 14 10 pts Assume that function random() is available to generate a random number from 0 to 1000 (i.e., set myRandom = random() would assign a value between 0 to 1000 to myRandom). Provide necessary steps to assign a random value to an Integer variable, myRandom. You should be able to complete part b using one step, but feel free to use more than one step if needed. Note: you cannot use random(x, y) to generate a value between x and y like pseudocode in book for this problem. Hint: you can get a random number between 0 and 1 by performing random() % 2. a. A random number between 1 and 5 b. An odd random number between 1 and 10 (hint: how many different values?) 1/ copy/paste and provide answers below: a. b. Edit View Insert Format Tools Table 12pt Paragraph
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply