Question Details

Homework #1 MCIS 5103: Advanced Programming Concepts Instructor: Dr. Justin L. Rice Due Date: 2/1/2017 Please refer to the code in the Appendix


Hi all, Help please with my homework,  I have attached the instructions, 


Thanks (:


Homework #1

 

MCIS 5103: Advanced Programming Concepts

 

Instructor: Dr. Justin L. Rice

 

Due Date: 2/1/2017

 

Please refer to the code in the Appendix (pages 2 - 6) to answer the following questions. 1. What is the relationship between the Employee class and the Manager class? What concept does this

 

demonstrate? (10 points)

 

2. What would happen if mySalary were declared private instead of protected? (15 points)

 

3. Write the output for each section of print statements. (15 points)

 

4. Which raiseSalary() method does m.raiseSalary(10) execute? Why? What concept does this

 

demonstrate? (20 points)

 

5. Which raiseSalary() method does e1.raiseSalary(10) execute? Why? What concept does this

 

demonstrate? (20 points)

 

6. Which raiseSalary() method does e2.raiseSalary(10,1) execute? Why? What concept does this

 

demonstrate? (20 points) APPENDIX Traits.java public interface Traits{

 

public String getName();

 

public String getTitle();

 

} Employee.java public class Employee implements Traits {

 

private String myName;

 

private String myTitle;

 

protected double mySalary;

 

private int myAge;

 

public Employee(String name, String title, double salary, int age) {

 

myName = name;

 

myTitle = title;

 

mySalary = salary;

 

myAge = age;

 

}

 

public String getName() {

 

return myName;

 

}

 

public String getTitle(){

 

return myTitle;

 

}

 

public double getSalary() {

 

return mySalary;

 

}

 

public int getAge(){

 

return myAge;

 

}

 

public void raiseSalary(int percent) {

 

mySalary = mySalary + percent * 0.01 * mySalary;

 

}

 

public void raiseSalary(int percent, int cost_of_living_adjustment) {

 

mySalary = mySalary + percent * 0.01 * mySalary +

 

cost_of_living_adjustment * 0.01 * mySalary;

 

}

 

} Manager.java public class Manager extends Employee{

 

private int yearsWorked;

 

private String highestDegree;

 

private double promotionBonus;

 

public Manager(String name, String title, double salary, int age, int

 

experience, String degree, double bonus){

 

super(name, title, salary, age);

 

yearsWorked = experience;

 

highestDegree = degree;

 

promotionBonus = bonus;

 

}

 

public int getExperience(){

 

return yearsWorked;

 

}

 

public String getDegree(){

 

return highestDegree;

 

}

 

public double getBonus(){

 

return promotionBonus;

 

}

 

public void raiseSalary(int percent) {

 

mySalary = mySalary + percent * 0.01 * mySalary + promotionBonus;

 

}

 

} Test.java public class Test{

 

public static void main(String args){

 

Manager m = new Manager("John Doe", "Department Head", 100000.0, 55,

 

30, "PhD", 5000.0);

 

Employee e1 = new Employee("Jane Doe", "Resource Analyst", 75000.0,

 

40);

 

Employee e2 = new Employee("Jim Doe", "Engineer", 85000.0, 46);

 

System.out.println("Name

 

System.out.println("Title

 

System.out.println("Age

 

System.out.println("Years of Experience

 

m.getExperience());

 

System.out.println("Highest Degree Earned

 

System.out.println("Salary

 

System.out.println("Promotion Bonus

 

m.raiseSalary(10);

 

System.out.println("Salary Raised!");

 

System.out.println("New Salary :

 

:

 

:

 

: "

 

"

 

"

 

" + m.getName());

 

+ m.getTitle());

 

+ m.getAge());

 

+ : " + m.getDegree());

 

: " + m.getSalary());

 

: " + m.getBonus());

 

: " + m.getSalary()); System.out.println("

 

");

 

System.out.println("Name

 

System.out.println("Title

 

System.out.println("Age

 

System.out.println("Salary

 

e1.raiseSalary(10);

 

System.out.println("Salary Raised");

 

System.out.println("New Salary :

 

:

 

:

 

: "

 

"

 

"

 

" +

 

+

 

+

 

+ e1.getName());

 

e1.getTitle());

 

e1.getAge());

 

e1.getSalary()); : " + e1.getSalary()); System.out.println("

 

");

 

System.out.println("Name

 

System.out.println("Title

 

System.out.println("Age

 

System.out.println("Salary

 

e2.raiseSalary(10,1);

 

System.out.println("Salary Raised");

 

System.out.println("New Salary

 

}

 

} :

 

:

 

:

 

: "

 

"

 

"

 

" +

 

+

 

+

 

+ e2.getName());

 

e2.getTitle());

 

e2.getAge());

 

e2.getSalary()); : " + e2.getSalary());

 


Solution details:

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Oct 15, 2019

EXPERT

Tutor

ANSWER RATING

YES, THIS IS LEGAL

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now