subject
Computers and Technology, 06.04.2020 07:21 jhitotw

Review the following code for different random number generators:
Random rnd = new Random();
int month = rnd. Next(1, 13); // 1 <= month < 13
int dice = rnd. Next(1, 7); // 1 <= dice< 7
int card = rnd. Next(53); // 0 <= card< 53
Using what you know of programming, what do each of the three options indicate they are doing? What does the “big” largest number indicate about the way this coding language treats . rnd and maximums? When might you want a random number generator in a game?The unit discusses the weaknesses of copy-and-pasting code: it leads to errors when you forget to change a value or miss part of the section you meant to copy. Can you think of any other risks to “Copy Pasta?” Do you agree with the unit’s argument? Why or why not?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
Write a program that uses a widgetviewer object to do the following: generate two random integers between 1 and 9 (inclusive). name one of them x, the other y. display them to the user using jlabel objects. create a jlabel object displaying the text "enter an operation number." create a jtextfield for the user's input. create a jbutton displaying the text "press here when you've entered your operation." use addandwait to add it to the widgetviewer object. when the user clicks the jbutton, evaluate operation in the following order to determine the one and only mathematical operation to perform on x and y. use a jlabel to display the result. if operation is between 1 and 10 inclusive, add x and y. if operation is evenly divisible by 4, subtract y from x. if operation is evenly divisible by 5, use integer division to divide y into x. if operation is an even number, use floating point division to divide y into x. if none of the other tests on operation apply, multiply x and y. note: operation can be negative or zero.
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
The basic work area of the computer is it screen that you when you first fire up your computer
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
question
Computers and Technology, 24.06.2019 00:00
The gene form of a trait is called a(n) 
Answers: 2
You know the right answer?
Review the following code for different random number generators:
Random rnd = new Random();
Questions
question
Mathematics, 09.09.2020 23:01
question
Mathematics, 09.09.2020 23:01
Questions on the website: 13722359