Trending ▼
ICSE
CBSE 10th
ISC
CBSE 12th
CTET
GATE
UGC NET
Vestibulares
ResFinder
Java Programs for ICSE Xth
5 pages, 0 questions, 0 questions with responses, 0 total responses
,
0
0
sunny74
+Fave
Message
Profile
Timeline
Uploads
Home
>
sunny74
>
Formatting page ...
PROGRAM 5 /** This program defines a class for Electricity board and initializes data members using constructors */ import java.io.*; public class Prog_5_KEB { // Data Members String month, cons_name; int ch; Double cons_no, old_mtr, new_mtr, bill, net_bill, units, charge; //Constructor for objects of class Prog_5_KEB public Prog_5_KEB() { // initialise instance variables cons_no=0.0; old_mtr=0.0; new_mtr=0.0; bill=0.0; net_bill=0.0; units=0.0; charge=0.0; } //Method to accept consumer data void Accept_Data() throws IOException { BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter the bill month"); month=stdin.readLine(); System.out.println("Enter the consumer name"); cons_name=stdin.readLine(); System.out.println("Enter your consumer number"); cons_no=Double.parseDouble(stdin.readLine()); System.out.println("Enter the previous meter reading"); old_mtr=Double.parseDouble(stdin.readLine()); System.out.println("Enter the present meter reading"); new_mtr=Double.parseDouble(stdin.readLine()); System.out.println("Type 1 if you work in KEB else Type 2"); ch=Integer.parseInt(stdin.readLine()); } void Display_Data() throws IOException { System.out.println("BILL FOR THE MONTH OF " +month); System.out.println("Consumer name: " +cons_name);
Formatting page ...
Formatting page ...
Formatting page ...
Formatting page ...
Print intermediate debugging step
Show debugging info
Hide debugging info
Horizontal lines at:
Guest Horizontal lines at:
AutoRM Data:
Box geometries:
Box geometries:
Text Data:
© 2010 - 2024 ResPaper.
Terms of Service
Contact Us
Advertise with us