Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Help with writing a Rational Number class

Avatar of codonohue
codonohue asked on
Java
11 Comments1 Solution1472 ViewsLast Modified:
I am very new to java. Frankly, I have no idea what I'm doing. I have to define a class for rational numbers. My professor wants it all in (int) form. Also, in the class she wants us to create a method that will put the negative sign into the numerator. In the main method, it should allow you to thoroughly test your Rational number class, and it is suppose to ask the user which operation to perform, and continue to put in rational numbers till they desire to quit. I was looking here for hopefully a template to follow, but all the ones on here I guess are a farther advanced java, if that even makes sense. Or it is quite possible that I'm just slow. Anyways, for the methods for add, sub, div, and mult, my prof wants us to use void methods with with a calling object and a single argment. And all the examples I've seen on here, they used return methods. Which to me makes more sense to use a return method, but I have to do it the way she wants it. B/c you can't use return methods from void methods right? Anyways, I've been working on this for a week and I have my name at the top and the class name and then a bunch of *blinks* *blinks*. Everythiing I seem to try and do is wrong, and i'm getting pretty frustrated. So, does this make any sense to you what she's asking b/c it seems to be the exact opposite of what all the examples are on here? If anyone has some guidelines I can follow for the way she wants it, so I can make a little more sense out of it, would be greatly appreciated. Or anything really that will help me, but i'm not looking for someone to do it for me, not that anyone would. Anyways, I apologize if my ignorance in this matter is obserd, but this stuff just doesn't make too much sense to me. Thank you for your time to whom ever helps me! :)
ASKER CERTIFIED SOLUTION
Avatar of Malagor
Malagor

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answers