Question
2. Please do not upload your Assignment on Blackboard in PDF format. 3. Please write the answers, do not attach screenshots / images of answers.
2. Please do not upload your Assignment on Blackboard in PDF format.
3. Please write the answers, do not attach screenshots / images of answers.
4. For the programs, please write the program and attach the screenshot of Input file and output.
6. Please write your own answers from your understanding of the topic.
Answer All the Questions.
1. Write a Program to demonstrate the following:
a) Create a TCP Client Socket object. The name of the object must be your first name along
with last 3 digits of your Student-ID. After creating the client socket object, display the
following message in the output Your Last Name Created TCP Client Socket.
b) Attach the client socket object to an IP Address and a port. The IP Address must be in dotted
quad format and the port number must be used for non-standard service.
c) Display the following output.
Student-ID the IP Address is : xxxxxx
Student-ID the Port Number is : zzzzzz
d) Attach the Output Screen shot.
Note: Please write the program and attach the Output Screenshot. The Student-ID is your nine-digit ID and Your first name is your actual first name. Your Last Name is your actual last name. xxxxxx is the IP Adress of the server to which this client wants to connect and zzzzzz is the port number of the server to which this client wants to connect.
2. Explain in your own words any four methods of Writer Class.
3. Write a Program to demonstrate the following methods. Please attach the Output Screenshot.
a) getLocalHost( ) b) getHostName( ) c) getHostAddress( ) d) getAddress( )
4. Write a program to demonstrate Output Stream Methods. Please consider the following conditions.
a) Declare an output file and name the file as your last name.txt. Using Output Stream method,
display your complete name in the output file. Please note that your last name is your
actual last name and your complete name is your actual complete name.
b) In the next line, display the last 5 chars of your actual name in the output file, using Output
Stream method.
c) In the next line, display, beginning with the fifth character until the next 5 characters of your
actual name in the output file, using Output Stream method.
d) Attach the screenshot of output file.
5. a) Write a Program to demonstrate Predefined Streams. Attach the Output Screenshot.
b) Why do you need a Socket? Explain in your own words using your own example.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started