Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

need help with this quiz, if you can answer any of these questions it will be gr

ID: 3841659 • Letter: N

Question

need help with this quiz, if you can answer any of these questions it will be greatly appreciated!

1. Explain the difference between what it means to parse an XML document versus what it means to validate an XML document.(This is meant to require a short, 2-3 sentence response.)

2. Explain the relationship between the DocumentBuilder and DocumentBuilderFactory classes in how they are used to parse XML documents.(This is meant to require a short, 1-2 sentence, answer.)

3. XML and its cousin HTML both descended from... which of the following?

a. standard generalized markup language

b. systems markup language

c. none of these

d. extensible markup language

e. hypercard

4. true or false? - Every XML document requires a document type definition, or DTD?

5. Identify the root element of this XML document:

<?xml version="1.0"?>
<!DOCTYPE configuration ...>
<configuration>
<title>
    <font>
      <name>Helvetica</name>
      <size>36</size>
    </font>
</title>
</configuration>

a. DOCTYPE

b. configuration

c. header

d. none of these

e. xml

6.

Match each XML DTD element rule to its proper meaning

Question 6 options:

One of E1, E2, ..., En

0 or 1 occurrences of E

No children allowed

1 or more occurrences of E

0 or more occurrences of E

E1, followed by E2, ..., En

0 or more occurrences of text and E1, E2, ..., En

in any order (mixed content)

Text

Any children allowed

1.

E*

2.

E+

3.

E?

4.

E1|E2|...|En

5.

E1, E2, ..., En

6.

#PCDATA

7.

(#PCDATA|E1|E2|...|En)*

8.

ANY

9.

EMPTY

7. Briefly name and explain the purpose of the first two lines which should be found at the top of an XML document.

8. When a ServerSocket object is instantiated, is it possible to set a timeout value? What behavior does the timeout value control and what happens at runtime when the timeout expires?(This is meant to require a short 2-3 sentence answer.)

9. Please do the following:

Provide a working Java program that:

creates a ServerSocket object bound to TCP port 9786

sets a time out of 10 seconds

prints to standard out "Connection established" when a connection is established

takes any text received over the socket and echoes it back to the client as well as sends a message to standard output of the form "Echo message: [text]"

prints to standard out "Timeout expired" when the time out expires

Include descriptive comments where appropriate to explain what is happening at a high level

To receive full credit, your code must properly compile and then run with these two commands (assuming a Java 7 environment):

javac SocketListener.java

java -cp . SocketListener

10. Moving packets from one machine to another cannot be done with only host names, it must be done with addresses. Describe the high-level/conceptual process for resolving a hostname to an IP address in Java (hint: this can be done with a single method call). Describe, in your own words, why it is not possible to move packets without resolving the addresses of the involved hosts (even if the resolution is handled implicitly by, for example, an object's constructor).

11. Order the steps in a network server event loop

Question 11 options:

1.Gather the information requested by the client.

2. Send a response to the client through the outgoing data stream.

3. Receive a command from the client through an incoming data stream.

4. Decode the client command.

12 Which statements describe the user datagram protocol (UDP)? (can be more than 1)

Question 12 options:

a.

Commonly used for application protocols, like media streaming, which can tolerate dropped packets

b.

Utilizes a three-way handshake for the initial connection setup

c.

It is described as an "unreliable" protocol

d.

The receiver does not confirm receipt of packets to the sender

e.

Uses window scaling to control the number of packets which are sent before a confirmation of receipt is required

13. Explain the concept of a port number in computer networking.

(This question is meant to require a short, 1-2 sentence, answer.)

14. Serialized Java objects are processed with redundancy elimination, while JavaBeans are persisted by storing every property value (even default values)

true or false?

15.

Describe how and why a persistence delegate is used when working with JavaBeans. Describe an example of its use.

(This is meant to require a thorough, 1-2 paragraph, answer.)

16.What is the relationship between a property editor and a customizer when working with a JavaBean?

17.Describe some ways in which JavaBeans support/promote software component reuse.

18.Explain the difference between a commit and a push in Git.

19.

What difference is there, if any, between a class extending Thread and implementing Runnable? Which is better? Why?

(This is meant to require a thorough, 1-2 paragraph, answer.)

20.

Java supports the concept of a static initializer block. It is a class-level construct of the form:

static {

// Java code

}

Describe what triggers the execution of the static initializer block, how often it is executed, and conceptually why a programmer would choose to implement one.

(This is meant to require a thorough, 1-2 paragraph, answer.)

21.

Which of the following are valid visibility levels for classes, methods, and class variables in Java? (can be more than 1)

Question 27 options:

private

encapsulated

public

friend

protected

(no keyword) [package visibility]

transient

One of E1, E2, ..., En

0 or 1 occurrences of E

No children allowed

1 or more occurrences of E

0 or more occurrences of E

E1, followed by E2, ..., En

0 or more occurrences of text and E1, E2, ..., En

in any order (mixed content)

Text

Any children allowed

1.

E*

2.

E+

3.

E?

4.

E1|E2|...|En

5.

E1, E2, ..., En

6.

#PCDATA

7.

(#PCDATA|E1|E2|...|En)*

8.

ANY

9.

EMPTY

Explanation / Answer

1.) parsing an XML document means reading the XML content,or file or can say XML string and fetching its content according to the structure of the programand to use it for runing a program.There are many ways of doing so, like DOM or SAX. You might want to investigate XSLT and xpath as well, according to your needs. a XML parser converts an XML document into a DOM file,where as an XML validation means ,An XML document can be checked for well-formedness purely based on the XML standard(s). You don't need to know anything about the data contained in the XML document and its structure.

------------------

2.) the documentbuilderfactory class  creates a new instance of a DocumentBuilder using the currently configured parameters.it is parsedusing the syntax :

public abstract DocumentBuilder newDocumentBuilder()

3) XML & HTML are descendant from :-

a)standard generalized markup language

------------------

4) Every XML document requires a document type definition, or DTD?

The purpose of a DTD is to define the structure of an XML document.