homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam

The Geek Culture Forums!

Post New Topic  New Poll  Post A Reply
my profile | directory login | | search | faq | forum home
  next oldest topic   next newest topic
» The Geek Culture Forums!   » Other Geeky Stuff   » Ask a Geek!   » I Need Help! Seriously!

 - UBBFriend: Email this page to someone!    
Author Topic: I Need Help! Seriously!
Geek Apprentice
Member # 3858

Rate Member
Icon 2 posted June 10, 2005 10:06      Profile for OhMyGoddessSixx     Send New Private Message       Edit/Delete Post   Reply With Quote 
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!


"You may be a lover, but you ain't no dancer!"

Posts: 42 | From: The 7th Level Of Hell aka East Wenatchee, WA | Registered: Apr 2005  |  IP: Logged
Member # 1229

Member Rated:
Icon 1 posted June 10, 2005 12:20      Profile for N9IWP     Send New Private Message       Edit/Delete Post   Reply With Quote 
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.


Posts: 181 | From: Southeast MN | Registered: Mar 2002  |  IP: Logged

All times are Eastern Time  
Post New Topic  New Poll  Post A Reply Close Topic    Move Topic    Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:

Contact Us | Geek Culture Home Page

© 2018 Geek Culture

Powered by Infopop Corporation
UBB.classicTM 6.4.0

homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam