|
-
October 1st, 2012, 04:29 PM
#2
Re: How to pass object values to method call
I'll help point you in the right direction:
1st when you say:
"how to create the variables for the class methods, incorporate into method return, and then pass the values in the instances to the method call in the program"
You are not understanding the concept of creating methods that accept parameters and method return types.
is not correct. According to your assignment you have to return a Fraction not a long. Here is a correct method heading for you assignment for the Add method:
Code:
public Fraction Add(Fraction fractionToAdd)
{
}
this method specifies a return type of Fraction passing a parameter of type Fraction to add to your current Fraction object. I will leave the logic of the method body to you.
Hope this helps!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|