DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Apr 2006
    Posts
    8

    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

  1. wot is CLR
    By lostguy in forum .NET
    Replies: 8
    Last Post: 04-03-2002, 06:41 PM
  2. .NET equals Efficiency
    By Kevin in forum .NET
    Replies: 150
    Last Post: 03-04-2002, 05:40 PM
  3. Replies: 3
    Last Post: 07-09-2001, 03:25 PM
  4. Another Language
    By Steven Bell in forum .NET
    Replies: 260
    Last Post: 06-01-2001, 04:32 PM
  5. error code in JSP(please chek the code)
    By satish in forum Java
    Replies: 1
    Last Post: 09-22-2000, 09:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links