Define a class interest, Which contains three double- type instance variables principal - value , rate of interest and time in years. define a method void result () in this class , which receives three- double type arguments ; and store them in instance variables. also, define another method void simple interest() which calculates and returns the simple interest using all the three instance variables ( as SI = ( PRT) / 100). define a standard main () method to create suitable object of class interest type , and by invoking methods print the simple interest.
Answers
Answered by
0
Answer:This method has four parameters: the loan amount, the interest rate, the future value. The first three are double-precision floating point numbers, and the fourth is an integer. Note: Parameters refers to the list of variables in a method declaration. You can use any data type for a parameter of a method or a constructor.Class: A class is a definition of objects of the same kind. ... An instance (object) is also represented as a 3-compartment box, with instance name ... To invoke the function getArea() , you must first identity the instance of interest, says c2 ... It contains two data members: radius (of type double ) and color (of type String );
Similar questions
English,
2 months ago
Math,
2 months ago
Economy,
5 months ago
Accountancy,
11 months ago
Physics,
11 months ago