Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR = 7 bytes long. A file has r = 30,000 EMPLOYEE records of fixed length. Each record has the following fields: Name (30 bytes),Ssn (9 bytes), Department_code (9 bytes), Address (40 bytes), Phone (10 bytes), Birth_date (8 bytes), Sex (1 byte), Job_code (4 bytes), and Salary (4 bytes, real number). An additional byte is used as a deletion marker.
Suppose that the file is not ordered by the key field Ssn and we want to construct a B+-tree access structure (index) on Ssn. Calculate (i) the orders p and pleaf of the B+-tree; (ii) the number of leaf-level blocks needed if blocks are approximately 69% full (rounded up for convenience); (iii) the number of levels needed if internal nodes are also 69% full (rounded up for convenience); (iv) the total number of blocks required by the B+-tree; and (v) the number of block accesses needed to search for and retrieve a record from the file—given its Ssn value—using the B+-tree.
In: Computer Science
Write a program that prompts the user to enter the number of
students and each student’s name and score, and finally displays
the student with the highest score and the student with the
second-highest score. Use the next() method in the Scanner class to
read a name rather using the nextLine() method.
This is my code , but i get this error Enter the number of
students: Exception in thread "main"
java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:871)
at java.util.Scanner.next(Scanner.java:1494)
at java.util.Scanner.nextInt(Scanner.java:2139)
at java.util.Scanner.nextInt(Scanner.java:2095)
at Exercise05_09.main(Exercise05_09.java:16)
import java.util.Scanner;
public class Exercise05_09 {
public static void main(String[] args) {
// Create a Scanner
Scanner input = new
Scanner(System.in);
// Prompt the user to enter the
number of students
System.out.print("Enter the number
of students: ");
int numberOfStudents =
input.nextInt();
int score,
// Holds students' score
highest = 0,
// Highest
score
secondHigest =
0; // Second highest score
String name = "",
// Holds students' name
student1 = "", // Highest scoring
student name
student2 = ""; // Second highest
scoring student name
// Prompt the user to enter each
students' name and score
System.out.println("Enter each
students' name and score:");
for (int i = 0; i <
numberOfStudents; i++) {
System.out.print(
"Student: " + (i + 1) + "\n Name: ");
name =
input.next();
System.out.print(" Score: ");
score =
input.nextInt();
if (i == 0)
{
// Make the first student the highest scoring
student so far
highest = score;
student1 = name;
}
else if (i == 1
&& score > highest) {
// Second student entered scored
// higher than first student
secondHigest = highest;
highest = score;
student2 = student1;
student1 = name;
}
else if (i == 1)
{
// Second student entered scored
// lower than first student
secondHigest = score;
student2 = name;
}
else if (i >
1 && score > highest && score > secondHigest)
{
// Last student entered has the highest
score
secondHigest = highest;
student2 = student1;
highest = score;
student1 = name;
}
else if (i >
1 && score > secondHigest) {
// Last student entered has the second highest
score
student2 = name;
secondHigest = score;
}
}
// Display the student with the
hightest score
// and the student with the
second-hightest score.
System.out.println(
"Higest scoring
student: " + student1 +
"\nSecond Higest
scoring student: " + student2);
}
}
In: Computer Science
Business law, please help for this court case below.
Gaskell v. Univ. of Kentucky
In: Accounting
Identify several problems energy drinks such as V energy may face, especially in Australia.
In: Economics
In: Biology
Derive C-V characteristics for n-type MOS at high frequency and low frequency
In: Electrical Engineering
Derive C-V characteristics for n-type MOS at high frequency and low frequency
In: Electrical Engineering
In: Electrical Engineering
Show that Cp = T(∂S/∂T)p and Cv = T(∂S/∂T)V
In: Chemistry
What are the issues in the case: Fletcher v. South Peninsula? and what law is relevant to the issue?
In: Economics