Practical 12


Aim:- Refine the student manager program to manipulate the student information from files by using the BufferedReader and BufferedWriter.

JAVA Code :-

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

public class pra12 {

    public static void main(String[] args) throws Exception {
        BufferedReader bufRead = new BufferedReader(new FileReader("a.txt"));
        BufferedWriter bufWrite = new BufferedWriter(new FileWriter("ab.txt"));
        int i;
       
        do {
            i = bufRead.read();
            if (i != -1) {
                if (Character.isUpperCase((char) i)) {
                    bufWrite.write(Character.toLowerCase((char) i));
              }
 else {
                    bufWrite.write((char) i);
                }
            }
        } while (i != -1);
        
        bufRead.close();
        bufWrite.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...