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
+1 vote
5.1k views
in Computer by (76.3k points)

Ms. Fauzia works as a programmer in "TelTel Mobile Company" where she has designed a software to compute charges to be paid by the mobile phone user. A screenshot of the same is shown below :

Each Call is charged at Rs 1.00.

Each SMS is charged at Rs 0.50.

Users can also opt for Mobile Data PIan. Charges for Mobile Data Plan are flat Rs 50.00.

Help Ms. Fauziain writing the code to do the following:

(i) When the 'Calculate Charges' button is clicked, 'Calls and SMS Charges', 'Mobile Data Plan Charges' and Amount to Pay' should be calculated and displayed in the respective text fields.

'Amount to Pay' is calculated as :

Calls and SMS Charges + Mobile Charges (if any).

(ii) When the 'Clear' button is clicked, all the textfields and checkbox should be cleared.

(iii) When the 'Exit' button is clicked, the application should close.

1 Answer

+2 votes
by (75.0k points)
selected by
 
Best answer

(i) cnscharges. settext((callsmade.gettext()*l)+(smssent.grttext()*.50);

  if(dataplan.isSelected() = = true)

{ dataplancharges.settext(''50.00");

}

else

{

dataplancharges.settext("0.00");

}

Amttopay.settext(cnscharges.gettext()+dataplancharges.gettext();

(ii) Name.settext(" ") ;

Mobno.settext("");

callsmade. settech("");

smssent.settech("");

dataplan.Selected = false;

(iii) System. exit(0);

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

...