Practical 13


Aim:- Refine the student manager program to manipulate the student information from files by using the DataInputStream and DataOutputStream. Assume suitable data.

JAVA Code :-

import java.lang.*;
import java.io.*;

public class pra13 {

    public static void main(String args[]) throws IOException
   {
        DataInputStream dataIS = new DataInputStream(new FileInputStream("ab.txt"));

        DataOutputStream dataOS = new DataOutputStream(new FileOutputStream("abc.txt"));
       
        String str;
        while ((str = dataIS.readLine()) != null)
       {
            String upper = str.toUpperCase();
            System.out.println(upper);
            dataOS.writeBytes(upper + "  ,");
        }
      
        dataIS.close();
        dataOS.close();
    }
}
  
Output:-





No comments:

Post a Comment

Programs

Home Aim:- Write a program to convert rupees to dollar. (60rupees=1 dollar). Aim:- Write a program that calculate percentage marks...