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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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