Create an application for online shopping

Assignment Help Computer Engineering
Reference no: EM132110191

For this project, you're going to create a client-server connection using Java code that we've practiced in the Activities this semester.

This program is a very simple server-based program that has many uses in the modern age, such as online banking, online gaming, school registries, and many more.

For this project, we're going to create an application for online shopping.

The idea here is simple. A user should be able to browse a small selection of fruits from an online vender, choose which one(s) to purchase and how many, and end the transaction.

This is how it's going to work. A user will log on to the online store (which we will assume is done prior to the start of the application). For the purposes of this assignment, we're going to use ‘localhost' for the IP. You may use any PORT number you wish as long as it's not reserved.

When the application starts running, the user is logged in and given a list of fruits. The user may then select any of these options:

Display items chosen to buy

Purchase Bananas ($2 each)

Purchase Oranges ($3 each)

Purchase Pineapples ($5 each)

Purchase Watermelons ($8 each)

Finish Shopping

For the purposes of this assignment, we're going to assume that the user has an unlimited amount of money for shopping purposes. The store, however, does not. When the server connects, the client will get the inventory from the store's server so that the user will know how many of each item is in stock.

When the user selects to purchase an item, the user will be prompted for the quantity to buy. Upon giving a quantity, the user's cart should be updated with the number of the specific fruit and the client's inventory should decrease by the amount purchased. Finally, when the user decides to finish shopping, the program should display the total cost of the items the user purchased and close the connection.

When your program starts, the server should accept a connection from the client, and then generate a random inventory of items. Each item should have a random stock assigned from 10 to 20. The inventory values should be sent to the client, which will then display them to the user within the menu of purchase options. When a purchase is made, the inventory should be updated in the client for the item purchased.

The user's current list of items should be stored on the client end and displayed neatly when the user chooses to see it. Finally, when the user is done shopping, the final list of items should be sent to the server, which will calculate the total price and update its own inventory, then send the total price to the client which will display the total and then finish execution.

There are a few guidelines that you must follow for this program. When you have finished creating the program, make sure to check back over these guidelines to make sure that everything has been accounted for.

The guidelines are as follows:

The program must be a console-based application. No GUIs allowed.

The program must loop through the options until the user selects to exit.

You may get user input any way you choose - however, you must catch invalid entries. This means that if your options are 1-6, then a user entry ‘F' should be caught and give an invalid entry feedback, then allow the user to reenter their choice. Valid entries must also be checked when asking for quantities - positive integers only.

Your program must account for the amount of inventory in the store. If a user chooses to buy 10 pineapples and the store only has 8, then an error message should show and the purchase should not be completed.

User-friendliness is important! Make sure that your program looks nice and easy to use.

Send regular messages to the server's console. At the very least, send a message when the server connects, when input is received from the client, and when the server disconnects.

Make sure that in the natural runtime of your program when the server is disconnected that all sockets, scanners, and any other form of I/O is closed - leaving these open can cause a security leak that, while harmless on a localhost, can be dangerous on other IPs.

Reference no: EM132110191

Questions Cloud

Create a query that prompts for the professors name : Create a query that prompts for the name of a department and course level and returns the timetable of the courses for this particular group
Do you think sqa plan is just busy work : What is your opinion about SQA plan, do you think SQA plan is just busy work, or does it really pay off?
Consider how to resolve a collision : In other words, instead of storing Person objects in a binary search tree, the PhoneBook class will store these Person objects in a hash table.
Determine sets of prices which meet the objectives : ITECH1100 Understanding the Digital Revolution Assignment - Parchment Basement, Federation University Australia. Determine sets of prices which meet objectives
Create an application for online shopping : When the user selects to purchase an item, the user will be prompted for the quantity to buy. Create an application for online shopping.
Describe in brief the methods used to collect the data : EGH418 Biomechanics - Describe in brief the methods used to collect the data. Consider anthropometry measures, force plate and motion capture data including
Develop a uml class diagram diagram for a classic car : In this project, you have the opportunity to develop a UML class diagram diagram for a classic car museum database system.
How many times a user specified word appears in the files : Display the name of input files and corresponding number of occurrences of the specified word.
Write a program to run a tournament : Write a program to run a tournament. Start with your project 3 program for creatures. If you had issues with project 3 and need to begin fresh.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write a multiple threading program with a topic

Write a multiple threading program with a topic at your own choice or modify the code you find by adding more functions to it.

  What are the kinds of information systems

What are the kinds of information systems

  Wap to find the average customer waiting time

Customers arrive at a grocery stores checkout counter according to a Poisson process with rate I per minute. Each customer carries a number of items.

  Prove that for all positive real numbers a and b

CSC165H1 Problem Set. Prove the following statements about little-oh, using only the definitions of little-oh and Big-Oh. You may not use any external properties of Big-Oh in this question. Prove that for all positive real numbers a and b, if a

  In brief explain your role as an employee of an

briefly describe your role as an employee of an organization in the is field. give examples of what you need to know

  Develop a check list for assessing the physical security

Physical security is a necessity in comprehensive information security. Develop a check list for assessing the physical security of an organization.

  What is meaning of nanotechnology

What is a database management system? Discuss each of the five important software components of a database management system.

  Create a table with columns for information about location

Create a table with columns for information about the location and required IP addresses for different types of devices and/or interfaces.

  Give a two to three paragraphs explaining soap

Simple Object Access Potoccol. How is SOAP linked to XML and HTTP? Assume that your readers are familiar with browsing the internet, but they have no technical knowledge of how it works behind the scene.

  Recommendation on the action that the company needs

Prepare a recommendation on the action that the company needs to take against the offender - Prepare a recommendation on the action that the company needs to take against the offender.

  Design function that will delete the entry with largest key

Design a function that will delete the entry with the largest key (the root) from the top of the heap and restore heap properties of resulting, smaller list.

  Could a shortage of paid code checkers mean there might

Because OpebSSL is open source, could a shortage of paid code checkers mean there might be more errors like Heartbleed? Why?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd