GetACoder.com

 
 

Home | My Account | Post Project | Browse Projects | RSS Feeds New!

 

Java Lottery Programming

 
 
Download the Free Step-by-Step Guide
     
Budget: $ 20-100
Status: Closed for Bidding (selected user roybuet)
Project Creator:
shabzadamaus  
  Rating: (No Feedback Yet)
Required Skills: Java, Javascript, Programming
Attached Files: (None)
 
post new project
email this project
discuss this project
send private message to project creator
more options

NEW

SEND

DISCUSS

CONTACT

OPTIONS

Description
In this assignment, you will use sockets to write a simple client-server application to
play a Lottery. You should 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.
c4.Read (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.
s1.Wait for a client connection on this socket
s2.When a client connection is accepted send an acknowledgement as a
string 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.
Programming notes
Here are a few tips/thoughts to help you with this assignment:
· 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.
· Write a Client application, which consists of a GUI containing fields to insert the
six choices and a ‘Submission’ button that must be clicked to send them. There
should also be a field indicating whether any of your choices has won. A 'Quit'
button would also be good programming practice.
· 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();
· Most of you 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.
· 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 systemwide
values and in the UNIX lab other students may be using the port number you
are trying to use.
Extensions
A small number of marks are reserved for extensions. These could be to make the
Server multithreaded, or to send the range of possible number choices to the client
and validate entries there.

Reminder
You may not start working in this and any project before your bid is accepted. Any user who violates this policy may have their account permanently suspended.

Place Bid | Post Similar Project | Send Project | Message Board(0) | Contact shabzadamaus

Order by:

 

 shabzadamaus has chosen to keep all bids for this project hidden

 

Remember that contacting the other party outside the site (by email, phone, etc.) on all business projects (before the project is awarded) is a violation of our terms of use. We supervise all site activity for such infringements and can immediately expel transgressors on the spot, so we thank you in advance for your cooperation. If you notice a violation please help out the site and report it. Thank you for your help.
 

          nbsp;    

 


 
Get the Free Step-by-Step Guide on How to Use GetACoder
The act of outsourcing projects has become easy in the past few years thanks to GetACoder. However, our team aims at making the whole process even easier. So, it has now come the time to provide you with a step-by-step guidance on how to use this service and succeed in the outsourcing world totally for FREE.

It doesn’t matter if you are a more experienced user or a novice; using GetACoder will become even simpler with the help of this E-book. There are two major sections: a Buyers section and a Coders section.

Buyers will learn:
  • How to outsource safely
  • How to pick the best freelancers
  • How to manage time and money

Coders will learn:

  • How to get the best projects
  • How to secure their payments
  • How to build a long-lasting relationship with buyers

    …and  MUCH MORE
Clear examples and pictures illustrating key situations, great tips and real testimonies of some of our best users… all in this Outsourcing Guide.  So don’t loose the outstanding opportunity to download GetACoder FREE E-book.
The Outsourcing Revolution: Why It Makes Sense and How to Do It Right
The Outsourcing Revolution: Why It Makes Sense and How to Do It Right
What is GetACoder?

GetACoder.comGetACoder is a leading Global Services Marketplace doing business in more than 200 countries. Our unique system accelerates your time to market and provides your business with key competitive advantages. When you use GetACoder you are stretching your budget and saving as much as 60% over traditional outsourcing. GetACoder is changing business, now it's no longer about what you own or build but which resources and talent you can access. With GetACoder you reduce expenses, increase efficiencies, aggressively grow your business, and create a sustainable competitive advantage. GetACoder makes outsourcing to any part of the world an easy task! With GetACoder it's simple to outsource any business project, gain access to global talent and manage projects online.

One of the main advantages of GetACoder is the low labor cost. The typically rates are about seven times lower than the ones in the US or Europe. Posting a project at GetACoder allows the right professional or company to find you and to bid for your work. We are building a reputation for exceeding our customers' expectations and for becoming an extremely cost effective way to outsource work. Use GetACoder when you want to save money, increase efficiency or accelerate the development of your project. With GetACoder you focus on growing your business and let others do the tedious work. Post your project on GetACoder for free. Find out why people outsource projects with us day after day.

Thousands of Satisfied Customers - Submit/View Quotes


-I am from beijing, China and i am very glad to join GetACoder. It's a nice web site, I like it. - braveheart
-This is the best website I have ever seen. I have been a freelancer from the past 7 years and have worked on several sites. Within 1 minute after signing up and bidding, I got many responses, which shows how much positive this website is. Good Luck to you all! - samwipro
-GetACoder is simply great! - ACETECHPVTLTD
Report Violation    Privacy Policy     Affiliate Program    Terms of Use    Contact Us    Help      GetACoder.com Latest Projects RSS Feed
© 2004-2008 GetACoder. All rights reserved.