Encerrado

Very easy small Java Project - URGENT!!!

The task

Create a class Rational representing rational numbers as pairs of integers (numerator and denominator), together with basic arithmetical operations and comparisons.

Supply the following constructors:

Rational(int numerator, int denominator).

Rational() getting the numerator and the denominator from a user using a dialog.

Rational(double d); sets the denominator to some power of 10 and calculates the numerator based on the argument value.

Rational(String numerator, String denominator) (convert strings to integer numbers).

Implement the following public methods:

addition: Rational add(Rational arg);

multiplication: Rational mul(Rational arg);

subtraction: Rational sub(Rational arg);

division: Rational div(Rational arg);

equality: boolean equals(Rational arg);

the comparisons:

boolean lessThan(Rational arg)

boolean greaterThan(Rational arg)

boolean lessThanOrEqual(Rational arg)

boolean greaterThanOrEqual(Rational arg)

the string representation of the number: String toString();

Remarks

The methods 1..4 return a reference to a new object of the class Rational as the result of the operation carried out on the argument arg and this object.

The method boolean equals(Rational arg); test two rationals for equality.

The method String toString(); allows for printing the number with the invocation: [url removed, login to view](...).

The constructor must throw the exception IllegalArgumentException, whenever the denominator equals 0.

The method div(Rational arg) throws the exception ArithmeticException, whenever the argument arg represents the value of 0.

The method void reduce(), which reduces this fraction to the common denominator, may turn out useful.

Overload the methods for carrying out arithmetical operations so that they take arguments of type int as well as double:

public Rational add(int i) - adds an integer to this rational.

public Rational add(double d) - adds a double value to this rational. You may use the constructor Rational(double d) in the implementation of this method.

Add static constants: ZERO, ONE.

Supply some tests in the method main(...).

Habilidades: Java

Ver mais: user tests, system tests, representation of integers, n equals, java to c convert, int power, int i, integers and, convert java to c, common string, VOID, task number 1 project, take tests, small-task-project, mul, int, easy java a, d java, create an operation, boolean, Basic java, arg, java using, add div div, power system project

Acerca do Empregador:
( 0 comentários ) Warsaw, Poland

ID do Projeto: #572801

32 freelancers are bidding on average $35 for this job

eperfections

Please see Private message

$30 USD em 1 dia
(342 Comentários)
7.0
kevinxiaozi

Sir, I can finish the project in an hour. I can submit it to you today. Is that OK? Thank you, Best regards,

$30 USD in 0 dias
(26 Comentários)
5.3
mradityagoyal

Hi, I am an expert java programmer and would be glad to work for you. Upon accepting the bid, I will be available on skype or other IM clients and will explain the whole code. I will also provide proper documented cod Mais

$30 USD in 0 dias
(22 Comentários)
4.3
webdesigner95

Sir, i am ready to start the project.

$30 USD em 1 dia
(7 Comentários)
3.1
siamsoft061

sir, i have four years experienced in java. i do similar project before. i am ready to work....

$30 USD in 0 dias
(3 Comentários)
2.9
NextGWEB

i am interested. I will do it.

$35 USD em 1 dia
(1 Comentário)
2.6
martapodlacha

Can do it for you, check PM

$30 USD em 1 dia
(2 Comentários)
2.0
junworried

This can be done by tomorrow, if i start today.

$30 USD em 1 dia
(1 Comentário)
0.8
ZulqarnainHaider

Hi, Sir I can do this project for you thanks . Check PMB

$30 USD in 4 dias
(0 Comentários)
0.0
asingathi

I can complete this project in 1 day with all test cases.

$40 USD em 1 dia
(0 Comentários)
0.0
Sayee

Having 5 years of java development experience, also sun certified java programmer. will be able to delivered the requirement on time up to your satisfaction.

$30 USD em 1 dia
(0 Comentários)
0.0
vianvi0609

Hello, Please check pmb, Thanks

$60 USD em 1 dia
(0 Comentários)
0.0
ihsofttech

-*-*-*- Please DO check PM!! -*-*-*-

$30 USD in 0 dias
(0 Comentários)
0.0
Ecliptic

I am ready to do this task for you.

$30 USD em 1 dia
(0 Comentários)
0.0
jeansonline

I am a SUN certified Java Programmer. I can assure you 100% satisfaction and delivery before the stipulated time. I have been winning the first prize consistently in all Java contests held in my country.. Awaiting r Mais

$30 USD em 1 dia
(0 Comentários)
0.0
Bandreid

Hello. I looked over the project specs and the attached file. It's a fairly simple project that can be done in very little time. I am skilled in Java programming and can provide quality written code and good comments. Mais

$30 USD in 0 dias
(0 Comentários)
1.3
Carbonscraper

I can do this for you.

$30 USD in 2 dias
(0 Comentários)
0.0
programCreator

Please see your inbox.

$30 USD in 0 dias
(0 Comentários)
0.0
hungvu

Only few hours to finish it.

$30 USD in 0 dias
(1 Comentário)
0.0
javoble

Hello, I have a strong proffesional background in java development. Your task will be done today. It seems very easy but there are things that need special attention and I am taking care of implementing all details. P Mais

$30 USD in 0 dias
(0 Comentários)
0.0