The following is my working:
This is the 1st class
public abstract class itemsforsale{
private float weight;
private float price;
private string destination;
public itemsforsale (float w, float p, string d);
weight=w
price=p
destination=d
}
public float getWeight()
{
return weight;
}
public float getPrice()
{
return price;
}
public string getDestination()
{
return destination;
}
public abstract double postage();
}
This is the second class
public class bookextendsitemsforsale {
private string isbn;
private string title;
public final static float postage_rate_france=0.15f;
public final static float postage_rate_europe=0.4f;
public final static float postage_rate_world=0.05f;
public book (String t, int w, float p, String d);
{
super (w, p, d);
isbn=i;
title=t;
}
public string getisbn()
{
return isbn;
}
public string gettitle
}
public float postage_rate;
public double postage()
{
if (getdestination().equals( " France "))
postage_rate=postage_rate_france;
if (getdestination().equals ( " Europe "))
postage_rate=postage_rate_europe;
if (getdestination().equals ( " World" ))
postage_rate=postage_rate_world;
return_getweight().postage weight
}
}
}
This post has been edited by gozogirl: 04 May 2009 - 06:08 AM

New Topic/Question
Reply




MultiQuote




|