Answer:
Explanation:
The following code is written in Python. It is a function that takes in a string as a parameter, loops through the string and checks if each character is an alpha char. If it is, then it adds it to an output variable and when it is done looping it prints the output variable. A test case has been provided and the output can be seen in the attached image below.
def checkLetters(str):
output = ''
for char in str:
if char.isalpha() == True:
output += char
return output
Answer: (A) Firewall; implement an ACL on the interface
Explanation:
According to the question, for re-mediate the issue firewall should be implemented the ACL (Access control list) on the given interface. The access control list is one of the type of logic which selectively give permission or deny the number of packet in the system which to through the interface.
Firewall is the type of device that basically examine the traffic in the network system and also make several decisions in the system. ACL is the set of rule which mainly define the route of the packet in the router interface state.
Answer:
The solution code is written in Python.
Explanation:
Firstly, use input() function to prompt user for a file name. (Line 1)
Next, we use input() function again to prompt user input a target character (Line 2)
Create a reader object and user read() method to copy entire texts from to the variable content (Line 4 - 5).
At last we can get the number of times the specified character appears in the file using the Python string built-in method count() (Line 6)
Answer:
pkt = int(input("Pocket Number: "))
if pkt == 0:
print("Green")
elif pkt >= 1 and pkt <=10:
if pkt%2 == 0:
print("Black")
else:
print("Red")
elif pkt >= 11 and pkt <=18:
if pkt%2 == 0:
print("Red")
else:
print("Black")
elif pkt >= 19 and pkt <=28:
if pkt%2 == 0:
print("Black")
else:
print("Red")
elif pkt >= 29 and pkt <=36:
if pkt%2 == 0:
print("Red")
else:
print("Black")
else:
print("Error")
Explanation:
The program was written in Python and the line by line explanation is as follows;
This prompts user for pocket number
pkt = int(input("Pocket Number: "))
This prints green if the pocket number is 0
if pkt == 0:
print("Green")
If pocket number is between 1 and 10 (inclusive)
elif pkt >= 1 and pkt <=10:
This prints black if packet number is even
if pkt%2 == 0:
print("Black")
Prints red, if otherwise
else:
print("Red")
If pocket number is between 11 and 18 (inclusive)
elif pkt >= 11 and pkt <=18:
This prints red if packet number is even
if pkt%2 == 0:
print("Red")
Prints black, if otherwise
else:
print("Black")
If pocket number is between 19 and 28 (inclusive)
elif pkt >= 19 and pkt <=28:
This prints black if packet number is even
if pkt%2 == 0:
print("Black")
Prints red, if otherwise
else:
print("Red")
If pocket number is between 29 and 36 (inclusive)
elif pkt >= 29 and pkt <=36:
This prints red if packet number is even
if pkt%2 == 0:
print("Red")
Prints black, if otherwise
else:
print("Black")
Prints error if input is out of range
else:
print("Error")
bend slightly and stretch your right hand up
move your head back and forward slowly
blink your eyes often
Answer:
Allison missed 58.21% of the times.
Explanation:
The first step is to divide 28 by 67 to get the answer in decimal form:
28 / 67 = 0.4179
Then, we multiplied the answer from the first step by one hundred to get the answer as a percentage:
0.4179 * 100 = 41.79%
Then 100(%) - 41.79(%) = 58.21%
the hours, minutes, and sections, and various operations to adjust the time. The framework for your
clock is in the Time class with the four methods you must complete.
1.) advanceOneSecondâ A user calls this method to advance the clock by one second.
a. When the seconds value reaches 60, it rolls over to zero.
b. When the seconds roll over to zero, the minutes advance.
So 00:00:59 rolls over to 00:01:00.
c. When the minutes reach 60, they roll over and the hours advance.
So 00:59:59 rolls over to 01:00:00.
d. When the hours reach 24, they roll over to zero.
So 23:59:59 rolls over to 00:00:00.
2.) compareTo â The user wants to know if a second time is greater than or less than the time
object called, assuming both are on the same date.
a. Returns -1 if this Time is before otherTime.
b. Returns 0 if this Time is the same as otherTime.
c. Returns 1 if this Time is after otherTime.
3.) add â Adds the hours, minutes, and seconds of another time (the offset) to the current time
object. The time should ârolloverâ if it exceeds the end of a 24 hour period.
4.) subtract â Subtracts the hours, minutes, and seconds of another time (the offset) from
the current time object. The time should âroll backâ if it precedes the beginning of a 24 hour
period.
________________________________________________________________________
package clock;
/**
* Objects of the Time class hold a time value for a
* European-style 24 hour clock.
* The value consists of hours, minutes and seconds.
* The range of the value is 00:00:00 (midnight) to 23:59:59 (one
* second before midnight).
*/
public class Time {
private int hours;
private int minutes;
private int seconds;
/**
* Add one second to the current time.
* When the seconds value reaches 60, it rolls over to zero.
* When the seconds roll over to zero, the minutes advance.
* So 00:00:59 rolls over to 00:01:00.
* When the minutes reach 60, they roll over and the hours advance.
* So 00:59:59 rolls over to 01:00:00.
* When the hours reach 24, they roll over to zero.
* So 23:59:59 rolls over to 00:00:00.
*/
public void advanceOneSecond()
{
}
/**
* Compare this time to otherTime.
* Assumes that both times are in the same day.
* Returns -1 if this Time is before otherTime.
* Returns 0 if this Time is the same as otherTime.
* Returns 1 if this Time is after otherTime.
*/
public int compareTo(Time otherTime)
{
return 0;
}
/**
* Add an offset to this Time.
* Rolls over the hours, minutes and seconds fields when needed.
*/
public void add(Time offset)
{
}
/**
* Subtract an offset from this Time.
* Rolls over (under?) the hours, minutes and seconds fields when needed.
*/
public void subtract(Time offset)
{
}
Using the knowledge in computational language in JAVA it is possible to write a code that user calls this method to advance the clock by one second. When the seconds value reaches 60, it rolls over to zero.
public class Time
{
private int hours;
private int minutes;
private int seconds;
public void advanceOneSecond()
{
seconds++;
if(seconds >= 60)
{
seconds -= 60;
minutes++;
}
if(minutes >= 60)
{
minutes -= 60;
hours++;
}
if(hours >= 24)
hours -= 24;
}
public int compareTo(Time otherTime)
{
if(hours > otherTime.hours)
return 1;
else if(hours < otherTime.hours)
return -1;
else
{
if(minutes > otherTime.minutes)
return 1;
else if(minutes < otherTime.minutes)
return -1;
else
{
if(seconds > otherTime.seconds)
return 1;
else if(seconds < otherTime.seconds)
return -1;
else
return 0;
}
}
}
public void add(Time offset)
{
seconds += offset.seconds;
minutes += offset.minutes;
hours += offset.hours;
if(seconds >= 60)
{
seconds -= 60;
minutes++;
}
if(minutes >= 60)
{
minutes -= 60;
hours++;
}
if(hours >= 24)
hours -= 24;
}
public void subtract(Time offset)
{
if(offset.seconds > seconds)
{
minutes--;
seconds = seconds + 60;
}
seconds -= offset.seconds;
if(offset.minutes > minutes)
{
hours--;
minutes = minutes + 60;
}
minutes -= offset.minutes;
if(offset.hours > hours)
{
hours += 24;
}
hours -= offset.hours;
}
}
See more about JAVA at brainly.com/question/18502436
#SPJ1