• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Quick Java Programming question....

Skiguy411

Platinum Member
I am suppose to write a public method named multiply which accepts two doubles multiplies them, and returns a double.

I'm just starting to learn java and so I'm not** exactly sure how to write that.
 
Private or Public?: public
Return type: double
Method Name: multi
Inputs: (double a, double b) {

That's a huge hint.

 
Originally posted by: Skiguy411
I am suppose to write a public method named multiply which accepts two doubles multiplies them, and returns a double.

I'm just starting to learn java and so I'm exactly sure how to write that.

You're exactly sure? Not just sure, but exactly sure?
 
wow that is fvcking pathetic. i really really hope for your sake that your major has nothing to do with computers at all, as in, you will never ever touch a computer while on your job after you have a degree.
 
Originally posted by: purbeast0
wow that is fvcking pathetic. i really really hope for your sake that your major has nothing to do with computers at all, as in, you will never ever touch a computer while on your job after you have a degree.

Errmm....we all have to start out somewhere don't we?
 
Originally posted by: Skiguy411
Originally posted by: purbeast0
wow that is fvcking pathetic. i really really hope for your sake that your major has nothing to do with computers at all, as in, you will never ever touch a computer while on your job after you have a degree.

Errmm....we all have to start out somewhere don't we?

Most people would start out by reading the book, or paying attention to the lectures in class, where the professor absolutely went over this.

Do yourself a favor and switch majors.
 
This is the simplest possible example of a function returning a value, this was covered in class and your book goes into excessive detail.

You need to learn basic concepts like this. If you just learn to copy and paste other people's code you will fail the midterm and final, and you will be hopelessly unprepared for any future classes.

Programming is not like a history class where you memorize some facts and spew them out. It's more like a math class where you learn tools and how to use them.

Learn the concepts or switch to a business major.
 
public static double multiply(double a, double b)
{
double c = a * b;
if (c > 0)
return c;
else
system.exit(0);

return c;
}

This is the best example. Don't listen to these noobs. 😛
 
Originally posted by: tfinch2
public static double multiply(double a, double b)
{
double c = a * b;
if (c > 0)
return c;
else
system.exit(0);

return c;
}

This is the best example. Don't listen to these noobs. 😛
Exactly! If you're going to copy-paste answers this one will impress the professor more with its variety of responses and attention to detail.

 
Back
Top