/*WAP read charator form file and Display
if charator if is alphabet then reverse it Case
wheter it digit or Space
*/
import java.io.*;
class Slip1
{
 public static void main(String args[])throws IOException
 {
  int c;
  try
  {
   FileReader fr=new FileReader("a.txt");
   while((c=fr.read())!=-1)
   {
    if(c>=65&&c<=90)
    {
     c=c+32;
     System.out.print((char)c); 
    }
    else if(c>=97&&c<=122)
    {
     c=c-32;
     System.out.print((char)c); 
    }
    else if((char)c==' ')
    {
     System.out.print("Space"+' ');
    }
    else if(c>=48&&c<=57)
    {
     System.out.print("Digit"+(char)c+' ');
    }
    else
    {
     System.out.print((char)c); 
    }
    
   }
   fr.close();
  }catch(Exception e)
  {
   System.out.println(e);
  }
 }
}
/*Output:-
a.txt
Shinde Sachinde 9767@gmail.com
RS1234
D:\javapro\file>javac Slip1.java
D:\javapro\file>java Slip1
sHINDESpace sACHINSpace Digit9 Digit7 Digit6 Digit7 @GMAIL.COM
rsDigit1 Digit2 Digit3 Digit4
*/
Search
100% FREE Demat Account + Amazon Voucher 1000/- In 10 Minutes | Upstox
Blog Archive
- 
▼ 
2015
(15)
- 
▼ 
September
(13)
- WAP read charator form file and Display if charato...
- To copy the content one file into the another file...
- Count the Spaces in file
- Count the lines in file
- Count the Spaces,word,lines,space in file
- Simple copy one file to another file and Display o...
- Simple copy one file to another file
- WAP to accept n numbers from command line and stor...
- WAP to accept n numbers from command line and stor...
- Write a java program to accept n name of cities & ...
- Define abstract class Shape with abstract method a...
- Create an interface Shape with method area() Calcu...
- WAP to accept n cricket player, display average ru...
 
 
- 
▼ 
September
(13)
Popular Posts
- 
Emp.html <html> <body> <form method="POST" action="Lic.php"> Enter EMP No : <input ty...
- 
class SortCity { public static void main(String arg[]) { String name[]=new Stri...
- 
Program to accept Book details of ‘n’ books as book_title, author, publisher and cost. Assign the accession number to each book in incre...
- 
#include<stdio.h> #include<conio.h> main() { int num,rem=0,digit; clrscr(); printf("Enter number="...
- 
<?php interface Cyl { function area(); functi...
Categories
- BCA Sem VI Advance Java Slips Solution
- Ebooks
- FYBCA ( Sem–II) Assignment No.2 Decision making and looping.(solved assignment)
- FYBCA ( Sem–II) Assignment No.3 using function.(solved assignment)
- FYBCA ( Sem–II) Assignment No.4 Array program.(solved assignment)
- INFORMATION ABOUT TALLY.ERP 9
- RDBMS Assignment
- RDBMS ASSIGNMENT
- TYBCA (Sem IV) Java Programs
- TYBCA (Sem VI) Adv Java Programs
- TYBCA PHP Assignment
 
