CSE1115 Final 183
CSE1115 Final 183
1. a) Declare a static nested class Inner1 of an outer class Outer1 and a nested class Inner2 of an outer
class Outer2. Now, create object of Inner1 and Inner2 class respectively inside NestedDemo class’s
main method. [2+2]
2. The records of Chikungunya victims are stored in a txt file name victims.txt. Each record contains name
followed by age followed by district; the record are stored in ascending order of district name. Write a
program that will read the records from the file, find the district with highest Chikungunya victims, and
display the district name with victim count in console. [8]
victims.txt Expected Output
Bari-45-Barishal Dhaka-3
Hasan-50-Barishal
Kayes-25-Dhaka
Rawnak-35-Dhaka
Jabed-43-Dhaka
Sumi-48-Rajshahi
3. You are required to complete a Java GUI application like below that has the functionality of converting
US Dollar to Euro after pressing the Convert Button. Formula: 1 USD = 0.88 Euro. [8]
4. a) Suppose you have a class named Employee. The Employee class has three members:
employeeName, employeeId and salary. Now: [4]
5. a) Fix the errors in the following code. You cannot add or remove any functions. [2]
public class Test {
static String str = "+";
public static void main(String[] args) {f1(); }
static void f1(){
try{
f2();
throws Exception();
}
catch (Exception e){ str += "-";}
}
static void throws Exception f2(){
throw new Exception();
}
}
c) Identify the type of Exception in the given code. Use appropriate catch block(s) to handle it. [3]