Reference no: EM13307351
write a Java program for performing order matching according to the typical rules of a double auction system.
For simplicity we will assume that all orders are for a single unit of the traded item. The double action system operates as follows. When a new buy order of $x arrives it is simply stored for future use if none of the stored sell orders has an asking price lower than or equal to $x. Otherwise, the new buying bid is matched with the sell order with lowest asking price (earliest such order if there are ties). The two matched orders are removed from the system, and the buyer receives the item in exchange for paying a clearing price equal to the matched sell order asking price, i.e., the lowest asking price available at the time the new buy order was received.
Processing of a new sell order with an asking price of $y is done in a similar way. If all stored buying orders have a bid price strictly lower than $y, then no matches can be made and the new order is simply stored for possible future matching. Otherwise, the new sell order is matched with the stored buy order with highest bid price, handling ties as above. The two matched orders are again removed from the system, and the clearing price paid in this case is the bid price of the matched buy order, i.e., the highest bid price available at the time the new sell order was received.
have your program create the following example input and output
Sample Input 1
order 1 sell at 30
order 2 buy at 20
Output for Sample Input 1
units exchanged 0 total clearing price 0
Sample Input 2
order 1 sell at 30
order 2 buy at 20
order 3 buy at 40
order 4 buy at 30
order 5 sell at 10
Output for Sample Input 2
units exchanged 2 total clearing price 60
What is the theoretical rate of moisture removal from grain
: A model grain dryer is being used to investigate the drying process. It is discovered that the load cell which supports the dryer indicates that the mass of the dryer and its contentsinitially increases during the heat-up.
|
The food industry intentionally manipulates consumers
: The food industry intentionally manipulates consumers by taking advantage of the fact that most consumers are ignorant of all of the ways that the food industry manufactures and processes its products.
|
Direct proof or by contraposition
: Let f be a function f . Z → Z x Z such that f(n) = (2n, n + 3). Verify whether this function is 1-1 and whether it is onto and let f be a function f . R3 → R such that f(x, y, z) = xyz. Verify whether this function is 1-1 and whether it is onto.
|
Compute the density of the material
: A solid piece of an unknown material wights 96.9 N in air and 59.6 N when submerged in water. The density of water is 1000 kg/m3, Determine the density of the material
|
Write a java program for performing order matching
: write a Java program for performing order matching according to the typical rules of a double auction system.
|
How you would take any number of values of any type
: How you would take any number of values of any type, and then remove the duplicates while at the same time storing the datat in the most efficient manner you can so that you can print out the data as an ordered list? Write a method to do this?
|
What are the risks associated with the loss of these data
: Based on the Ledford (2012) article, what special issues must be considered for corporate data which are not fully digitized? What are the risks associated with the loss of these data? What recovery procedures do you recommend for these situations..
|
Contrast solutions to tyson situation-jbs-swift situation
: Contrast the solutions to the Tyson situation and the JBS-SWIFT situation. Which is likely to have the greatest positive impact on the company and why?
|
Determine what is the maximum flowrate in the business
: A business wishes to discharge salt into a river. the concentration of salt from the business is 210 mg/L. the flow of water in the river (upstream) is 0.5 m^3/s. Upstram the concentration of salt in the river 15 mg/L.
|