Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

1. Would the norms of Target match the norms of a typical company?

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago