Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this project, you will submit two .java files. You will need to run two classes simultaneously for this activity. Make sure you have a

For this project, you will submit two .java files. You will need to run two classes simultaneously for this activity. Make sure you have a compiler that is capable of this.

For this project, youre going to create a client-server connection using Java code that weve 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, were going to create an application for online banking.

For this program, the first thing you should do is setup the Server and have the Client connect to it. From there, the Server and Client should both maintain the connection until the user is finished. Once connected, the Client should display 4 options to the user and allow him/her to select between them (you may do this in any way you choose, but you must have data validation for any possible invalid entries). The four options are as follows:

Display Account Funds Get the amount of money in the users account from the Server and display it to the user on the Client-side.

Deposit Funds Ask the user how much money they would like to deposit (for the sake of this activity, assume the user has unlimited funds) and send the amount chosen to the Server to add to the funds in the users account.

Withdraw Funds Ask the user how much money they would like to withdraw and remove the amount chosen from the users account. The withdraw amount must be equal to or less than the amount in the users account; if the user asks to withdraw more money than they have in their account, an error message should display to the user, the withdraw should be cancelled, and the user should be taken back to the menu.

Exit and Logoff This option should simply close the connection between the Server and Client, close all I/O, and terminate both programs.

The Server should set up the users initial account, giving them a $0.00 balance when they first log on. Then the Server should enter into a loop in which each iteration consists of waiting for a response from the Client for which option the user chose (since all 4 options will require the Server to do something) and acting accordingly. When the operation is complete, the loop should restart and repeat the process until the user chooses to exit.

Project Guidelines

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 check 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 all invalid entries. This means that if your options are 1-4, 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 monetary amounts positive integers, doubles, or floats. No negative numbers should be valid.

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

Send regular messages to the servers console. This helps when writing the program to know exactly where the Servers execution is during RunTime and can also help find and fix bugs in the code.

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.

Leave documentation and comments in your code to explain things step-by-step. This is just good practice. It doesnt have to be a lot; just enough to explain your process in a simple way.

Code written must be your own. You are not allowed to copy code from any source, including but not limited to other students, textbooks, websites, etc.

For this project, you will submit two .java files. You will need to run two classes simultaneously for this activity. Make sure you have a compiler that is capable of this.

For this project, youre going to create a client-server connection using Java code that weve 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, were going to create an application for online banking.

For this program, the first thing you should do is setup the Server and have the Client connect to it. From there, the Server and Client should both maintain the connection until the user is finished. Once connected, the Client should display 4 options to the user and allow him/her to select between them (you may do this in any way you choose, but you must have data validation for any possible invalid entries). The four options are as follows:

Display Account Funds Get the amount of money in the users account from the Server and display it to the user on the Client-side.

Deposit Funds Ask the user how much money they would like to deposit (for the sake of this activity, assume the user has unlimited funds) and send the amount chosen to the Server to add to the funds in the users account.

Withdraw Funds Ask the user how much money they would like to withdraw and remove the amount chosen from the users account. The withdraw amount must be equal to or less than the amount in the users account; if the user asks to withdraw more money than they have in their account, an error message should display to the user, the withdraw should be cancelled, and the user should be taken back to the menu.

Exit and Logoff This option should simply close the connection between the Server and Client, close all I/O, and terminate both programs.

The Server should set up the users initial account, giving them a $0.00 balance when they first log on. Then the Server should enter into a loop in which each iteration consists of waiting for a response from the Client for which option the user chose (since all 4 options will require the Server to do something) and acting accordingly. When the operation is complete, the loop should restart and repeat the process until the user chooses to exit.

Project Guidelines

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 check 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 all invalid entries. This means that if your options are 1-4, 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 monetary amounts positive integers, doubles, or floats. No negative numbers should be valid.

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

Send regular messages to the servers console. This helps when writing the program to know exactly where the Servers execution is during RunTime and can also help find and fix bugs in the code.

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.

Leave documentation and comments in your code to explain things step-by-step. This is just good practice. It doesnt have to be a lot; just enough to explain your process in a simple way.

Code written must be your own. You are not allowed to copy code from any source, including but not limited to other students, textbooks, websites, etc.

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

More Books

Students also viewed these Databases questions

Question

What four basic methods can be used to achieve a tax-deferred sale?

Answered: 1 week ago

Question

How are depression and heart disease related?

Answered: 1 week ago