Page 554 - ComputerScience_Class_11
P. 554
33 taxIncome = Double.parseDouble(br.readLine());
34 mat.writeUTF(name);
35 mat.writeUTF(pan);
36 mat.writeDouble(taxIncome);
37 System.out.println("Do you wish to input more data?(y/n)");
38 choice = br.readLine();
39 }
40
while(choice.equalsIgnoreCase("y")==true);
41 mat.close();
42 break;
43 case 2:
44 DataOutputStream mat2 = new DataOutputStream(new
FileOutputStream("info.dat",true));
45 do
46 {
47 System.out.print("Input the Name of the Employee : ");
48 name = br.readLine();
49 System.out.print("Input the Pan Number : ");
50 pan = br.readLine();
51 System.out.print("Input the TaxableIncome : ");
52 taxIncome = Double.parseDouble(br.readLine());
53 mat2.writeUTF(name);
54
mat2.writeUTF(pan);
55 mat2.writeDouble(taxIncome);
56 System.out.print("Do you wish to input more data?(y/n)
: ");
57 choice = br.readLine();
58 }
59 while(choice.equalsIgnoreCase("y")==true);
60 mat2.close();
61 break;
62 case 3:
63 DataInputStream mat1 = new DataInputStream(new
FileInputStream("info.dat"));
64 DataOutputStream std = new DataOutputStream(new
FileOutputStream("temp.dat"));
65 boolean eof = false;
66 while(!eof)
67 {
68
try
69 {
552 Touchpad Computer Science (Ver. 3.0)-XI

