Write a program that removes all non-alpha characters from the given input. Ex: If the input is: -Hello, 1 world$! the output is: HelloworldAlso, this needs to be answered by 11:59 tonight.

Answers

Answer 1
Answer:

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


Related Questions

Many organizations have policies that require users to: a. retain their passwords for a minimum of 30 days. b. include at least three consecutive letters of part of their name in their passwords. c. change their passwords on a regular basis. d. share their passwords with the administrator.
Does the following code return a string or a number def of() return 3
what are "open source" programming language? Give examples of open source languages. Discuss the pros and cons of open source language.
g Write a line of code to invoke a function named RandNum, which accepts no parameters, and storing the return value in a variable called num (which has already been defined). Separate each item with 1 space (except around the parentheses), and end the line with a semi-colon.
________________________ is an information system that stores user data in many different geographical locations and makes that data available on demand.

An analyst receives an alert from the SIEM showing an IP address that does not belong to the assigned network can be seen sending packets to the wrong gateway. Which of the following network devices is misconfigured and which of the following should be done to remediate the issue? A. Firewall; implement an ACL on the interface B. Router; place the correct subnet on the interface C. Switch; modify the access port to trunk port D. Proxy; add the correct transparent interface

Answers

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.

File Letter Counter Write a program that asks the user to enter the name of a file, and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the file. Use Notepad or another text editor to create a sample file that can be used to test the program.

Answers

Answer:

The solution code is written in Python.

  1. fileName = input("Enter file name: ")
  2. target = input("Enter target character: ")
  3. with open(fileName, "r")as reader:
  4.    content = reader.read()
  5.    print(content.count(target))

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)

On a roulette wheel, the pockets are numbered from 0 to 36. The colors of the pockets are as follows: Pocket 0 is green. For pockets 1 through 10, the odd-numbered pockets are red and the even-numbered pockets are black. For pockets 11 through 18, the odd-numbered pockets are black and the even-numbered pockets are red. For pockets 19 through 28, the odd-numbered pockets are red and the even-numbered pockets are black. For pockets 29 through 36, the odd-numbered pockets are black and the even-numbered pockets are red. Write a program that asks the user to enter a pocket number and displays whether the pocket is green, red, or black. The program should display an error message if the user enters a number that is outside the range of 0 through 36.

Answers

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")

Which exercise can help you prevent Carpel Tunnel Syndrome?make a fist, hold, and stretch your fingers

bend slightly and stretch your right hand up

move your head back and forward slowly

blink your eyes often

Answers

Make a Fist, hold, and stretch your fingers is the correct answer
A. make a fist, hold, and stretch your fingers

C And D are rather absurd as Carpal Tunnel Syndrome is 
caused by a pinched nerve in the wrist.

In the 2018-2019 softball season, Allison hit the ball 28 out of 67 times, this included fouls. What was her percentageof misses?

Answers

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%

Language: JavaYour task is to complete the logic to manage a twenty-four-hour clock (no dates, just time) that tracks
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)
{
}

Answers

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.

Writting the code:

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