CSE21P8 - Object Oriented Programming - I Lab¶
File Handling, Hash Tables, and Exceptions¶
Term 161¶
Exp 4. Suppose an input file named as "INPUT.txt" contains numeric values (0 to 9) in a single line as shown in below sample input/output. Now write a Java program to count the single number from the "INPUT.txt" file and write it to the file name as "OUTPUT.txt" as shown in below. If any number (0 to 9) is disappearing, then count 0 and if the number appears more than one then count total number. The sample input/out is shown below:
Term 211¶
Exp 03. Write a java program that loads names and phone numbers from a text file where the data is organized as one line per record and each field in a record are separated by a tab (\t). It takes a name or phone number as input and prints the corresponding other value from the hash table (hint: use hash tables).
Exp 08. Write a Java program that creates a user interface to perform integer divisions. The user enters two numbers in the text fields, Num1 and Num2. The division of Num1 and Num2 is displayed in the Result field when the Divide button is clicked. If Num1 or Num2 were not an integer, the program would throw a NumberFormatException. If Num2 were Zero, the program would throw an Arithmetic Exception. Display the exception in a message dialog box.
