Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task should be completed using Java! Please use CTRL and + to zoom the task! Task requirements Create an executable .jar file. You can use

Task should be completed using Java!

Please use CTRL and + to zoom the task!image text in transcribedimage text in transcribed

Task requirements Create an executable .jar file. You can use Java version up to 15 inclusive. Please, be aware that if you use any Java version older than 15, some classes which were included into JRE in previous versions (like javafx) are not available in JRE 15. In this case the solution will fail with an exception on the first test case. Read the input data from the file named input.txt which will be located in the current working directory. Please, access the file by name, e.g. "input.txt" not "/home/user/input.txt" so it will be resolved to the current working directory automatically. As a result of execution, your .jar file should create a file containing the output data, named output.txt in the same folder (working directory). Performance of your solution matters! Note that the memory limit for the tests is set to 128 MB (-Xmx128M). The solution .jar file must contain the source code. After you have solved the task, send it via the form in the section below (please do not publish it anywhere else). Your submission will be automatically tested, so it is required that you strictly follow the input/output data format. If your .jar file is not executable, or does not contain source code, it will not be accepted. We value candidates who try to think over the solution before sending it as finished - please, don't send a lot of similar solutions with random changes. Input/Output Data Format Input file Each line in the file can be one of the following: Updates to the limit order book in the following format: ou, , , bid - set bid size at to (size shares in total are now being offered at price) ou, , , ask - set ask size at to Queries in the following format: oq, best_bid - print best bid price and size o q, best_ask - print best ask price and size oq, size, - print size at specified price (bid, ask or spread). And market orders in the following format: oo, buy, - removes shares out of asks, most cheap ones. . o, sell, - removes shares out of bids, most expensive ones In case of a buy order this is similar to going to a market (assuming that you want to buy similar items there, and that all instances have identical quality, so price is the only factor) - you buy units at the cheapest price available. Queries, market orders, and limit order book updates are in arbitrary sequence. Each line in the file is either one of the three and ends with a UNIX newline character - In. Input values range: Price - 1...10 Size - 0...108 Example of input file: Example of input file: u,9,1, bid u, 11,5, ask q, best_bid u,10,2,bid q, best_bid o, sell,1 q, size, 10 u,9,0, bid u, 11, 0, ask Output file Example of output file (for this input file): 9,1 10,2 1

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

Recommended Textbook for

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions

Question

Explain the performance appraisal period.

Answered: 1 week ago

Question

=+Trainers from headquarters? Local trainers? Independent trainers?

Answered: 1 week ago