Question: Please help with solutions for these two questions. Thank you Question 5 a) Write a program that will read a file named Score.txt. This file

Please help with solutions for these two questions. Thank you
Question 5
a) Write a program that will read a file named Score.txt. This file contains student ID and the scores of the student. Two lines of the file are shown below:
1234 67.5
1235 89.0
Print out the total number of students and the average score. Find the number of
students who obtain scores above the average score. [10]
b) Explore the role JDBC drivers. [4]
c) Explain the characteristics of a user defined exception in Java. [5]
d) With the aid of a code snippet, write down the ways by which Java can create multiple
threads. [6]
Question 6
a) Determine the output of the following code snippets.
i) byte x =64,y;
y = (byte) (x << 2);
System.out.println(y); [3]
ii) byte b;
double d = 417.35;
b = (byte) d;
System.out.println(b); [3]
iii) public static int mystery(int[] A) {
int x = 0;
for (int i = 0; i < A.length; i++)
if (A[i] % 2 == 1)
x++;
return x;
} [4]
iv) int m = 100;
while(true){
if(m < 10)
break;
m = m - 10;
}
System.out.println("m is " +m); [3]
b) Explain four different types of streams. [12]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!