|
-
Some Please Help With This
hi can some please tell why this one does not compile.
thxs
public class PrivateBuyer extends Buyer {
//instance variables
int discount;
int new price;
int calDiscount;
//constructor
public PrivateBuyer (String inputName, String inputAddress){
super( inputName, inputAddress);
}
//accessor methods
public int getpreviousPurchases () {
return previousPurchases;
}
//setting methods
public void setPurchases (int newPurchases) {
Purchases= newPurchases;
}
//other methods
private int calculateDiscount ()
{
int discount = 100;
// previously purchased 1 or more cars, get 10% discount
if this.previousPurchases >= 1
discount = 0.9;
return discount;
}
private Int buy ()
{
return discount;
new price = Price*discount;
return newprice
}
public void showDetails(){
System.out.println("buyer Name is : " + this.getbuyerName() );
System.out.println("buyer address is : " + this.getbuyeraddress() );
}
}//end of class definition
Last edited by chasey1; 07-10-2006 at 03:47 PM.
Similar Threads
-
Replies: 8
Last Post: 04-03-2002, 06:41 PM
-
Replies: 150
Last Post: 03-04-2002, 05:40 PM
-
By devi in forum VB Classic
Replies: 3
Last Post: 07-09-2001, 03:25 PM
-
By Steven Bell in forum .NET
Replies: 260
Last Post: 06-01-2001, 04:32 PM
-
Replies: 1
Last Post: 09-22-2000, 09:11 AM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks