Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 10-19-2006, 03:11 PM   #1 (permalink)
 
Junior Techie

Join Date: Aug 2006

Posts: 73

Burn_Cycle

Send a message via AIM to Burn_Cycle
Default Java Help

I need help with some "easy programs". I just started i am very stuck... my book does not give me a very good library or instructions to form this program. It says,

"Write a program that constructs a "color object" with red, green, and blue, values of 50, 100, and 150. Then apply the brighten mehtod and print the red, green, and blue values of the resulting color.

Could someone help me with the format and print the values?

Also the format of a random number generator. I havnt learned True or false... not even If and then statements... So idk how im supose to do this stuff. Any help would be great. Im not askin you to do it for me just show me wtf im supose to be doing.
Thanks
Johnny
Burn_Cycle is offline  
Old 10-19-2006, 04:02 PM   #2 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

What is the purpose of the 'brighten' method?
jaeusm is offline  
Old 10-19-2006, 10:43 PM   #3 (permalink)
 
True Techie

Join Date: Jun 2006

Posts: 120

ablaye

Default

Here is a good java tutorial that might be able to help you.
ablaye is offline  
Old 10-20-2006, 12:25 AM   #4 (permalink)
 
Junior Techie

Join Date: Aug 2006

Posts: 73

Burn_Cycle

Send a message via AIM to Burn_Cycle
Default

Quote:
Originally posted by jaeusm
What is the purpose of the 'brighten' method?
They're just exercises to... idk the purpose really. Because this book doesn't make anysense because its telling me to do more advanced stuff than it has taught me. Thanks ablaye, i will take look at that.
Burn_Cycle is offline  
Old 10-20-2006, 10:04 AM   #5 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

There has to be instructions concerning the behavior of 'brighten'. If you don't know the inputs and the expected outputs of the program, then you can't start coding. Likewise, if you don't post that same information, we can't help you.
jaeusm is offline  
Old 10-20-2006, 12:56 PM   #6 (permalink)
 
Junior Techie

Join Date: Aug 2006

Posts: 73

Burn_Cycle

Send a message via AIM to Burn_Cycle
Default Re: Java Help

Quote:
Originally posted by Burn_Cycle
I need help with some "easy programs". I just started i am very stuck... my book does not give me a very good library or instructions to form this program. It says,

"Write a program that constructs a "color object" with red, green, and blue, values of 50, 100, and 150. Then apply the brighten mehtod and print the red, green, and blue values of the resulting color.
These were the instructions. It didn't tell me to look import any package or where to look. This is in chapter two. I just learned about variables and contructing (not printing) rectangles. So yeah, thats all i have learned jaeusm, and thats all it tells me. My teacher has the same book and she is doesn't know wtf is going on. So i personally think she sucks *** but o-well. Don't worry about the color program.

Havn't all of you created a random number generator though? Thanks for your guy's help anyways im gonna resort looking if i can figure it out by looking at sun's API docs.
Burn_Cycle is offline  
Old 10-20-2006, 02:33 PM   #7 (permalink)
 
Monster Techie

Join Date: Apr 2004

Posts: 1,574

m3trj

Default

A random number generator in Java:

double rand = Math.random();

rand now has a random number assigned to it.
__________________


\'There is only one basic human right, and that is to do as you **** well please.
And with it comes the only basic human duty, to take the consequences.\'



m3trj is offline  
Old 10-20-2006, 03:19 PM   #8 (permalink)
 
Junior Techie

Join Date: Aug 2006

Posts: 73

Burn_Cycle

Send a message via AIM to Burn_Cycle
Default

Ok.... Simple question, what package or packages would i be looking under. If you give me that i can do it all.
__________________
<IMG SRC="http://i39.photobucket.com/albums/e190/Damnation56/sweeeeet.jpg">
Burn_Cycle is offline  
Old 10-20-2006, 04:23 PM   #9 (permalink)
 
Monster Techie

Join Date: Apr 2004

Posts: 1,574

m3trj

Default

You shouldn't actually need to import any packages to be able to use methods from the Math class. Just try it without any imports.
__________________


\'There is only one basic human right, and that is to do as you **** well please.
And with it comes the only basic human duty, to take the consequences.\'



m3trj is offline  
Old 10-21-2006, 12:29 AM   #10 (permalink)
kfc469's Avatar
 
Ultra Techie

Join Date: May 2006

Posts: 924

kfc469

Send a message via AIM to kfc469
Default

dont u have to import math.random or java.util,Random? its been a while, so i could be wrong.
__________________

kfc469 is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On