Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Assignment : Implementing Inheritance

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Assignment : Implementing Inheritance

    Aslamo aly'kum

    good evening all

    I have Assignment which deadline after tomorrow

    please help

    I tried to solve it but I couldn't

    the Assignment in attachment box
    Attached Files Attached Files


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Assignment : Implementing Inheritance

    If you want help you need to ask some specific questions about your problem and post the code you are working with.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Dec 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Assignment : Implementing Inheritance

    public class Test
    {
    public static void main(String[] args)
    {
    // Manager
    Manager m = new Manager("Ahmad", "Salim", "1001", 10000.0, 3500.0);

    // Customer
    double purchase = 1890.0;
    double budget = 2000.0;
    Customer c = new Customer("Ali", "Abdullah", "", budget, purchase);
    c.setAddress("Alrawdah dist., Jeddah, Saudi Arabia");

    // SalesPerson
    SalesPerson sp = new SalesPerson("Saleh", "Ameer", "1002", 6000.0);

    //-----------------------------

    // print manager information
    System.out.println("Manager Information:");
    System.out.println("Name is " + m.getName());
    System.out.println("Number is " + m.getEmployeeNumber());
    System.out.println("Salary is " + m.getBasicSalary());
    System.out.println("Allowance is " + m.getAllowance());
    System.out.println("The total income is " + (m.getBasicSalary() + m.getAllowance()));
    System.out.println("");

    // print customer information
    System.out.println("Customer Information");
    System.out.println("Name is " + c.getName());
    System.out.println("Address is " + c.getAddress());
    System.out.println("Budget is " + c.getFullBudget());
    System.out.println("Purchase is " + c.getPurchase());
    System.out.println("The remaining budget " + c.getBudget());
    System.out.println("");

    // print sales person information
    double commission = purchase * 0.05;
    System.out.println("Sales Person Information");
    System.out.println("Name is " + sp.getName());
    System.out.println("Number is " + sp.getEmployeeNumber());
    System.out.println("Salary is " + sp.getBasicSalary());
    System.out.println("The commission is " + commission);
    System.out.println("Total income is " + (sp.getBasicSalary() + commission));
    }

    }



    I want to using Scanner class

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Assignment : Implementing Inheritance

    Welcome to the Forum! Please read this topic to learn how to post your code correctly along with other useful info for newcomers.

Similar Threads

  1. Inheritance and Polymorphism assignment!!
    By m7abraham in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 14th, 2012, 04:11 PM
  2. Implementing an algorithm
    By me_newbie in forum What's Wrong With My Code?
    Replies: 1
    Last Post: August 16th, 2012, 08:50 PM
  3. assignment troubles polymorphism (guide for assignment included)
    By tdawg422 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 8th, 2011, 10:01 AM
  4. Programming assignment using inheritance
    By Slypher in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 4th, 2011, 05:42 PM
  5. Replies: 1
    Last Post: February 22nd, 2010, 08:20 AM