Question Description

Question1 5 pts

(TCO 4) What is a packet?

A unit of data transmitted overthe network.

A key protocol at the transportlayer of the Internet architecture.

A text-based, request-responseprotocol that calls for only one round of exchange of messages.

Allows a selected set ofprogramming data types and data structures to be specified with IPCoperations.

Question2 5 pts

(TCO 4) Explain datagram socket API.

Supports the exchange ofcontinuous units of data.

Supports the exchange of discreteunits of data.

Supports the exchange ofcontinuous and discrete units of data.

None of the statements is correct.

Question3 5 pts

(TCO 4) What is a connection socket?

A type of stream-mode socket API,provided via the ServerSocket class that accepts connections.

A type of stream-mode socket API,provided via the Socket class that accepts connections.

A type of stream-mode socket API,provided via the ServerSocket class that exchanges data.

A type of stream-mode socket API,provided via the Socket class that exchanges data.

Question4 5 pts

(TCO 4) What is the differencebetween the ServerSocket class and the Socket class?

The ServerSocket class is for thetransfer of data and the Socket class is for the establishment ofconnections.

The ServerSocket class is for theestablishment of connections and the Socket class is for the transfer ofdata.

The ServerSocket class utilizesdata sockets while the Socket class utilizes connection sockets.

The ServerSocket class utilizesconnection sockets, but the Socket class doesn’t utilize any socket.

Question5 5 pts

(TCO 4) What is the Java SecureSocket Extension (JSSE)?

A socket API that providesnonblocking I/O operations.

A process that wishes tocommunicate with the server.

A set of Java packages that enablesecure Internet communications.

A stream-mode socket API thatenables secure Internet communications.

Question6 5 pts

(TCO 5) What are the differencesbetween client processes and server processes?

Client processes run on anetwork-connected computer and a server process access the server to obtain anetwork service.

Client processes access the serverto obtain a network service and a server process runs on a network-connectedcomputer.

Client processes run on anetwork-connected computer called a server host.

A server process accesses theserver to obtain a network service called a server host.

Question 7 5 pts

(TCO 5) What is a request-responsepattern?

A single interaction between theserver and client.

The interaction of processeswithin the client-server model.

A term used for a void function.

A process that makes use of asingle central processing unit to execute one or more programs for eachapplication.

Question8 5 pts

(TCO 5) What is a stub?

A method defined with minimal codeto allow the program to compile and run initially.

A class that contains thenecessary methods for stream-mode IPC.

A code that uses the stream-modesocket API to accept a connection.

A separation within theclient-side software that allows modifications to be made to the logic at onelayer without requiring changes to be made at the other layers.

Question9 5 pts

(TCO 5) What is an iterative server?

Services one client at a time.

Has a limited server forexchanging data.

Both a & b.

None of the statements is correct.

Question10 5 pts

(TCO 5) What is a stateful server?

A server that must maintain somestate information in order to provide its service.

A server that sometimes shouldmaintain some state information in order to provide its service.

A server that provides a serviceaccording to a stateless protocol.

None of the statements is correct.

Question11 5 pts

(TCO 6) What is the state?

Data of the entity.

Data is contained in the instancevariables of each object.

Both a & b.

None of the statement is correct.

Question 12 5 pts

(TCO 6) What are remote methods?

Methods of local object.

Methods belonging to a localobject.

Methods belonging to any object.

Methods of a distributed object.

Question13 5 pts

(TCO 6) Which of the following istrue about procedural programming?

Postdates object-orientedprogramming.

A function is not a controlstructure.

A procedure is a control structurethat provides the abstraction for an action.

The action of a function is invokedby a variable.

Question14 5 pts

(TCO 6) A skeleton layer _____

Interacts with the stub layer onthe client side.

Interacts with the stub layer onthe server side.

Interacts with the other layers onthe client side.

Interacts with the other layers onthe server side.

Question15 5 pts

(TCO 6) Which of the following istrue about the Remote interface?

The RMI API is the starting pointof creating a local object

The RMI API is the starting pointof creating a distributed object.

A Java interface is not a classbut a complex method.

A Java interface contains theimplementations of the method.

Question16 5 pts

(TCO 7) Hypertext Markup Language(HTML) ________

Is a markup language used tocreate documents that can be retrieved using the Web.

Is based on SGML.

Can represent simple structureddocuments.

All of the above.

Question17 5 pts

(TCO 7) Base64 _______

Is an encoding scheme for textcontents specified with the MIME protocol.

Is an encoding scheme for textcontents transferred between UNIX systems.

Is an encoding scheme for textcontents transferred between Windows systems

None of the statements is correct.

