Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java question You are to create a stock market simulation game, which has many of the characteristics of real electronic commerce. The entities in the

Java question
image text in transcribed
You are to create a stock market simulation game, which has many of the characteristics of real electronic commerce. The entities in the game are a bank, a stock exchange, and several companies and players. Bank: The bank holds the money of one customer (one player or company). A customer can open a new account, and deposit and withdraw money from the account. Once every 10 seconds during the game, all money in an account accumulates interest. The interest for the customers with the highest and second highest amount of money is 5%, while the interest for the other customers is 3%. Company: A company has a name and can issue stock. Initially each company has 1000 shares of stock, which starts at $30 a share. A company buys or sells shares to a player by accepting or rejecting the player's bid. Player: A player initially has $2000 in the bank, and buys and sells stock from companies or other players by trading through the stock exchange. The goal of a player is to make money. A player buys or sells shares from other players or companies by posting bids on the stock through stock exchange. Stock Exchange: All trading of stocks must go through the centralized stock exchange. For each stock that is being selling, the stock exchange posts the latest transaction of that stock if possible. The stock exchange also displays the information of each bidder (the bidding price and name of the player/company). The stock exchange stores the stock transaction information in a txt file. Suppose we have three companies and five players in our game. When the players or companies want to sell the stocks is random, the number of the stocks to be sold is also random. At any time point, we have at most one type of stock that is being selling. For a stock, the number of bidders is random. One company or player may accept or reject other players' or companies' bids. The bidding price of each player or company could be random, you can also manually enter the price yourself if you want. After all bidders place the bid, if the highest bidding price is no less than 0.9 * the price of the latest transaction of that stock, then the play or company accepts the bid; otherwise, the player or company rejects the bid. If a stock is being selling for the first time, whether the selling player or company accepts the highest bidding price is random (the highest bidding price should not be zero). You should try to generate the corresponding random number within the reasonable range. For example, we have three companies and five players, if one company or player plan to sell the stocks, then the number of bidders should be within the range TO, 7]. Let your program run some time (30 seconds for example) and see which player wins the game

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

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

In Exercises find the indefinite integral. [xe= xex dx

Answered: 1 week ago

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago