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 5 of 5

Thread: programming Java

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default programming Java

    Extending the Campus Community hierarchy
    Implement the Teacher class based on the following description:
     Each teacher is assigned a number of courses ( keep track of the course titles only)
     A teacher’s responsibility can be either a theoretical or practical.
     The normal working hours are 40 hours per week, any extra hours will be paid a flat rate of 100SAR per hour (assume that each month has 4 weeks).
    Your class should also define a method Compute salary.
    Your main class should define a Teacher object and supply its information then display its data as well as the computed salary.
    Last edited by ghadah; April 1st, 2014 at 11:20 AM.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,453
    My Mood
    Hungover
    Thanks
    144
    Thanked 638 Times in 546 Posts

    Default Re: programming Java

    Did you have a question?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: programming Java

    What the code ??

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,334
    Thanks
    181
    Thanked 830 Times in 773 Posts
    Blog Entries
    5

    Default Re: programming Java

    What the code ??
    That's my question...where is your code? Your post implies you want someone to do this for you. If so, you've come to the wrong place. If not, post what you've tried and ask a specific question about your attempts

  5. #5
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: programming Java

    package teacher1;


    public class Teacher1 {


    public class Teacher extends Faculty {
    private String FirstCourse ;
    private String SecondCourse ;
    private String ThierdCourse ;

    public Teacher ( String FC , String SC , String TC ,int salary , String fn , String ln , String id ,
    String cs , String it ,String el ){

    super(salary , fn , ln , id , cs , it , el);
    this.FirstCourse = FC ;
    this.SecondCourse =SC ;
    this.ThierdCourse = TC ;
    }

    public void setFirstCourse(String FirstCourse) {
    this.FirstCourse = FirstCourse;
    }

    public void setSecondCourse(String SecondCourse) {
    this.SecondCourse = SecondCourse;
    }

    public void setThierdCourse(String ThierdCourse) {
    this.ThierdCourse = ThierdCourse;
    }

    public String getFirstCourse() {
    return FirstCourse;
    }

    public String getSecondCourse() {
    return SecondCourse;
    }

    public String getThierdCourse() {
    return ThierdCourse;
    }

    @Override
    public String toString() {
    return "Teacher{" + "FirstCourse=" + FirstCourse + ", SecondCourse=" + SecondCourse + ", ThierdCourse=" + ThierdCourse + '}';
    }

    public Teacher(String FirstCourse, String SecondCourse, String ThierdCourse) {
    this.FirstCourse = FirstCourse;
    this.SecondCourse = SecondCourse;
    this.ThierdCourse = ThierdCourse;
    }



    You mean the theoretical or practical part? If so, I suggest a boolean or switched

Similar Threads

  1. Java Programming (Object Oriented Programming) Assignment
    By azmilPhenom in forum Object Oriented Programming
    Replies: 3
    Last Post: December 21st, 2013, 06:26 AM
  2. Polymorphism Java Programming HELPP P.S. I am a beginner in Java Programming
    By judemartin99 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 20th, 2013, 02:21 PM
  3. Linked Lists Java Programming HELPP P.S. I am a beginner in Java Programming
    By judemartin99 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 20th, 2013, 02:19 PM
  4. Replies: 1
    Last Post: January 6th, 2013, 05:32 AM
  5. android programming vs game programming using java
    By vgoel38 in forum Android Development
    Replies: 4
    Last Post: September 8th, 2012, 05:48 PM