Question18 5 pts

(TCO 7) Which of the following istrue about persistence?

CGI scripts and Servlets are thesame in terms of persistence.

Servlets instances will run for atleast as long as there is a request issued to them.

CGI scripts will run for at leastas long as there are requests issued to them.

A CGI script is loaded only once.

Question19 5 pts

(TCO 7) Which of the following istrue about methods specified with each servlet object?

init method is invoked when aclient request is forwarded to the servlet.

shutdown method is invoked when aservlet is no longer needed.

service method is invoked when aservlet is initialized.

service method is invoked when aservlet is no longer needed.

Question20 5 pts

(TCO 7) Service discovery protocols________

Allow a service to bederegistered.

Allow a service to be registeredand located.

Allow a service to be described tothe directory.

Allow a service to be deleted fromthe directory.

Question21 30 pts

(TCO 2 and 4) Write the listenSocketmethod (server-side program)
a – Write the required lines of code that will create a ServerSocket objectwith a port number 1024 on which the server program is going to listen forclient communications.

b – Write the required lines of code that will create a new socket object.

c – Write the required lines of code that will read the data sent over the socketconnection from the client program.

Copy the above code into the method below:
public void listenSocket(){
// PART A

//PART B

// PART C

}

Question 22 30 pts

(TCO 2 and 4) Write the listenSocketmethod (client-side program) with the hostname mydevry1 and port number 1024.Write it to send the data over the socket connection to the server and read thetext sent by the server back to the client.

Tags: java coding Distruibuted Programing

final_questions.docx

Unformatted Attachment Preview

