Answer:
public static boolean beginsWithZ(String word){
if(string == null || string.length() == 0)
return 0;
if(word.charAt(0) == 'Z' || word.charAt(0) == 'z')
return 1;
else
return 0;
}
Explanation:
This method is a boolean method, meaning it returns true if the string begins with Z or z and false otherwise. So:
The Java command charAt() let's you find the character at each position of the string, so i use it.
public static boolean beginsWithZ(String word){
if(string == null || string.length() == 0)
return 0;
if(word.charAt(0) == 'Z' || word.charAt(0) == 'z')
return 1;
else
return 0;
}
Answer:
a. 118.20.210.254
Explanation:
Here are the few characteristics of Class A:
First bit of the first octet of class A is 0.
This class has 8 bits for network and 24 bits for hosts.
The default sub-net mask for class A IP address is 255.0.0.0
Lets see if the first bit of first octet of 118.20.210.254 address is 0.
118 in binary (8 bits) can be represented as : 1110110
To complete 8 bits add a 0 to the left.
01110110
First bit of the first octet of class A is 0 So this is class A address.
For option b the first octet is : 183 in the form of bits = 10110111 So it is not class A address
For option c the first octet is 215 in the form of bits = 11010111 So it is not class A address
For option d the first octet is 255 in the form of bits = 11111111. The first bit of first octet is not 0 so it is also not class A address.
A computer system designed to run games is called a game console.
~frestoripongetosarangeou