Java classes implementation

This project was awarded to bbarar for $2.89 USD.

Get free quotes for a project like this
Project Budget
$30 - $5000 USD
Total Bids
Project Description

[url removed, login to view] a class, named Rational, for reduced-form rational numbers as specified below ( a rational number is in the reduced form if the greatest common divisor of the numerator and the denominator is 1.):

class Rational {

int numerator;

int denominator;

public Rational(int numerator, int denominator){

//Initializes the member variables


public Rational add(Rational r){

//return the sum of this and r.


public Rational sub(Rational r){

//return the difference between this and r (this-r).


public Rational mult(Rational r){

//return the product of this and r.


public Rational div(Rational r){

//return the quotient of this divided by r.



2. Implement a class 'Car' with the following properties. A car has a certain fuel efficiency(measured in miles/gallon) and a certain amount of fuel in the gas tank. The efficiency is specified in the constructor, and the initial fuel is 0. Supply a method 'drive' that simulates driving the car for a certain distance, reducing the fuel level in the gas tank, and methods 'getGas', to return the current fuel level, and 'addGas' to tank up. Sample usage :

Car myvolvo = new Car(15); //15 miles per gallon

[url removed, login to view](10); //10 gallons in tank

[url removed, login to view](50); //drive 50 miles

[url removed, login to view]([url removed, login to view]());

3. Design and implement a class 'ParkingMeter' for parking meters. A user can insert quarters and check remaining parking time. The constructor should take the maximum parking minutes and the rate ( minutes per quarter).

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):

a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.

b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.

3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).

## Platform

Java - j2sdk1.4.2_05 in Windows XP

Awarded to:

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online