Java collections framework

Assignment Help JAVA Programming
Reference no: EM131585575

Lab

This is an additional assignment from the chapter on the Java Collections Framework.

Suppose you buy 100 shares of a stock at $12 per share, then another 100 at $10 per share, then you sell 150 shares at $15. You have to pay taxes on the gain, but exactly what is the gain? In the United States, the FIFO rule holds: You first sell all shares of the first batch for a profit of $300, then 50 of the shares from the second batch, for a profit of $250, yielding a total profit of $550. Write a program that can make these calculations for arbitrary purchases and sales of shares in a single company. The user enters commands buy symbol quantity price, sell symbol quantity price (which causes the gain to be displayed), and quit.

Hint: Keep a Map<String, Queue<Block>> that manages a separate queue for each stock symbol.

Use the included templates for the program in the zip file Assignment10.zip. You do not need to add any additional methods other than what are included. There is a sample of an input script so you can see how I may test your program. Be sure to fully test the program before submitting it. I should not be able to crash it.


Attachment:- Templates and setup files.zip

Reference no: EM131585575

Questions Cloud

Develop a table to present the inventory quantities : Develop a table to present the inventory quantities and the safety stock costs at each service level.
Find all eigenfunctions : Use separation of variables to find all eigenfunctions, i.e., all solutions of the form u(r, ?, t) = Q(r)T(?)T(t)
What is the importance of product positioning : What is the importance of product positioning? What product comes to mind for you when you think of great product positioning?
Create an access database table with the title providers : Create an Access Database table with the title: Providers. Create a second Access Database table with the title: Nurses.
Java collections framework : The user enters commands buy symbol quantity price, sell symbol quantity price (which causes the gain to be displayed), and quit.
Find a spanning tree of the graph at left : List at least eight spanning trees and their corresponding total weights for the graph in Figure. How many minimum-weight spanning trees does this graph have?
College professor to be friends on facebook : Is it ethical for a student and a college professor to be friends on Facebook while the student is enrolled in the professor's (a) class or (b) school?
Explain and describe the nature of strategic leadership : Explain and describe the nature of strategic leadership.Why is high-level cognitive activity of a leader important?
Illustrate current-state workflow model and identify the gap : Illustrate the current-state workflow model and identify the gap(s). Explain the solution you formulated and how it relates to meaningful use.

Reviews

len1585575

8/1/2017 3:36:19 AM

Stocks are stored as Map>. 6 Points Stocks are stored properly. 4 Points The stocks are not stored properly, but it works as specified. 0 Points Stocks are not stored properly and it does not work correctly. Program runs for the specified test cases and any additional ones added. 20 Points All test cases run properly. 15 Points The program worked with minor errors. 0 Points The program did not work properly.

len1585575

8/1/2017 3:36:12 AM

Criteria Meets Requirements Minor Errors Needs Improvement Program should have comments as needed 2 Points Program has additional comments in addition to the Java doc comments. 1 Points Program comments are sparse or not clear. 0 Points Program comments are missing or not understandable. Class names begin with a capital letter. All other identifiers should meet Java standard rules. 2 Points Java naming conventions are good. 1 Points Java naming conventions are not followed in one or two cases. 0 Points Java naming conventions are not followed in many cases.

len1585575

8/1/2017 3:36:04 AM

All methods have Javadoc comments that fulfill all the requirements in the rules for programming. This includes all @param, @return, @throws, and Description sections. 2 Points All methods have Javadoc comments that fulfill all the requirements in the rules for programming. 1 Points All methods have Javadoc comments that fulfill most of the requirements in the rules for programming or some methods were missing the Javadoc comments. 0 Points The Javadoc comments were missing from all or most of the methods. There should be no warnings during compile. 2 Points Program compiles cleanly with no warnings. 1 Points Program has one or two warnings, but still compiles. 0 Points Program has many warnings during compile.

len1585575

8/1/2017 3:35:57 AM

Levels of Achievement Criteria Meets Requirements Minor Errors Needs Improvement Zip File named FirstNameLastNameA10.zip using the student name. 2 Points The name was exact with no underscores or capitalization errors. 1 Points The name had minor errors, but was close to what was requested. 0 Points The name of the submission was not what was asked for. Header at the top of the program matches the rules for programming. 2 Points The header at the top of the program matches the rules for programming exactly. 1 Points There are some errors in the header at the top of the program which are minor. 0 Points The header at the top of the program was missing or did not match the rules for programming at all.

Write a Review

JAVA Programming Questions & Answers

  The class overloaded constructor receives a 2-dim int array

The class overloaded constructor receives a 2-dim int array as a parameter and assigns its values to a private 2-dim int array. Have another method that prints the whole 2-dim table.

  Data streams and how are they used to facilitate storage

What are Java data streams and how are they used to facilitate storage and retrieval of persistent objects?

  Develop the myclone class

You will also create another class of your choice. Your programmer-defined class should have at a minimum two instance variables and one method - You will create a Virtual World application as your final project. This Virtual World will have sever..

  Write a driver program that reads in animals of type horse

Write a driver program that reads in 3 animals of type Horse and prints out the name, age and height of all non pure blood Horse objects that are 4 or more years old. The following information should be read per Horse:

  Calculates the minimum maximum and average for each quiz

Write a Java application that calculates the minimum, maximum, and average for each quiz. Print the output results in a table format using a text area. Use loop and if statement control structures as well as Array data structure

  Write a java applet that views staff information

Write a Java applet that views, inserts, and updates staff information stored in a table Staff in an Oracle Database. The View button displays a record with a specified ID

  Write a program that displays a drawing popular hangman game

Write a program that displays a drawing for the popular hangman game, as shown in Figure 15.32(c). draws a sketch for the hangman game.

  Create ten dummy tasks to test with

Your task list should survive configuration changes. Create 10 dummy tasks to test with. Implement drag and swipe to move and delete items in your RecyclerView.

  Multiple choice java programming questions

Determine which of the following may be a violation of information hiding if inserted for the comment above?

  Write down a program which determines the bonus that must

write a program that determines the bonus that should be paid to employees. bonuses are determined based on the years

  Create a simple shopping cart application

Create a simple shopping cart application. Display a list of books as an h:selectOneRadio element. When the user submits the form, store the user's selection in a SessionScoped managed bean

  Mining information from sales data is a common task in both

mining information from sales data is a common task in both traditional and online stores. past sales information can

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd