import java.io.*; class Account { String name, acctype; int accno; double balance=0.0; void readdata(String n,int acno, String actype) { name=n; accno=acno; acctype=actype; } void deposit(double amtIn) { balance+=amtIn; System.out.println("Balance after deposit is:" + balance); } void withdraw(double amtOut) { System.out.println("Balance before withdrawn is:" + balance); balance -= amtOut; System.out.println("Balance after withdrawn is:" + balance); } void display() { System.out.println("Name :" + name + "\n"); System.out.println("Acc. Type:" + acctype + "\n"); System.out.println("Acc. No. :" + accno + "\n"); } } class Lab2a { public static void main(String args[]) throws IOException { String name,acctype; int accno; double amt; Account a=new Account(); DataInputStream in = new DataInputStream(System.in); System.out.println("enter the name:"); name = in.readLine(); System.out.println("enter the accountno:"); accno = Integer.parseInt(in.readLine()); System.out.println("enter the type of account:"); acctype = in.readLine(); a.readdata(name, accno, acctype); System.out.println("enter the amount to be deposited:"); amt=Double.parseDouble(in.readLine()); a.deposit(amt); System.out.println("enter the amount to be withdrawn:"); amt=Double.parseDouble(in.readLine()); a.withdraw(amt); a.display(); } }