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
Question 14 10 pts Assume that function random() is available to generate a random number from 0 to 1000 (i.e., set myRa
-
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!