T O P I C R E V I E W
Member # 3858
posted June 10, 2005 10:06|
I've only got a few hours until I have to turn some projects in, and I'm about to rip out my hair.
First, my professor wants us to create a questionnaire as a Java program which scores a estimate for mania ;we have to base it off a quiz he found on a site. I can't figure out for the life of me how to do an estimate program.
Second, he also wants us to create a program that picks a random number for the user to guess.
This number should be in the range of 1 to 100.
The Java function: --sorry couldn't use parentheses
produces a random value between 0 and 1
double x = Math.random
will store a value in x such that 0 < x < 1
n = [int][Math.random*100]
will store a value in n such that 0 < n < 1
I can't figure out how to do this either.
Any help would be most appreciated! I am runnning out of time; everything is due today! Thank you in advance!
Member # 1229
posted June 10, 2005 12:20|
I don't know Java, but your second example should do 0 to 99.
n = [int][Math.random*100] + 1;
should get n from 1 to 100 inclusive
I'm unfamilar with "mania" in this context, so I can't help you with the estimate question either.