Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using Java, generate a random number between negative 0.02 (inclusive) and 0.1 (exclusive). ONLY MATH.RANDOM() CAN BE USED. I am having a hard time generating
using Java, generate a random number between negative 0.02 (inclusive) and 0.1 (exclusive).
ONLY MATH.RANDOM() CAN BE USED.
I am having a hard time generating random number between those ranges, this is how I did it, but I am not sure if it is correctly generating random numbers between the range specified.
double random = ((Math.random() * 0.1) + -0.02);
if this is not correct, then how do I do it?
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