Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want this java program as soon as possible Open Book 5) Write a java program to do the following: (40) Create a file stock.txt

I want this java program as soon as possible

image text in transcribed

Open Book 5) Write a java program to do the following: (40) Create a file stock.txt with the following information: IBM, International Business Machines Corporation, 144.84, 5/2/2016 AAPL, Apple Inc., 92.63, 5/2/2016 ORCL, Oracle Corporation, 45.96, 4/26/2018 CSCo, Cisco Systems, 44.21, 4/26/2018 Create a java class "Stock" with the following fields: o Symbol o Name o Price o date Write a program to read data from the file stock.txt. for each line of data create an object of Stock class and store them in 1) ArrayList 2) a hash map as HashMap String,Stock>. The key will be the Symbol field (like IBM or CSCO). 3) Ask user to enter the symbol 4) Call a method searchArrayList(ArrayList, symbol) to search the ArrayList for the Symbol and return the price 5) Call a method searyHash(Hash,symbol) to search the Hash for the symbol and return the price 6) Call method printArrayList to print all the information of Stock in sorted order of Symbol 7) Call method printHash to print all the information of Stock in 8) Add one more Stock (ORCL, Oracle Corporation, 45.96, 9) Call method printArrayList to print all the information of Stock 10) Call method printHash to print all the information of sorted order of Symbol 4/26/2018) to both ArrayList and HashMap in sorted order of Symbol Stock in sorted order of Symbol

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

3. How frequently do the assessments occur?

Answered: 1 week ago