Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
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
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.
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.
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.
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.
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.
What are Java data streams and how are they used to facilitate storage and retrieval of persistent objects?
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 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:
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, 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 for the popular hangman game, as shown in Figure 15.32(c). draws a sketch for the hangman game.
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.
Determine which of the following may be a violation of information hiding if inserted for the comment above?
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. 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 traditional and online stores. past sales information can
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!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd