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

Forum Home Post A Reply

my profile | directory login | | search | faq | forum home


» The Geek Culture Forums! » Other Geeky Stuff » Ask a Geek! » I Need Help! Seriously! » Post A Reply


Post A Reply
Login Name:
Password (max 13 characters):
Message Icon: Icon 1     Icon 2     Icon 3     Icon 4     Icon 5     Icon 6     Icon 7    
Icon 8     Icon 9     Icon 10     Icon 11     Icon 12     Icon 13     Icon 14    
Message:

HTML is not enabled.
UBB Code™ is enabled.

 

Instant Graemlins Instant UBB Code™
Smile   Frown   Embarrassed   Big Grin   Wink   Razz  
Cool   Roll Eyes   Mad   Eek!   Confused   Happytears  
blush   Beard of Peter Gabriel!   crazy   tired   ohwell   evil  
shake head   cry baby   hearts   weep   devil wand   thumbsup  
thumbsdown   Geek   Applause   Angel   Envy    
Insert URL Hyperlink - UBB Code™   Insert Email Address - UBB Code™
Bold - UBB Code™   Italics - UBB Code™
Quote - UBB Code™   Code Tag - UBB Code™
List Start - UBB Code™   List Item - UBB Code™
List End - UBB Code™   Image - UBB Code™

What is UBB Code™?
Options


Disable Graemlins in this post.


 


T O P I C     R E V I E W
OhMyGoddessSixx
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

Math.random[]

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!

OMG6
 
N9IWP
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.

Brian
 




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