Results 1 to 5 of 5

Thread: creating class

  1. #1
    J7571 is offline Member
    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    0

    Default Method

    Can anyone help me with this

    method which calculates the total price. The formula to calculate total price is:
    Total price = product price + (salesperson commission * product price) (customer discount*product price)
    Last edited by J7571; 11-18-2010 at 03:03 PM.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,520
    Blog Entries
    7
    Rep Power
    20

    Default

    Java Code:
    public class Transaction {
       private double price;
       private double commission;
       private double discount;
    
       public Transaction(double price, double commission, double discount) {
          this.price= price;
          this.commission= commission;
          this.discount= discount;
       }
    
       // rest of the code/methods go here ...
    }
    It's your turn now ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Dear OP, you realize that your question constitutes a "homework dump" where you show your assignment requirements but don't show any evidence that you've done a lick of work. Please prove that you're not lazy or intellectually challenged by showing us what you've done and asking a specific question based on your own efforts.

  4. #4
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,006
    Rep Power
    20

    Default

    Quote Originally Posted by JosAH View Post
    Java Code:
    public class Transaction {
       private double price;
       private double commission;
       private double discount;
    
       public Transaction(double price, double commission, double discount) {
          this.price= price;
          this.commission= commission;
          this.discount= discount;
       }
    
       // rest of the code/methods go here ...
    }
    It's your turn now ...

    kind regards,

    Jos
    You're getting generous in your old age...

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,520
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Tolls View Post
    You're getting generous in your old age...
    Old age? Old age? Go and wash your mouth young whippersnapper!

    kind regards,

    Jos (<--- falls back to sleep again ;-)
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Help with creating a class
    By cdawg_2010 in forum New To Java
    Replies: 22
    Last Post: 11-03-2010, 05:34 AM
  2. Creating a test class
    By joshft91 in forum New To Java
    Replies: 6
    Last Post: 11-01-2010, 05:30 AM
  3. problem in creating a class that should always run in the server
    By harsha.udupa2008 in forum New To Java
    Replies: 1
    Last Post: 07-14-2010, 02:56 PM
  4. Help creating a Date class
    By Meta in forum New To Java
    Replies: 17
    Last Post: 04-30-2010, 09:28 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
  •