User:Kol33 kol08

import java.io.*; import java.util.Scanner; class WashingMachine {       public static void main(String args[])  throws IOException {               Scanner sc=new Scanner(System.in); WashingMachine w= new WashingMachine; w.switchOn; System.out.print("Enter No. of cloths to be washed:"); int noOfCloth= sc.nextInt; int nocloth= w.acceptCloths(noOfCloth); System.out.println("No. of cloths to be washed is:"+ noOfCloth); String detergent=w.acceptDetergent; System.out.println("The cloths are washed by:"+ detergent); w.switchOff; }       void switchOn {               System.out.println("Now the washing machine is switched on"); }       int acceptCloths(int nCloth) {               return nCloth; }       String acceptDetergent throws IOException {               BufferedReader br= new BufferedReader(new InputStreamReader(System.in)); String detergent; System.out.print("Enter the detergent You want to use:"); detergent= br.readLine; return detergent; }       void switchOff {               System.out.println("Now the washing machine is switched off"); }

} eturn nCloth; }       String acceptDetergent throws IOException {               Buff