Consider the class Student and the interface Researchable as described below each defined on their own...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the class Student and the interface Researchable as described below each defined on their own java files: public class Student { } public String name; public Student (String name) { } } public Student (Student s) { } this.name = name; } this.name = s.name; public String toString () { return name ; public interface Researchable { public void reseach (); Implement a class called PhdStudent that extends the class Student and implements the Researchable interface. It has a single private instance variable of type String, called reseach Track. (2pts for the class and fields). Your PhdStudent class should implement the following public methods: 1. Constructor with two parameters. This constructor will initialize a PhdStudent with the name and reseachTrack that are passed as parameters to this constructor. (2pts) 2. Constructor with one parameter. This constructor takes one String argument, which represents the reseachTrack value for the PhdStudent. It will initialize the field reseachTrack to be equal to the parameter, and the student's name to "undefined". You MUST call the constructor from part (1) above in your implementation of this constructor. (2pts) 3. Implement the Overriden equals method for PhdStudent: two phdStudents are equal if both have the same name and same reseachTrack. (2pts) 4. Override toString method which returns a String containing name and reseachTrack. (2pts) 5. possibly other method(s) that are required because of the fact that this class extends Student and implements Researchable. You DO NOT need to implement the method, just define the header and the body of the method(2pts) Consider the class Student and the interface Researchable as described below each defined on their own java files: public class Student { } public String name; public Student (String name) { } } public Student (Student s) { } this.name = name; } this.name = s.name; public String toString () { return name ; public interface Researchable { public void reseach (); Implement a class called PhdStudent that extends the class Student and implements the Researchable interface. It has a single private instance variable of type String, called reseach Track. (2pts for the class and fields). Your PhdStudent class should implement the following public methods: 1. Constructor with two parameters. This constructor will initialize a PhdStudent with the name and reseachTrack that are passed as parameters to this constructor. (2pts) 2. Constructor with one parameter. This constructor takes one String argument, which represents the reseachTrack value for the PhdStudent. It will initialize the field reseachTrack to be equal to the parameter, and the student's name to "undefined". You MUST call the constructor from part (1) above in your implementation of this constructor. (2pts) 3. Implement the Overriden equals method for PhdStudent: two phdStudents are equal if both have the same name and same reseachTrack. (2pts) 4. Override toString method which returns a String containing name and reseachTrack. (2pts) 5. possibly other method(s) that are required because of the fact that this class extends Student and implements Researchable. You DO NOT need to implement the method, just define the header and the body of the method(2pts) Consider the class Student and the interface Researchable as described below each defined on their own java files: public class Student { } public String name; public Student (String name) { } } public Student (Student s) { } this.name = name; } this.name = s.name; public String toString () { return name ; public interface Researchable { public void reseach (); Implement a class called PhdStudent that extends the class Student and implements the Researchable interface. It has a single private instance variable of type String, called reseach Track. (2pts for the class and fields). Your PhdStudent class should implement the following public methods: 1. Constructor with two parameters. This constructor will initialize a PhdStudent with the name and reseachTrack that are passed as parameters to this constructor. (2pts) 2. Constructor with one parameter. This constructor takes one String argument, which represents the reseachTrack value for the PhdStudent. It will initialize the field reseachTrack to be equal to the parameter, and the student's name to "undefined". You MUST call the constructor from part (1) above in your implementation of this constructor. (2pts) 3. Implement the Overriden equals method for PhdStudent: two phdStudents are equal if both have the same name and same reseachTrack. (2pts) 4. Override toString method which returns a String containing name and reseachTrack. (2pts) 5. possibly other method(s) that are required because of the fact that this class extends Student and implements Researchable. You DO NOT need to implement the method, just define the header and the body of the method(2pts)
Expert Answer:
Answer rating: 100% (QA)
The image contains text which is a Java coding assignment The task is to implement a class called PhDStudent that extends the Student class and implem... View the full answer
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these programming questions
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
Solve the right triangles with the given parts or state that there is not enough information to solve. Round off results according to Table 4.1. Refer to Fig. 4.37. B = 32.1, c = 238 Data from Table...
-
Fill in the blank cells in the table below. Assume that the value of the MPC does not change as real GDP changes. Also assume that the values represent billions of 2009 dollars. a. What is the value...
-
The number of yards gained in NFL playoff games by rookie quarterbacks is shown. 193 66 136 140 157 163 181 226 135 199 Find the range, variance, and standard deviation unless the question asks for...
-
A rotary plug valve needs to be replaced to repair a machine, and the probabilities that the replacement will be a flange style (low pressure), flange style (high pressure), wafer style, or lug style...
-
Huggins Inc. experienced the following transactions for 2010, its first year of operations. 1. Issued common stock for $60,000 cash. 2. Purchased $210,000 of merchandise on account. 3. Sold...
-
Discuss what is currently happening at Cape union mart in terms of digital marketing strategy and what they should do to increase company revenue whilst maintaining service levels and building online...
-
Jake claims that he can buy a $210,000 for about the same as his rent, and therefore he should definitely buy because he has heard that "renting is bad". Help him walk through this argument. a....
-
HB Corp., a UK company, has subsidiaries in the U.S., Germany, Singapore and Australia. It regularly sells goods denominated in U.S. dollars. The company will have two transactions in the near...
-
4. A water tank with the following dimensions is draining. L ho 1 V L = (1+x) m 1 = 1m a = 5cm b = 5cm g = 9.81 m/s ho = (80+ x*)cm b a x* is in cm a- What are the essential steps to build a...
-
Find the distance between the main spring and the secondary spring. use the work-energy method:
-
Using the definition of the derivative function*, please prove the Subtraction Rule, namely that (f(x)-g(x))' = f'(x)-g'(x). f(x+h)-f(x) h f'(x)=Lim- h0
-
ABC Ltd. Is selling its products on credit basis and its customers are associated with 5% credit risk. The annual turnover is expected at ` 5,00,000 if credit is extended with cost of sales at 75% of...
-
Make a financial forecast for a new company like amazon for the year 2024 and 2025 Your financial forecasts should include: Cash flow statements - cash balance and the cash flow pattern Some other...
-
Jose purchased stock last year as follows: Month Shares Total Cost September 60 $ 6,000 October 75 $7,500 November 85 $9,000 In December of this year, Jose sells 100 shares for $12,950. Jose cannot...
-
What key concerns must functional tactics address in marketing? Finance? POM? Personnel?
-
Suppose you and I have the same homothetic tastes over x1 and x2, and our endowments of the two goods are EM = (eM1, eM2) for me and EY = (eY1, eY2) for you. A: Suppose also, again as in exercise...
-
Government Competition, Leviathan and Benevolence: Suppose governments can spend taxpayer resources on both public goods that have social benefits and political rents that are private benefits for...
-
Consider the case of a positive consumption externality. A. Suppose throughout this exercise that demand and supply curves are linear, that demand curves are equal to marginal willingness to pay...
-
See the option quote on IBM from the CBOE Web site on the next page showing options expiring in March and April 2022. a. Which option contract had the most trades that day? b. Which option contract...
-
Two European call options with a strike price of \($50\) are written on two different stocks. Suppose that tomorrow, the low-volatility stock will have a price of \($50\) for certain. The...
-
It is February 21, 2022, and you have decided to purchase 10 June call contracts on eBays stock with an exercise price of \($57.50.\) Because you are buying, you must pay the ask price. How much...
Study smarter with the SolutionInn App