‹ Back to the paper
Consider the class definitions and answer the questions: Complete the missing parts of the code…
Consider the class definitions and answer the questions:
(a)[3.0]
Complete the missing parts of the code given below:
class SI ?1? Account
{
double sINT;
public SI (double sP, double sR, double sT)
{
?2?
sINT = 0;
}
public void Interest()
{
sINT = (P * R * T) / 100;
}
public void display()
{
?3? //invoke display( ) of base class
Interest();
System.out.println("Simple Interest=" + sINT);
}
} // class ends(b)[2.0]
Answer the following questions, based on the above code:
(i) Name the base class and derived class
(ii) Write the prototype of the base class constructor.
Answer
No answer yet.
From ISC Computer Science - Competency Focused Practice Questions (CISCE, August 2024), question 64.