Home / Expert Answers / Computer Science / in-java-use-the-same-logic-of-the-following-code-import-java-io-import-java-util-class-pa796

(Solved): In Java, use the same logic of the following code: import java.io.*; import java.util.*; class ...



In Java,

To complete the following \( \mathrm{CW} \), use the HashBasicsCW Example (attached) and the list of methods (attached in thiList of common methods used in ADT HashTableuse the same logic of the following code:

import java.io.*;
import java.util.*;
  
class HashBasicsCW {
    public static void main(String args[])
    {

        Hashtable<Integer, String> ht = new Hashtable<>();
 
        // using put() method to insert
        ht.put(1, "Worcester");
        ht.put(2, "State");
        ht.put(3, "University");
  
        // Print mappings
        System.out.println("Mappings of ht : " + ht);

    }
}
To complete the following \( \mathrm{CW} \), use the HashBasicsCW Example (attached) and the list of methods (attached in this document) as references. 1) Create a class named StudentInfo. Include the following fields in the class; Student Name, GPA, Major, Graduation Year, Department. 2) Using ADT Hash Table, create a student table where the student ID is the key and StudentInfo class is the value. 3) Add at least four students to the table, by asking the user to input the information (use a loop for this). 4) Test and print the results of all the methods listed in the common methods list (attached in this document). In order to print correctly, make sure that you have toString() method in your class. List of common methods used in ADT HashTable


We have an Answer from Expert

View Expert Answer

Expert Answer


The code for the given question is provided below in java import java.util.*; class StudentInfo { //int StudentId; String StudentName,Major,Department
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe