Question: For this project, we will be designing two programs - a client program for a user to enter a (very) basic fast-food order and

For this project, we will be designing two programs - a client program for a user to enter a (very) basic fast-food order and a server program that can compute an order number and total with tax and write a transaction log. Both programs will run simultaneously on your system and communicate with each other using networking code. Functional Specifications For the client program, you will need to create a program that meets the following criteria: Present a JavaFX or Java Swing interface that will consist of a form containing at least three possible things to order (burger, shake, order of fries). Each of these items should allow you to specify a quantity. Provide a "Send Order" button that will collect all items ordered and send this information to your fast-food server. Accept a response from the fast-food server that will contain a unique order number and a total of all items ordered plus 6% sales tax. A text area that will present the order information provided by the server. For the server program, you will need to create a program that meets the following criteria: Be multithreaded in that each incoming order will be processed on a separate thread Code to compute a unique order number. The order number will be stored in a static variable and shared amongst all threads. Initialize the order number to start at 1000. Code to compute the order total which would include all line items (burgers, shakes and fries) as well as the sales tax of 6%. Write the order information to a log file on disk. This is our transaction log and evidence of an order. A standard text file will suffice and must include an order number that the server generates, the client ip address, and the computed total. Code to respond back to the fast-food client with the order number and total information. The price of items will be as follows: burger - $5.00 fries - $2.00 shake - $3.50 The price of items will be as follows: burger - $5.00 fries - $2.00 shake - $3.50 Example Scenario For example, if the user ordered two burgers and two shakes, the server would respond with this information for the client to present to the user: order number: 1000 total: $18.02 (2 burgers * $5+ 2 shakes * $3.50) *.06 sales tax Later, if another order was received consisting of a single shake, the server would respond with: order number: 1001 total: $3.71 Note that the order number is always unique!
Step by Step Solution
3.42 Rating (146 Votes )
There are 3 Steps involved in it
Heres a basic outline of how you might structure your client and server programs in Java Please note that this is a simplified version and you might need to handle exceptions and edge cases according ... View full answer
Get step-by-step solutions from verified subject matter experts
