Space for google add

LAB COURSE II TYBCS- Assignment 5 | JAVA-csprogramx



 SET A

1. Write a program to accept a string as command line argument and check whether it is a file or

directory. If it is a directory, list the contents of the directory, count how many files the

directory has and delete all files in that directory having extension .txt. (Ask the user if the

files have to be deleted). If it is a file, display all information about the file (path, size,

attributes etc).


2. Write a menu driven program to perform the following operations on a text file “phone.txt”

which contains name and phone number pairs. The menu should have options:

i. Search name and display phone number

ii. Add a new name-phone number pair.


SET B

1. Write a program to read item information (id, name, price, qty) in file “item.dat”. Write a menu

driven program to perform the following operations using Random access file:

i. Search for a specific item by name. ii. Find costliest item. ii. Display all items and total cost


Post a Comment

0 Comments