Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Saud Bahwan Automotive LLC in Sultanate of Oman has partnered with Toyota to make it one of the most loved brands in the country.

The Saud Bahwan Automotive LLC in Sultanate of Oman has partnered with Toyota to make it one of the most loved brands in the country. This company is planning to offer certain promotions for Omani as well as expat female nationals. The promotions include discounts for females only and is offered on purchase of a particular vehicle. If the Buyer is a female and aged between 25 and 35 discount of 15% will be offered on the overall cost of the particular vehicle. If the Buyer is a female and aged between 36 and 45 discount of 10% will be offered on the overall cost of the particular vehicle. If the Buyer is above 45 years of age a discount of 5% on the overall cost is offered. Write a program for the company above using socket programming (graphical user interface is not required) to calculate the final cost of the vehicle after discount for different types of Buyers. On the client side, allow the user to enter the gender, age, and the price of the vehicle. The client will then forward the age of the Buyer to the server. The promotion offered is only for females hence the client will forward details only of female buyers. Upon receiving the age of the buyer and the total cost of the vehicle, the server will determine which discount option to use, calculate the final price after discount, and then send the final cost and the discount given back to the buyer back to the client. Upon receiving the final cost and the discount rate used, the client should display them.

*******

Task 2.3. Multithreaded Server side program: Develop a Multithreaded server side program which will do the following. (35 marks) a. Create a thread using extending thread class or implementing runnable interface and implement run method. b. After receiving the age by the buyer from the client side, the server should determine which discount to be used (for example, discount1 or discount2 or discount3) c. Make connection to the database using JDBC d. Search the database using the discount ID determined and retrieve the appropriate rate value e. Use the retrieved rate value to calculate the bill and send the bill and the rate value used back to the client f. Close the connection with the database when done Note: You must use proper naming convention for the Java code and you need to briefly elaborate keywords, concept, and logic in your own words.

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

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

Determine the amplitude and period of each function.

Answered: 1 week ago