EXP 8 PROGRAM FOR DISPLAYING FILE INFORMATION

  EX NO :8  PROGRAM FOR DISPLAYING FILE INFORMATION  AIM    To write a java program that reads a file name from the user, displays information about whether  the file exists, whether the file is readable, or writable, the type of file and the length of the file in bytes.   PROCEDURE    1. Create a class filedemo. Get the file name from the user .   2. Use the file functions and display the information about the file.   3. getName() displays the name of the file.   4. getPath() diplays the path name of the file.   5. getParent() -This method returns the pathname string of this abstract pathname’s parent, or null  if this pathname does not name a parent directory.   6. exists() – Checks whether the file exists or not.   7. canRead()-This method is basically a check if the file can be read.   8. canWrite()-verifies whether the application can write to the file. ...

EXP 2 PROGRAM TO IMPLEMENT CURRENCY CONVERTER, DISTANCE CONVERTER AND TIME CONVERTER USING PACKAGES

 EX NO: 2


PROGRAM TO IMPLEMENT CURRENCY CONVERTER, DISTANCE

CONVERTER AND TIME CONVERTER USING PACKAGES


AIM

To develop a javax application to implement currency converter, distance converter and time converter

using the concept of packages.


PROCEDURE


1. Create a Package currencyconversion and place the class currency under the package

2. Create the methods to perform currency conversion from dollar to rupee, rupee to dollar, euro to

rupee, rupee to euro, yen to rupee and rupee to yen.

3. Create the package distanceconverion and create the class distance within the package

4. Create the methods to convert from meter to km, km to meter, miles to km,km to miles

5. Create the package timeconversion and create the class timer .Create the methods to convert

from hours to minutes ,hours to seconds , minutes to hours and seconds to hours

6. Create a class and import the packages currencyconversion, distanceconversion and time

conversion. Create the objects for the class currency, distance and timer.

7. Get the choice from the user and invoke the methods to perform the corresponding conversion

and display the value.

For Code: Click here

Comments

Popular posts from this blog

EXP 3 PROGRAM TO GENERATE PAYSLIP USING INHERITANCE

EXP 1 JAVA PROGRAM TO GENERATE ELECTRICITY BILL