Answer:
from socket import *
hostname = input('Enter the host to be scanned: ')
ip_add = gethostbyname(hostname)
connections = [ ]
for i in range(133, 136):
s = socket(AF_INET, SOCK_STREAM)
conn = s.connect_ex((ip_add, i))
print(conn)
connections.append(conn)
if 0 in connections:
print ('Host is online')
s.close()
else:
print ('system is unreachable')
Explanation:
The python source code above scans for all the available range of ports in the provided hostname, if any port is available, the host is online else the program print the error message "system is unreachable.
Answer:
import java.util.Scanner;
public class DashLine {
public static void main(String[] args) {
// Declaring variables
int n;
/*
* Creating an Scanner class object which is used to get the inputs
* entered by the user
*/
Scanner sc = new Scanner(System.in);
// Getting the input entered by the user
System.out.print("Enter a number :");
n = sc.nextInt();
// calling the method by passing the user entered input as argument
dashedLine(n);
}
//This method will print the dashed line for number greater than zer
private static void dashedLine(int n) {
if (n > 0) {
for (int i = 1; i <= n; i++) {
System.out.print("-");
}
System.out.println();
}
}
}
Explanation:
Answer:
7 raise to power 10
Explanation:
Since there are 4 possible ways to make memory chip and 3 possible ways to manufacture mother board, so for each machines we have 7 possible ways of configurations.
So total number of ways in which these machines can be configured is 7*7*7*...*7= 7raise to power 10 possible ways
Answer: A method
Explanation:
The show Dialog is the type of method that is used by the file-dialog object for displaying itself. The main purpose of show-dialog is that it runs the common dialog box in the system with the default owner. It is basically inherited from the common-dialog.
The show-dialog is the type of method that displays the dialog box for defining the file extension filter and the various dialog behavior in the system.
D that is the answer but I need 20 words to send this text