Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
2.0k views
in Computer by (75.2k points)

Ms. Rakhi works in an International Bank as an IT Head. She designed a simple interest calculator program as shown below:

The interest rate is given based on the account type as shown below :

Account Type lnterest Rate %
Saying 4%
Recurring Depowity 6%
Fixed Deposite 8%

(i) Write the code required for 'INTEREST RATE' button to display interest rate as per the above given criteria.

(ii) Write the code required for 'SI' button to calculate and display 'simple Interest' based on the given formula' SI = (amount*interestrate* duration)/100;

(iii) Write the code required for 'CLEAR ALL to clear all the textfields.

1 Answer

+1 vote
by (69.0k points)
selected by
 
Best answer

(i) Correct code required for 'INTEREST RATE' button to display interest rate as per the above given criteria:

if (R1.isSelected() = = true)

T3.setText(" 4");

else if(R2.isSelected() = = true)

T3.setText("6");

if(R3.isSelected() = =true)

T3.setText("8");

(ii) Correct code required for 'SI' button

double amt = Double.parseDouble(T2.getText());

double int_rate =Double.parseDouble(T3.getText());

int year = Integer.parseInt(T4.getText());

double si = (amt*int_rate*year)/100;

T5.setText(" " + si);

(iii) t1.setText(" ");

t2.setText(" ");

t3.setText(" ");

t4.setText(" ");

t5.setText(" ");

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...