Question 1 5 pts(TCO 4) What is a packet?A unit of data transmitted over the network.A key protocol at the transport layer of the Internet architecture.A text-based, request-response protocol that calls for only one round of exchange of messages.Allows a selected set of programming data types and data structures to be specified with IPCoperations.Question 2 5 pts(TCO 4) Explain datagram socket API.Supports the exchange of continuous units of data.Supports the exchange of discrete units of data.Supports the exchange of continuous and discrete units of data.None of the statements is correct.Question 3 5 pts(TCO 4) What is a connection socket?A type of stream-mode socket API, provided via the ServerSocket class that accepts connections.A type of stream-mode socket API, provided via the Socket class that accepts connections.A type of stream-mode socket API, provided via the ServerSocket class that exchanges data.A type of stream-mode socket API, provided via the Socket class that exchanges data.Question 4 5 pts(TCO 4) What is the difference between the ServerSocket class and the Socket class?The ServerSocket class is for the transfer of data and the Socket class is for the establishment ofconnections.The ServerSocket class is for the establishment of connections and the Socket class is for thetransfer of data.The ServerSocket class utilizes data sockets while the Socket class utilizes connection sockets.The ServerSocket class utilizes connection sockets, but the Socket class doesn’t utilize any socket.Question 5 5 pts(TCO 4) What is the Java Secure Socket Extension (JSSE)?A socket API that provides nonblocking I/O operations.A process that wishes to communicate with the server.A set of Java packages that enable secure Internet communications.A stream-mode socket API that enables secure Internet communications.Question 6 5 pts(TCO 5) What are the differences between client processes and server processes?Client processes run on a network-connected computer and a server process access the server toobtain a network service.Client processes access the server to obtain a network service and a server process runs on anetwork-connected computer.Client processes run on a network-connected computer called a server host.A server process accesses the server to obtain a network service called a server host.Question 7 5 pts(TCO 5) What is a request-response pattern?A single interaction between the server and client.The interaction of processes within the client-server model.A term used for a void function.A process that makes use of a single central processing unit to execute one or more programs foreach application.Question 8 5 pts(TCO 5) What is a stub?A method defined with minimal code to allow the program to compile and run initially.A class that contains the necessary methods for stream-mode IPC.A code that uses the stream-mode socket API to accept a connection.A separation within the client-side software that allows modifications to be made to the logic at onelayer without requiring changes to be made at the other layers.Question 9 5 pts(TCO 5) What is an iterative server?Services one client at a time.Has a limited server for exchanging data.Both a & b.None of the statements is correct.Question 10 5 pts(TCO 5) What is a stateful server?A server that must maintain some state information in order to provide its service.A server that sometimes should maintain some state information in order to provide its service.A server that provides a service according to a stateless protocol.None of the statements is correct.Question 11 5 pts(TCO 6) What is the state?Data of the entity.Data is contained in the instance variables of each object.Both a & b.None of the statement is correct.Question 12 5 pts(TCO 6) What are remote methods?Methods of local object.Methods belonging to a local object.Methods belonging to any object.Methods of a distributed object.Question 13 5 pts(TCO 6) Which of the following is true about procedural programming?Postdates object-oriented programming.A function is not a control structure.A procedure is a control structure that provides the abstraction for an action.The action of a function is invoked by a variable.Question 14 5 pts(TCO 6) A skeleton layer _____Interacts with the stub layer on the client side.Interacts with the stub layer on the server side.Interacts with the other layers on the client side.Interacts with the other layers on the server side.Question 15 5 pts(TCO 6) Which of the following is true about the Remote interface?The RMI API is the starting point of creating a local objectThe RMI API is the starting point of creating a distributed object.A Java interface is not a class but a complex method.A Java interface contains the implementations of the method.Question 16 5 pts(TCO 7) Hypertext Markup Language (HTML) ________Is a markup language used to create documents that can be retrieved using the Web.Is based on SGML.Can represent simple structured documents.All of the above.Question 17 5 pts(TCO 7) Base64 _______Is an encoding scheme for text contents specified with the MIME protocol.Is an encoding scheme for text contents transferred between UNIX systems.Is an encoding scheme for text contents transferred between Windows systemsNone of the statements is correct.Question 18 5 pts(TCO 7) Which of the following is true about persistence?CGI scripts and Servlets are the same in terms of persistence.Servlets instances will run for at least as long as there is a request issued to them.CGI scripts will run for at least as long as there are requests issued to them.A CGI script is loaded only once.Question 19 5 pts(TCO 7) Which of the following is true about methods specified with each servlet object?init method is invoked when a client request is forwarded to the servlet.shutdown method is invoked when a servlet is no longer needed.service method is invoked when a servlet is initialized.service method is invoked when a servlet is no longer needed.Question 20 5 pts(TCO 7) Service discovery protocols ________Allow a service to be deregistered.Allow a service to be registered and located.Allow a service to be described to the directory.Allow a service to be deleted from the directory.Question 21 30 pts(TCO 2 and 4) Write the listenSocket method (server-side program)a – Write the required lines of code that will create a ServerSocket object with a port number 1024 onwhich the server program is going to listen for client communications.b – Write the required lines of code that will create a new socket object.c – Write the required lines of code that will read the data sent over the socket connection from the clientprogram.Copy the above code into the method below:public void listenSocket(){// PART A//PART B// PART C}Question 22 30 pts(TCO 2 and 4) Write the listenSocket method (client-side program) with the hostname mydevry1 and portnumber 1024. Write it to send the data over the socket connection to the server and read the text sent bythe server back to the client.Question 23 30 pts(TCO 1) Complete the following Java Applet program that will calculate the circumference of a circle.(hint: circumference = 2 * radius * pi)import java.awt.*;import java.awt.event.*;import javax.swing.*;public class Circle {JLabel circum;JTextField radius;JButton calculate;public void init() {JPanel panel = new JPanel(new GridLayout(4,2));panel.add(new JLabel(“Radius:”));radius = new JTextField();panel.add(radius);panel.add(new JLabel(“Circumference:”));circum = new JLabel();panel.add(circum);calculate = new JButton(“Calculate”);panel.add(calculate);calculate.addActionListener(this);getContentPane().add(panel);}public void actionPerformed(ActionEvent arg0) {}}Question 24 30 pts(TCO 6 and 7)a – Create a new cookie with the following information:Name: userAccountValue: uAcc987654b – Add the above cookie to the response header.c – Retrieve the value of the above cookie from the list of all available cookies.Question 25 30 pts(TCO 3,8) Write a program that will create two threads and will print out the following information:o Thread 1:XYo Thread 2:1020…
Purchase answer to see fullattachment

Studypool values your privacy. Only questions posted as Public are visible on our website.

Question 1 5 pts (TCO 4) What is a packet? A unit of data transmitted over the network. A key protocol at the transport layer of the Internet architecture. A text-based, request-response protocol that calls for only one round of exchange of messages. Allows a selected set of programming data types and data structures to be specified with IPC operations. Question 2 5 pts (TCO 4) Explain datagram socket API. Supports the exchange of continuous units of data. Supports the exchange of discrete units of data. Supports the exchange of continuous and discrete units of data. None of the statements is correct. Question 3 5 pts (TCO 4) What is a connection socket? A type of stream-mode socket API, provided via the ServerSocket class that accepts connections. A type of stream-mode socket API, provided via the Socket class that accepts connections. A type of stream-mode socket API, provided via the ServerSocket class that exchanges data. A type of stream-mode socket API, provided via the Socket class that exchanges data. Question 4 5 pts (TCO 4) What is the difference between the ServerSocket class and the Socket class? The ServerSocket class is for the transfer of data and the Socket class is for the establishment of connections. The ServerSocket class is for the establishment of connections and the Socket class is for the transfer of data. The ServerSocket class utilizes data sockets while the Socket class utilizes connection sockets. The ServerSocket class utilizes connection sockets, but the Socket class doesn’t utilize any socket. Question 5 5 pts (TCO 4) What is the Java Secure Socket Extension (JSSE)? A socket API that provides nonblocking I/O operations. A process that wishes to communicate with the server. A set of Java packages that enable secure Internet communications. A stream-mode socket API that enables secure Internet communications. Question 6 5 pts (TCO 5) What are the differences between client processes and server processes? Client processes run on a network-connected computer and a server process access the server to obtain a network service. Client processes access the server to obtain a network service and a server process runs on a network-connected computer. Client processes run on a network-connected computer called a server host. A server process accesses the server to obtain a network service called a server host. Question 7 5 pts (TCO 5) What is a request-response pattern? A single interaction between the server and client. The interaction of processes within the client-server model. A term used for a void function. A process that makes use of a single central processing unit to execute one or more programs for each application. Question 8 5 pts (TCO 5) What is a stub? A method defined with minimal code to allow the program to compile and run initially. A class that contains the necessary methods for stream-mode IPC. A code that uses the stream-mode socket API to accept a connection. A separation within the client-side software that allows modifications to be made to the logic at one layer without requiring changes to be made at the other layers. Question 9 5 pts (TCO 5) What is an iterative server? Services one client at a time. Has a limited server for exchanging data. Both a & b. None of the statements is correct. Question 10 5 pts (TCO 5) What is a stateful server? A server that must maintain some state information in order to provide its service. A server that sometimes should maintain some state information in order to provide its service. A server that provides a service according to a stateless protocol. None of the statements is correct. Question 11 5 pts (TCO 6) What is the state? Data of the entity. Data is contained in the instance variables of each object. Both a & b. None of the statement is correct. Question 12 5 pts (TCO 6) What are remote methods? Methods of local object. Methods belonging to a local object. Methods belonging to any object. Methods of a distributed object. Question 13 5 pts (TCO 6) Which of the following is true about procedural programming? Postdates object-oriented programming. A function is not a control structure. A procedure is a control structure that provides the abstraction for an action. The action of a function is invoked by a variable. Question 14 5 pts (TCO 6) A skeleton layer _____ Interacts with the stub layer on the client side. Interacts with the stub layer on the server side. Interacts with the other layers on the client side. Interacts with the other layers on the server side. Question 15 5 pts (TCO 6) Which of the following is true about the Remote interface? The RMI API is the starting point of creating a local object The RMI API is the starting point of creating a distributed object. A Java interface is not a class but a complex method. A Java interface contains the implementations of the method. Question 16 5 pts (TCO 7) Hypertext Markup Language (HTML) ________ Is a markup language used to create documents that can be retrieved using the Web. Is based on SGML. Can represent simple structured documents. All of the above. Question 17 5 pts (TCO 7) Base64 _______ Is an encoding scheme for text contents specified with the MIME protocol. Is an encoding scheme for text contents transferred between UNIX systems. Is an encoding scheme for text contents transferred between Windows systems None of the statements is correct. Question 18 5 pts (TCO 7) Which of the following is true about persistence? CGI scripts and Servlets are the same in terms of persistence. Servlets instances will run for at least as long as there is a request issued to them. CGI scripts will run for at least as long as there are requests issued to them. A CGI script is loaded only once. Question 19 5 pts (TCO 7) Which of the following is true about methods specified with each servlet object? init method is invoked when a client request is forwarded to the servlet. shutdown method is invoked when a servlet is no longer needed. service method is invoked when a servlet is initialized. service method is invoked when a servlet is no longer needed. Question 20 5 pts (TCO 7) Service discovery protocols ________ Allow a service to be deregistered. Allow a service to be registered and located. Allow a service to be described to the directory. Allow a service to be deleted from the directory. Question 21 30 pts (TCO 2 and 4) Write the listenSocket method (server-side program) a – Write the required lines of code that will create a ServerSocket object with a port number 1024 on which the server program is going to listen for client communications. b – Write the required lines of code that will create a new socket object. c – Write the required lines of code that will read the data sent over the socket connection from the client program. Copy the above code into the method below: public void listenSocket(){ // PART A //PART B // PART C } Question 22 30 pts (TCO 2 and 4) Write the listenSocket method (client-side program) with the hostname mydevry1 and port number 1024. Write it to send the data over the socket connection to the server and read the text sent by the server back to the client.