Answer: HTTP GET
Explanation: There are many HTTP(Hypertext Transfer protocol) requests sent to the server from the client .The page that gets request while the hyperlink page is clicked by the client, opens a HTTP GET page that belongs to the Internet protocol's(IP)suite by server. It is a process for the revival of the data from a particular server. The data does not get effected during the process of the retrieval.
Answer:
The solution code is written in Python:
- def square(num):
- if type(num).__name__ == 'int':
- sq_num = num * num
- return sq_num
- else:
- return "Invalid input"
-
- print(square(5))
- print(square("Test"))
Explanation:
To ensure only certain type of operation can be applied on a input value, we can check the data type of the input value. For example, we define a function and name it as <em>square</em> which take one input number, <em>num </em>(Line 1).
Before the <em>num</em> can be squared, it goes through a validation mechanism in by setting an if condition (Line 2) to check if the data type of the input number is an integer,<em> int.</em> If so, the<em> num </em>will only be squared otherwise it return an error message (Line 6).
We can test our function by passing value of 5 and "Test" string. We will get program output:
25
Invalid input
Answer:
The code to this question can be given as:
Code:
public class Book //define class.
{
private String title, author; //define variable.
Book(String a, String b) //define parameterized constructor.
{
title = a; //holding value.
author = b;
}
public String toString() //string function
{
return title + "\n" + author; //return value.
}
}
Explanation:
In the above java code firstly we declare the class book that name is already given in the question. Then we declare the private variable that datatype is string author and title. Then we declare the parameterized constructor. In the parameterized constructor we use the private variable for hold constructor parameter value. Then we declare the tostring() function in this function we return value of the title and author variable.
Answer:
Answer is:
Client-Server Network
- expensive to set up
- has a central server
- easy to track files
- useful for a large organization
Peer-to-peer Network
- useful for a small organization
- difficult to track files
- inexpensive to set up
- does not have a central server
Explanation:
<em>Client-Server Network is ideal for bigger network set up like offices and companies where there will be a central server involved with several clients to access and connected with the server. This is the normal network set up to companies. While, Peer to peer network is ideal for much smaller network, which consists of only two computers to communicate and share files. This network is normally temporary and inexpensive since in only works with two computers.</em>