Question: Write a Java program that 1. first reads an input text file and stores the prime numbers in the file in a hash map; 2.

Write a Java program that

1. first reads an input text file and stores the prime numbers in the file in a hash map;

2. until the program is terminated, the program reads an input number from the user and checks if the number is a prime number stored in the hash map: if the answer is yes the program outputs "HIT", otherwise "MISS" to the console.

For the input file, use the provided input text file INPUT.txt attached. INPUT.txt contains one prime number per line. Your program should read the file from its current path

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!