Subject(s): Computer Science–Java Programming
-model: String -type: String -comp: Company -year: int -inService: boolean
+Plane(m: String, t: String, y: int, c: Company, iS: boolean) +sameCompanyName(Plane: Plane): boolean +PlaneCode(): String
-name: String -country: String -shareValue: double
+Company(n: String, c: String, sV: double) +isforeign: boolean
Question 1 [25 points]:
Implement the Company class as depicted in the above UML diagram. The Company class contains the following attributes and methods:
name: could be formed of one word or more such as: Boeing, Airbus, McDonnell Douglas, etc.
country: a String representing countries such as USA, Russia, France, Indonesia, Germany, etc.
shareValue is an indicator of the company value in the stock market
1) A constructor that takes all attributes
2) Write only the getters and setters that you need to call in question 2 or part 2.
3) isforeign: returns true if the company’s country is not Lebanon and false otherwise.
4) toString: this method returns the description of the company as per the following format:
Company Name – country – shareValue