Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions: Compile the C programs in one of the CSE (cse01 cse06) servers and make sure its working. Comment your code. Create a Makefile to

Instructions: Compile the C programs in one of the CSE (cse01 cse06) servers and make sure its working. Comment your code. Create a Makefile to compile the source code and to clean the binaries. Create a readme file that describes how to compile, execute, and test the code. Create an assignment folder with folder name as euid_PA1 (example: xyz0202_PA1) and add all the source files, Makefile, and the readme file to the folder. Please create a zip archive of your assignment folder and upload the zip file to Canvas. Not following the above instructions could result in not accepting your programming assignment. Late submissions are not allowed.

Objective:

Create a word count server that can do the following: converts first alphabet of a given sentence to upper-case and converts rest of the alphabets to lower-case, counts the number of spaces, counts the number of alphabets, and finally counts the number of vowels in a given sentence.

Requirements:

  1. Create a C-based client-server architecture using TCP sockets
  2. The word count server should run on cse02.cse.unt.edu machine and the client should run on cse03.cse.unt.edu machine
  3. The word count server should be able to accept and service at least one clients request
  4. The word count server should be able to convert first alphabet in a given sentence to upper-case alphabet and convert rest of the alphabets to lower-case and print the converted sentence on the client side
  5. The word count server should be able to count the number of spaces in a given sentence and print the number of spaces on the client side
  6. The word count server should be able to count the number of alphabets in a given sentence and print the number of alphabets on the client side
  7. The word count server should be able to count the number of vowels in a given sentence and print the number of vowels on the client side
  8. The word count server should be able to quit when a quit expression is given as input from the client side
  9. Do not use any ready-made or in-built functions to directly count spaces, alphabets, vowels, or to convert the case
  10. Do not use any Linux shell commands or code from the internet. You could use pre-defined functions from C string library.

Procedure:

  1. Create a C-based server that can accept at least one clients request using TCP sockets
  2. Make sure the word count server runs on cse02.cse.unt.edu and the format to start the word count server as follows

./wcserver

where wcserver is the word count server executable and port_number is the port number on which the word count server listens

  1. Create a C-based client that can connect to the word count server using TCP sockets
  2. Make sure the client runs on cse03.cse.unt.edu and connects the word count server. The user can send the sentence using the below format

./client

input:

where client is the client executable, port_number is the port number on which the client connects the server and input is the sentence input to the server

  1. Once the word count server gets a sentence from the client, it converts the first alphabet of the given sentence to upper-case alphabet and converts rest of the alphabets to lower-case and sends the converted sentence to the client
  2. It also finds the number of spaces, number of alphabets, and the number of vowels in the input sentence and replies it to the client
  3. The word count server quits when a quit expression is given as input
  4. Assume that the given sentence will not be more than 255 characters, every word will be separated with a single space, and will have punctuations
  5. An example server and client code is given on Canvas (under Misc. module)
  6. An example client interaction with the server is shown below.

Client-side input/output example:

./client 1234

input: hello world!

output: Hello world!

spaces: 1

alphabets: 10

vowels: 3

input: HOW ARE YOU?

output: How are you?

spaces: 2

alphabets: 9

vowels: 5

input: quit

cya!

Deliverables:

  1. Commented server and client C code
  2. A Makefile to compile (make) the source code and to clean (make clean) the binaries
  3. A readme file that describes how to compile, execute, and test the code.
  4. Create an assignment folder with folder name as euid_PA1 (example: xyz0202_PA1) and add all the source files, Makefile, and the readme file to the folder. Please create a zip archive of your assignment folder and upload the zip file to Canvas.

A video discussion about Programming Assignment #1 is linked below.

https://www.youtube.com/watch?v=7rops9lESDI&feature=youtu.be

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions