Find Jobs
Hire Freelancers

server/client in JAVA

$5-10 USD

Closed
Posted almost 21 years ago

$5-10 USD

Paid on delivery
TO BE PROGRAMMED IN JAVA "JCREATOR" OR EQUIVILENT use sockets to write a simple client-server application to play a Lottery. to select 6 distinct numbers in the range 1-100 and you win if any one of those numbers matches the single number generated at random by the Server. The client/server action should proceed as follows: : Client c1. Connect to server via a connection-oriented socket. c2. Read (from socket) and display the prompt message sent (see step s2 in server) by the server. c3. Input your six lottery selections and send them to the server. [PREF. A SIMPLE LOOP PLS] [login to view URL] (from socket) and display the result of the game, or an error message that is returned by the server (see step s4 in server). c5. Close the connection Server s0. [Initialization] Create a socket on one of the port numbers in the range above 1024. [login to view URL] for a client connection on this socket [login to view URL] a client connection is accepted send an acknowledgement as a sting of text. s3. Receive and read the list of numbers selected by the client. Check that this list is valid (distinct numbers in the range 1-100), if not, return an error message. s4. Make the lottery draw and see if the client has any winning numbers. Return the result to the client. s5. Close the connection to the client and then loop back and wait for another connection. [PLS PROGRAM IN SIMPLE TERMS, FULLY COMMENTED. PREFERBLY NO POINTERS OR STRUCTS INVOLVED] ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. You must chose an unused server port number above 1024. For example, choose port 8888. * The Server application listens on port 8888 and handles the incoming requests. It may consist of several classes, one to listen, accept connections and revert to listening, and one to draw the lottery number and check whether any client choices have won. The Server should print diagnostic information on the terminal (no GUI is required), listing the status of the server and details of each connection. For example: Server listening on Port 8888, IP number of Client, Connection accepted. It may be helpful to test your Server using telnet before attempting to connect to the client. * In writing your code, make sure to check for an error return from your system calls or method invocations, and display an appropriate message. In Java, this means using IOException(); * i will be running both the client and server on the same machine. Start the server in one window, and then start the client in another window. In the socket, use ‘localhost’ as the name of the machine to connect to. [BASICALLY 2 TERMIANL PROMPTS, NO GUI PLEASE] * Make sure you close every socket that you use in your program. If you abort your program, the socket may still hang around and the next time you try and bind a new socket to the port you previously used (but never closed), you may get an error. Also, please be aware that port ID's, when bound to sockets, are system-wide values and in the UNIX lab other students may be using the port number you are trying to use. Submission Write a report on the design and implementation of your solution, showing code and results: (i) a class diagram outlining the class structure for your proposed solution. (ii) a set of summary tables describing the fields, constructors and methods for each class. (iii) a print out of the Java source code of your complete program. ## Platform SUN SOLARIS UNIX AND WINDOWS (WIN98 & XP)
Project ID: 2929994

About the project

17 proposals
Remote project
Active 21 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
17 freelancers are bidding on average $7 USD for this job
User Avatar
See private message.
$8.50 USD in 14 days
4.9 (90 reviews)
5.6
5.6
User Avatar
See private message.
$8.50 USD in 14 days
4.9 (78 reviews)
4.6
4.6
User Avatar
See private message.
$8.50 USD in 14 days
4.8 (15 reviews)
3.9
3.9
User Avatar
See private message.
$5.10 USD in 14 days
4.9 (24 reviews)
3.6
3.6
User Avatar
See private message.
$8.50 USD in 14 days
4.8 (9 reviews)
3.4
3.4
User Avatar
See private message.
$8.50 USD in 14 days
4.8 (6 reviews)
2.0
2.0
User Avatar
See private message.
$8.50 USD in 14 days
5.0 (1 review)
0.7
0.7
User Avatar
See private message.
$4.25 USD in 14 days
4.2 (2 reviews)
0.7
0.7
User Avatar
See private message.
$8.50 USD in 14 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$8.50 USD in 14 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$6.80 USD in 14 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$6.80 USD in 14 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$8.50 USD in 14 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$4.25 USD in 14 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$3.40 USD in 14 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$6.80 USD in 14 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$8.50 USD in 14 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED KINGDOM
United Kingdom
5.0
2
Member since Apr 28, 2003

Client Verification

Other jobs from this client

The numbers in java
$5-10 USD
Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.