Posts

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 7 PROGRAM TO IMPLEMENT USER DEFINED EXCEPTION HANDLING

  EX NO : 7  PROGRAM TO IMPLEMENT USER DEFINED EXCEPTION HANDLING  AIM  To write a java program to implement user defined exception handling.  PROCEDURE  1.Create a class which extends Exception class.  2.Create a constructor which receives the string as argument.  3.Get the Amount as input from the user.  4.If the amount is negative, the exception will be generated.  5.Using the exception handling mechanism, the thrown exception is handled by the catch construct. 6.After the exception is handled, the string “invalid amount“ will be displayed. 7.If the amount is greater than 0, the message “Amount Deposited “ will be displayed   For Code (Click Here)

EXP 6 PROGRAM TO CALCULATE AREA USING ABSTRACT CLASS

EX NO : 6.  PROGRAM TO CALCULATE AREA USING ABSTRACT CLASS . AIM. To write a java program to calculate the area of rectangle, circle and triangle using the concept of  abstract class.  PROCEDURE  1. Create an abstract class named shape that contains two integers and an empty method named printarea().  2. Provide three classes named rectangle, triangle & circle such that each one of the classes  extends the class Shape.  3.Each of the inherited class from shape class should provide the implementation for the method  printarea().  4.Get the input and calculate the area of rectangle,circle and triangle .  5. In the shapeclass , create the objects for the three inherited classes and invoke the methods and  display the area values of the different shapes.  For Code (Click Here)

EXP 5 PERFORM STRING OPERATIONS USING ARRAYLIST

EX NO: 5 PROGRAM TO PERFORM STRING OPERATIONS USING ARRAYLIST AIM. To write a java program to perform string operations using ArrayList for the following functions a. Append - add at end b. Insert – add at particular index c. Search d. List all string starts with given letter. PROCEDURE. 1.Create the class arraylistexample. Create the object for the arraylist class. 2.Display the options to the user for performing string handling . 3.Use the function add() to append the string at the end and to insert the string at the particular index. 4. The function sort () is used to sort the elements in the array list. 5. The function indexof() is used to search whether the element is in the array list or not. 6.The function startsWith () is used to find whether the element starts with the specified character. 7.The function remove() is used to remove the element from the arraylist. 8.The function size() is used to determine the number of elements in the array list. Git stats

EXP 4 PROGRAM FOR STACK ADT USING INTERFACE

  EX NO: 4   PROGRAM FOR STACK ADT USING INTERFACE For Codes Click here AIM To design a java application to implement array implementation of stack using the concept of interface and exception handling. PROCEDURE 1. Create the interface stackoperation with method declarations for push and pop. 2. Create the class astack which implements the interface and provides implementation for the methods push and pop.Also define the method for displaying the values stored in the stack.Handle the stack overflow and stack underflow condition . 3. Create the class teststack .Get the choice from the user for the operation to be performed . and also handle the exception that occur while performing the stack operation. 4. Create the object and invoke the method for push,pop,display based on the input from the user.

EXP 3 PROGRAM TO GENERATE PAYSLIP USING INHERITANCE

EX NO: 3 PROGRAM TO GENERATE PAYSLIP USING INHERITANCE AIM To develop a java application to generate pay slip for different category of employees using the concept of inheritance. PROCEDURE 1. Create the class employee with name, Empid, address, mailid, mobileno as members. 2. Inherit the classes programmer, asstprofessor,associateprofessor and professor from employee class. 3. Add Basic Pay (BP) as the member of all the inherited classes. 4. Calculate DA as 97% of BP, HRA as 10% of BP, PF as 12% of BP, Staff club fund as 0.1% of BP. 5. Calculate gross salary and net salary. 6. Generate payslip for all categories of employees. 7. Create the objects for the inherited classes and invoke the necessary methods to display the Payslip.

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 ...

Popular posts from this blog

EXP 3 PROGRAM TO GENERATE PAYSLIP USING INHERITANCE

EXP 1 JAVA PROGRAM TO GENERATE ELECTRICITY BILL

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