Java Help

Status
Not open for further replies.

Burn_Cycle

Baseband Member
Messages
73
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
 
jaeusm said:
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.
 
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.
 
Burn_Cycle said:
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.
 
A random number generator in Java:

double rand = Math.random();

rand now has a random number assigned to it.
 
Ok.... Simple question, what package or packages would i be looking under. If you give me that i can do it all.
 
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.
 
dont u have to import math.random or java.util,Random? its been a while, so i could be wrong.
 
Status
Not open for further replies.
Back
Top Bottom