TutorTeddy.com, Tutoring, Dallas, TX
Like us for free help*

Welcome to TutorTeddy.com

Ask any Statistics/Probability/Math Question

A dump of our free Chat sessions, in case it is useful. It excludes white boards used during paid sessions.

tutor2 : Hello Student, May I help you with your Math problems?
student : Use socket programming to implement a simple client and server that communicate over the network and
implement a simple application involving Cash Registers. The client implements a simple cash register that
opens a session with the server and then supplies a sequence of codes for products. The server returns the
price of each one, and also keeps a running total of purchases for each client. When the client closes the
session, the server returns the total cost
tutor2 : ok
tutor2 : is that all in your question?
student : it works as follows-
student : 1. The server "listens" for connections on some port number of some machine (say, port 60001 of
2. The client opens a connection to the server's socket (i.e. IP + port number).
3. The server accepts the connection and waits to receive a request string from the client.
4. Once the client is connected to the server, the client and server exchange a sequence of requestresponse
messages according to the specification below.
5. Finally, the client closes the connection.
The format of the request string sent by the client is as follows:
Request_ Type UPC-Code Number
• Request_Type is either 0 for item or 1 for close.
• UPC-code is a 3-digit unique product code; this field is meaningful only if the Request_Type is 0.
• Number is the number of items being purchased; this field is meaningful only if the Request_Type is 0.
Examples of client’s request are:
0 104 4 requesting cost of 4 items of product 104
0 135 9 requesting cost of 9 items of product 135
1 000 0 close
1 109 9 close
2 009 1 invalid
The server has a database containing 1 table with three fields. The first field is the UPC code, the second field is the
name of the product (you can assume that it is at most 25 characters and has no white space), and the price per unit of
the product, represented as a decimal number. A sample database, which you can use for testing is
101 USB4GB 501.50
102 Xeroxpaper 145.75
103 CDRW 12.00
104 DVDR 50.00
105 IBMThinkpad600E 40700.00
106 HPLaserJet1500 15800.00
student : please help me
tutor2 : which script or language are you using?
student : c language
tutor2 : we can surely help you
tutor2 : please, email you complete question to tutor@aafter.com
student : ok
tutor2 : we'll send you quote with secured Paypal link soon
student : thanks
student : thanks
student : ok

TutorTeddy.com & Boston Predictive Analytics

[ Email your Statistics or Math problems to tutor@aafter.com (camera phone photos are OK) ]

Boston Office (Near MIT/Kendall 'T'):
Cambridge Innovation Center,
One Broadway, 14th Floor,
Cambridge, MA 02142,
Phone: 617-395-8864

Dallas Office (Near Galleria):
15950 Dallas Parkway,
Suite 400,
Dallas, TX 75248,
Phone: 866-930-6363

Copyright 2011 tutorteddy.com. All Rights Reserved. | By using our site, you agree to our TOS.