5.19 LAB: Countdown until matching digits Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is:

Answers

Answer 1

Answer:

Following are the code to this question:

x = int(input())#defining a variable x for user input value  

if(x>=20 and x<=98):#defining an if block that checks value is in between 20 to 98  

   while(not(x%10==x//10)):#defining while loop that seprate numbers and checks it is not equal  

       print(x)#print value

       x-=1# decrease value by subtracting 1

   print(x)# print value

else:#defining else block  

   print("The input value must lie in 20-98")#print message

Output:

36

36

35

34

33

Explanation:

In the above python program code, a variable x is declared, which is used to input the value from the user end. In the next step, a conditional statement is used in if block, it checks the input value is lie in 20 to 98, and to check its uses and logic date, if it is false it will goto else section in this, it will print a message. If the given value is true, inside if block a while loop is declared, that separately divide the value and check it is identical or not, if it is not identical it will print the value and checks its less value similarly.
Answer 2

The program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical is as follows:

x = int(input("your number should be between 20 to 98: "))

while 20 <= x <= 98:

   print(x, end='\n')

   if x % 11 == 0:

       break

   x -= 1

else:

   print("your number must be between 20 to 98")

Code explanation:

The code is written in python

The first line of code, we store the users input in the variable x.Then while 20 is less than or equal to or less than and equals to the users input, we have to print the x value .If the users input divides 11 without remainder(the digit are the same) then we break the loop. The loop continue as we subtract one from the users valueThe else statement wants us to tell the user to input numbers between 20 to 98

learn more on python code here: https://brainly.com/question/26104476

5.19 LAB: Countdown Until Matching Digits Write A Program That Takes In An Integer In The Range 20-98
5.19 LAB: Countdown Until Matching Digits Write A Program That Takes In An Integer In The Range 20-98

Related Questions

Explain why it is not necessary to create an inbound rule on the internal 192.168.12.10 Windows server so that it can receive the response (ICMP echo reply) from the internal 192.168.12.11 Windows server.

Answers

Answer:

The file and printer sharing (Echo Request - ICMPv4-In) rule option should be listed for all profile.

Explanation:

The main reason why it is not compulsory or obligatory to design an inbound rule on the internal 192.168.12.10 Windows server in other to be able to accept the response (ICMP echo reply) generated from the internal 192.168.12.11 Windows server is that the file and printer sharing (Echo Request - ICMPv4-In) rule option or alternative needed to be listed for all profile.

Inbound rules filter or sieve traffic advancing from the network to the local computer based on the filtering conditions set out in the rule.

in terms of computer what does mie mean​

Answers

Answer:

Microsoft Internet explorer

MIE means:

Microsoft Internet Explorer.

Hope this answers your question! :)

Would you expect all the devices listed in BIOS/UEFI setup to also be listed in Device Manager? Would you expect all devices listed in Device Manager to also be listed in BIOS/UEFI setup?

Answers

Answer:

1. Yes

2. No

Explanation:

1 Note that the term BIOS (Basic input and Output System) refers to instructions that controls a computer device operations. Thus, devices that shows up in BIOS should be in device manager.

2. Not all devices listed in devcie manager of a computer system will be listed in BIOS.

What is industry 4.0 -automation revolution-, what is your opinion about the direction this revolution is taking the industry in, and discuss the fate of unskilled and semi-skilled workers affected by industry 4.0.

Answers

Answer:

Find the explanation below.

Explanation:

1. Industry 4.0 -automation revolution is a term first used in Germany in 2011 to describe the fourth generation of the industrial revolution. It is the incorporation of digitalized procedures that use smart technology that can work in real-time to industrial production. This means that the machines used in production can independently interact between themselves to accomplish tasks that would otherwise have needed human involvement.

2. My opinion regarding this industrial revolution is that it is a welcome development for businesses because it will help them execute projects at faster rates and limit some working expenses.

3. Unskilled and Semi-skilled workers will be badly affected by this revolution because tasks ordinarily performed by them would be mostly taken over by these machines. This means that companies would most likely lay off these workers whose jobs would now be performed by machines. Job regulation agencies would do well to seek ways to intervene for this group of workers. They may also have to improve their skills if they want to remain relevant to their jobs.

The revolution, however, would be favorable for high-skilled workers because they would be needed to perform jobs such as the maintenance and programming of these machines.

You turn on your Windows computer and see the system display POST messages. Then the screen goes blank with no text. Which of the following items could be the source of the problem?
1. The video card
2. The monitor
3. Windows
4. Microsoft word software installed on the system.

Answers

Answer:1)The video card
***HOPE THIS HELP YOU***

A systems analyst attended a week-long workshop on Agile software development. When she returned to her job, she told her boss that agile practices were not worth the time to learn and use on the job. Her view was that it was too academic and idealistic to be useful. Do you agree or disagree?Defend your position.

Answers

Answer:

The answer is "disagree"

Explanation:

The system analyst is responsible, who uses research and methods of solving industrial problems with IT. He or she may act as representatives of change that identify, that process improvements needed design systems for such improvements, or inspire us to use systems.

Analysts testing and diagnosing issues in operating systems for QA applications and the programmer analyst design and write custom software, that satisfy the requirements of their employers or customers. For the system analysis, the analyst uses all types of techniques, which may be old's, that's why we disagree with the analyst.

You are a project manager for Laredo Pioneer's Traveling Rodeo Show. You're heading up a project to promote a new line of souvenirs to be sold at the shows. You are getting ready to write the project management plan and know you need to consider elements such as policies, rules, systems, relationships, and norms in the organization. Which of the following is not true? A These describe the authority level of workers, fair payment practices, communication channels, and the like. B This describes organizational governance framework. C This describes management elements. D This is part of the EEF input to this process.

Answers

Answer:

A. These describe the authority level of workers, fair payment practices, communication channels, and the like.  

Explanation:

As seen in the question above, you have been asked to write the project management plan and know that you need to consider elements such as policies, rules, systems, relationships and standards in the organization. These elements are part of EEF's entry into this process, in addition they are fundamental and indispensable for the description not only of the organizational governance structure, but also describe the management elements that will be adopted and used.

However, there is no way to use them to describe the level of authority of workers, fair payment practices, communication channels and the like, as this is not the function of this.

A systems administrator wants to replace the process of using a CRL to verify certificate validity. Frequent downloads are becoming problematic. Which of the following would BEST suit the administrators needs?
A. OCSP
B. CSR
C. Key escrow
D. CA

Answers

Answer:

A. OCSP

Explanation:

Online Certificate Status Protocol (OCSP) is an Internet Protocol that is used as an alternative for CRL and is used to obtain the revocation status of a digital certificate.

A certificate revocation list (CRL) is a set of digital certificates that have been rendered invalid/revoked by the Certificate Authority (CA) because they can no longer be trusted.

Because an OCSP response uses less data than a CRL, it would be best suited to the administrator's needs.

An organization is struggling to differentiate threats from normal traffic and access to systems. A security engineer has been asked to recommend a system that will aggregate data and provide metrics that will assist in identifying malicious actors or other anomalous activity throughout the environment. Which of the following solutions should the engineer recommend?a. Web application firewall b. SIEM c. IPS d. UTM e. File integrity monitor

Answers

Answer:

b. SIEM.

Explanation:

In this scenario, an organization is struggling to differentiate threats from normal traffic and access to systems. A security engineer has been asked to recommend a system that will aggregate data and provide metrics that will assist in identifying malicious actors or other anomalous activity throughout the environment. The solution the engineer should recommend is the Security information and event management (SIEM).

Security information and event management is an enterprise software that provides a holistic view and analyzes activity from various resources across an entire information technology (IT) infrastructure.

The SIEM is used to aggregate important data from multiple source such as servers, routers, firewall, switches, domain controllers, antivirus software and analyzes the data to detect any threat, deviation from the norm, as well as investigate in order to take appropriate actions. Some examples of the SIEM system are IBM QRadar, Splunk, LogRhythm etc.

Write an application that calculates and displays the amount of money a user would have if his or her money could be invested at 5 percent interest for one year. Create a method that prompts the user for the starting value of the investment and returns it to the calling program. Call a separate method to do the calculation, and return the result to be displayed. Save the program as Interest.java.

Answers

Answer:

Following are the program to this question:

import java.util.*;//import package for user input

class Interest //defining class Interest

{

   static double rate_of_interest = 5.00;//defining static double varaibale  

   public static double Invest_value()//defining method Invest_value

   {

           double invest;//defining double variable invest

           Scanner inc = new Scanner(System.in);//creating Scanner class object  

           System.out.print("Enter investment value: ");

           invest = inc.nextDouble();//input value in invest variable

           return invest;//return invest value

  }

  public static double calculated_Amount(double invest)//defining method calculated_Amount that accept parameter

  {

           double amount;//defining double variable

           amount = invest+ (invest * (rate_of_interest/100));//use amount to calculat 5 % of invest value

           return amount;//return amount value

  }

   

   public static void main(String[] as)//defining main method

   {

   double investment_value;//defining double variable

   investment_value= Invest_value();//use investment_value to hold method Invest_value value

   System.out.println("The 5% of the invest value: "+ calculated_Amount(investment_value));//use print method to print calculated_Amount value

  }

}

Output:

Enter investment value: 3000

The 5% of the invest value: 3150.0

Explanation:

In the above program a class "Interest", is defined inside the class a static double variable "rate_of_interest"  is declared that store a double value, in the next step, two methods "Invest_value and calculated_Amount" is declared.

In the "Invest_value" method, scanner class object is created for input value in the "invest" variable and the "calculated_Amount" accepts an "invest" value in its parameter and calculate its 5% and store its value in the "amount" variable.

Inside the main method, the "investment_value" is declared that holds the "Invest_value"  method value and pass the value in the "investment_value" variable in the "calculated_Amount" method and prints its return value.

The conversion of symbolic op codes such as LOAD, ADD, and SUBTRACT to binary makes use of a structure called the ____.

Answers

Answer:

Op code table.

Explanation:

In Computer programming, an Op code is the short term for operational code and it is the single instruction which can be executed by the central processing unit (CPU) of a computer.

The conversion of symbolic op codes such as LOAD, ADD, and SUBTRACT to binary makes use of a structure called the Op code table. The Op code can be defined as a visual representation of the entire operational codes contained in a set of executable instructions.

An Op code table is arranged in rows and columns which basically represents an upper or lower nibble and when combined depicts the full byte of the operational code. Each cells in the Op code table are labeled from 0-F for the rows and columns; when combined it forms values ranging from 00-FF which contains information about CPU cycle counts and instruction code parameters.

Hence, if the operational code table is created and sorted alphabetically, the binary search algorithm can be used to find an operational code to be executed by the central processing unit (CPU).

What will be displayed if code corresponding to the following pseudocode is executed? Set Number = 4 Repeat Write 2 * Number Set Number = Number + 2 Until Number = 8

Answers

Answer:

8

12

Explanation:

I made the code a bit easier to understand then worked out how it would go. Here's what I did.

number = 4

repeat until number = 8:

   write 2 * number

   number = number + 2

Following this itenary, we have, the system first writes "8" as it multipled 4 by 2. Number is now equal to 6.

Next repetition, the system writes "12" as it multipled 6 by 2. Now, number = 8. The proccess now stops as number is now equal to 8.

Open up your database administraton GUI, and use the appropriate SQL Query Tool to write the SQL CREATE statement for your BOOK_TAGS table. You can either write the script manually and execute it through pgAdmin or you can create the table by using pgAdmin's wizard.
Afterwards, insert one row of dummy data that adds a tag to the sample book in the BOOKS table.

Answers

Answer:

nxlskshwhhwwlqlqoejebx znznxjslaa

what is the difference between ram and rom​

Answers

Answer:

RAM is used to store programs and data the CPU needs. ROM has prerecorded data and is used to boot the computer

Explanation:

How many times will the while loop that follows be executed? var months = 5; var i = 1; while (i < months) { futureValue = futureValue * (1 + monthlyInterestRate); i = i+1; }

Answers

Answer:

4 times

Explanation:

It will be executed for values 1,2,3 and 4 for i.

A brand of shame .. from infancy " is a brand on Jocasta​

Answers

Answer: DIDN'T UNDERSTAND

Start with the following Python code. alphabet = "abcdefghijklmnopqrstuvwxyz" test_dups = ["zzz","dog","bookkeeper","subdermatoglyphic","subdermatoglyphics"] test_miss = ["zzz","subdermatoglyphic","the quick brown fox jumps over the lazy dog"] # From Section 11.2 of: # Downey, A. (2015). Think Python: How to think like a computer scientist. Needham, Massachusetts: Green Tree Press. def histogram(s): d = dict() for c in s: if c not in d: d[c] = 1 else: d[c] += 1 return d Copy the code above into your program but write all the other code for this assignment yourself. Do not copy any code from another source. Part 1 Write a function called has_duplicates that takes a string parameter and returns True if the string has any repeated characters. Otherwise, it should return False. Implement has_duplicates by creating a histogram using the histogram function above. Do not use any of the implementations of has_duplicates that are given in your textbook. Instead, your implementation should use the counts in the histogram to decide if there are any duplicates. Write a loop over the strings in the provided test_dups list. Print each string in the list and whether or not it has any duplicates based on the return value of has_duplicates for that string. For example, the output for "aaa" and "abc" would be the following. aaa has duplicates abc has no duplicates Print a line like one of the above for each of the strings in test_dups. Part 2 Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alphabet that are not in the argument string. The letters in the returned string should be in alphabetical order. Your implementation should use a histogram from the histogram function. It should also use the global variable alphabet. It should use this global variable directly, not through an argument or a local copy. It should loop over the letters in alphabet to determine which are missing from the input parameter. The function missing_letters should combine the list of missing letters into a string and return that string. Write a loop over the strings in list test_miss and call missing_letters with each string. Print a line for each string listing the missing letters. For example, for the string "aaa", the output should be the following. aaa is missing letters bcdefghijklmnopqrstuvwxyz If the string has all the letters in alphabet, the output should say it uses all the letters. For example, the output for the string alphabet itself would be the following. abcdefghijklmnopqrstuvwxyz uses all the letters Print a line like one of the above for each of the strings in test_miss. Submit your Python program. It should include the following. The provided code for alphabet, test_dups, test_miss, and histogram. Your implementation of the has_duplicates function. A loop that outputs duplicate information for each string in test_dups. Your implementation of the missing_letters function. A loop that outputs missing letters for each string in test_miss. Also submit the output from running your program. Your submission will be assessed using the following Aspects. Does the program include a function called has_duplicates that takes a string parameter and returns a boolean? Does the has_duplicates function call the histogram function? Does the program include a loop over the strings in test_dups that calls has_duplicate on each string? Does the program correctly identify whether each string in test_dups has duplicates? Does the program include a function called missing_letters that takes a string parameter and returns a string parameter? Does the missing_letters function call the histogram function? Does the missing_letters function use the alphabet global variable directly? Does the program include a loop over the strings in test_miss that calls missing_letters on each string? Does the program correctly identify the missing letters for each string in test_miss, including each string that "uses all the letters"?

Answers

Answer:

alphabet = "abcdefghijklmnopqrstuvwxyz"

test_dups = ["zzz","dog","bookkeeper","subdermatoglyphic","subdermatoglyphics"]

test_miss = ["zzz","subdermatoglyphic","the quick brown fox jumps over the lazy dog"]

# From Section 11.2 of: # Downey, A. (2015). Think Python: How to think like a computer scientist. Needham, Massachusetts: Green Tree Press.

def histogram(s):

   d = dict()

   for c in s:

       if c not in d:

           d[c] = 1

       else:

           d[c] += 1

   return d

#Part 1 Write a function called has_duplicates that takes a string parameter and returns True if the string has any repeated characters. Otherwise, it should return False.

def has_duplicates(stringP):

   dic = histogram(stringP)

   for key,value in dic.items():

       if value>1:

           return True

   return False

# Implement has_duplicates by creating a histogram using the histogram function above. Write a loop over the strings in the provided test_dups list.

# Print each string in the list and whether or not it has any duplicates based on the return value of has_duplicates for that string.

# For example, the output for "aaa" and "abc" would be the following. aaa has duplicates abc has no duplicates Print a line like one of the above for each of the strings in test_dups.

print("***Implementation of has_duplicates fuction***")

for sTr in test_dups:

   if has_duplicates(sTr):

       print(sTr+": has duplicates")

   else:

       print(sTr+": has no duplicates")

#Part 2 Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alphabet that are not in the argument string.

#The letters in the returned string should be in alphabetical order. Your implementation should use a histogram from the histogram function. It should also use the global variable alphabet.

#It should use this global variable directly, not through an argument or a local copy. It should loop over the letters in alphabet to determine which are missing from the input parameter.

#The function missing_letters should combine the list of missing letters into a string and return that string.

def missing_letters(sTr):

   missingLettersList = []

   dic = histogram(sTr)

   for l in alphabet:

       if l not in dic:

           missingLettersList.append(l)

   missingLettersList.sort()

   return "".join(missingLettersList)

#Write a loop over the strings in list test_miss and call missing_letters with each string. Print a line for each string listing the missing letters.

#For example, for the string "aaa", the output should be the following. aaa is missing letters bcdefghijklmnopqrstuvwxyz

#If the string has all the letters in alphabet, the output should say it uses all the letters.

#For example, the output for the string alphabet itself would be the following. abcdefghijklmnopqrstuvwxyz uses all the letters

#Print a line like one of the above for each of the strings in test_miss.

print("\n***Implementation of missing_letters fuction***")

for lTm in test_miss:

   sTr = missing_letters(lTm.replace(" ",""))

   if sTr!="":

       print(lTm+" is missing letters "+sTr)

   else:

       print(lTm +" uses all the letters")

What can you do using the start menu in windows 10

Answers

Answer:

The start menu in windows 10 has similarities.

Explanation:The windows 10 is start menu and start screen. Installed windows 10 on a PC, the start button after windows appear start menu.Windows app you can access windows apps right the menu. click the left display all apps installed your personal computer. click right to open a window app NEWS,MAIL, or CALENDAR. POWER button at the bottom of the left side, and display the to shut down and restart.

Right click your account name at the top the menu.You add files explorer to taskbar.Simply click the option you needed

We will pass in a value N. Write a program that outputs the complete Fibonacci sequence for N iterations. Important: If N is 0, then we expect to get an output of 0. If N=1 then we expect 0, 1 etc.

Answers

Answer:

The program written in Python is as follows

def fibonac(N):

    series = ""

    for i in range(0,N+1):

         series = series + str(i) + ","

   return series[:-1]

N = int(input("Number: "))

print(fibonac(N))

Explanation:

This line defines the function fibonac

def fibonac(N):

This line initializes variable "series" to an empty string

    series = ""

This line iterates through the passed argument, N

    for i in range(0,N+1):

This line determines the Fibonacci sequence

         series = series + str(i) + ","

Lastly, this line returns the Fibonacci sequence

   return series[:-1]

The main starts here

The firs line prompts user for input

N = int(input("Number: "))

This line prints the Fibonacci sequence

print(fibonac(N))

Write a program that extracts the last three items in the list sports and assigns it to the variable last. Make sure to write your code so that it works no matter how many items are in the list

Answers

Answer:

sports = ["football", "basketball", "volleyball", "baseball", "swimming"]

last = sports[-3:]

print(last)

Explanation:

*The code is in Python.

Create a list called sports

Create a variable called last and set it to the last three elements of the sports list using slicing

Print the last

what is the difference between head header and heading in HTML​

Answers

Answer:

<Head>the appears the "<body>" of a web page.

<Heading> the appears the body of the web page.

Explanation:<Head> it contains that provides the information about web page.

<Heading> it contains such as the title,date, summary.

<Heading> are the<h1>,<h2>,tags

it provides the title and subtitles of the web page.

<Heading>

</Heading>

Head is element is metadata.

Heading is element is actual element.

Answer:

Head>the appears the "<body>" of a web page.

<Heading> the appears the body of the web page.

Explanation:

A printer is connected locally on Computer1 and is shared on the network. Computer2 installs the shared printer and connects to it. Computer1 considers the printer to be a(n) ________________ printer, and Computer2 considers the printer to be a(n) ________________ printer.

Answers

Answer:

A printer is connected locally on Computer1 and is shared on the network. Computer2 installs the shared printer and connects to it. Computer1 considers the printer to be a(n) _____local___________ printer, and Computer2 considers the printer to be a(n) _____network___________ printer.

Explanation:

Any printer installed directly to Computer 1 is a local printer.  If this printer is then shared with computers 2 and 3 in a particular networked environment, it becomes a shared printer.  For these other computers 2 and 3, the shared printer is a network printer, because it is not locally installed in each of them.  There may be some features which network computers cannot use on a shared printer, especially if the printer can scan documents.

Volume of Pyramid = A*h/3 where A is the area of the base of the pyramid and h is the height of the pyramid. Write a C++ program that asks the user to enter the necessary information about the pyramid (note that the user would not know the area of the base of the pyramid, you need to ask them for the length of one of the sides of the base and then calculate the area of the base). Using the information the user input, calculate the volume of the pyramid. Next display the results (rounded to two decimal places). Example Output (output will change depending on user input): The area of the base of the pyramid is: 25.00 The height of the pyramid is: 5.00 The volume of the pyramid is: 41.67 *Pseudocode IS required for this program and is worth 1 point. The program IS auto-graded.

Answers

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

   double side, height;

   

   cout<<"Enter the length of one of the sides of the base: ";

   cin>>side;

   cout<<"Enter the height: ";

   cin>>height;

   

   double area = side * side;

   double volume = area * height / 3;

   

   cout<<"The area of the base of the pyramid is: "<<area<<endl;

   cout<<"The height of the pyramid is: "<<height<<endl;

   cout<<"The volume of the pyramid is: "<<fixed<<setprecision(2)<<volume<<endl;

   return 0;

}

Pseudocode:

Declare side, height

Get side

Get height

Set area = side * side

Set volume = area * height / 3

Print area

Print height

Print volume

Explanation:

Include <iomanip> to have two decimal places

Declare the side and height

Ask the user to enter side and height

Calculate the base area, multiply side by side

Calculate the volume using the given formula

Print area, height and volume (use fixed and setprecision(2) to have two decimal places)

Use ____ references when you want different formulas to refer to the same cell.

Answers

Answer:

absolute

Explanation:

Use absolute references when you want different formulas to refer to the same cell.

What are absolute references?

When dragging rows and columns to replicate formulas in Microsoft Excel, absolute references are the cell references you wish to maintain constant. For instance, the value in cell J4 is necessary for each and every cell in column K.

The reference would go from J4 to J5, then J6, and so on if you dragged it along column K. References that are absolute don't alter when copied or filled. To maintain the consistency of a row and/or column, utilize an absolute reference.

By including a dollar sign, a formula designates an absolute reference. The column reference, the row reference, or both may come before it.

Therefore, when you want different formulas to refer to the same cell, use absolute references.

To learn more about absolute references, refer to the link:

https://brainly.com/question/23944876

#SPJ6

The compare_strings function is supposed to compare just the alphanumeric content of two strings, ignoring upper vs lower case and punctuation. But something is not working. Fill in the code to try to find the problems, then fix the problems.

import re
def compare_strings(string1, string2):
#Convert both strings to lowercase
#and remove leading and trailing blanks
string1 = string1.lower().strip()
string2 = string2.lower().strip()

#Ignore punctuation
punctuation = r"[.?!,;:-']"
string1 = re.sub(punctuation, r"", string1)
string2 = re.sub(punctuation, r"", string2)

#DEBUG CODE GOES HERE
print(___)

return string1 == string2

print(compare_strings("Have a Great Day!", "Have a great day?")) # True
print(compare_strings("It's raining again.", "its raining, again")) # True
print(compare_strings("Learn to count: 1, 2, 3.", "Learn to count: one, two, three.")) # False
print(compare_strings("They found some body.", "They found somebody.")) # False

Answers

Answer:

There is a problem in the given code in the following statement:

Problem:

punctuation = r"[.?!,;:-']"

This produces the following error:

Error:

bad character range

Fix:

The hyphen - should be placed at the start or end of punctuation characters. Here the role of hyphen is to determine the range of characters. Another way is to escape the hyphen - using using backslash \ symbol.

So the above statement becomes:

punctuation = r"[-.?!,;:']"  

You can also do this:

punctuation = r"[.?!,;:'-]"  

You can also change this statement as:

punctuation = r"[.?!,;:\-']"

Explanation:

The complete program is as follows. I have added a print statement print('string1:',string1,'\nstring2:',string2) that prints the string1 and string2 followed by return string1 == string2  which either returns true or false. However you can omit this print('string1:',string1,'\nstring2:',string2) statement and the output will just display either true or false

import re  #to use regular expressions

def compare_strings(string1, string2):  #function compare_strings that takes two strings as argument and compares them

   string1 = string1.lower().strip()  # converts the string1 characters to lowercase using lower() method and removes trailing blanks

   string2 = string2.lower().strip()  # converts the string1 characters to lowercase using lower() method and removes trailing blanks

   punctuation = r"[-.?!,;:']"  #regular expression for punctuation characters

   string1 = re.sub(punctuation, r"", string1)  # specifies RE pattern i.e. punctuation in the 1st argument, new string r in 2nd argument, and a string to be handle i.e. string1 in the 3rd argument

   string2 = re.sub(punctuation, r"", string2)  # same as above statement but works on string2 as 3rd argument

   print('string1:',string1,'\nstring2:',string2)  #prints both the strings separated with a new line

   return string1 == string2  # compares strings and returns true if they matched else false

#function calls to test the working of the above function compare_strings

print(compare_strings("Have a Great Day!","Have a great day?")) # True

print(compare_strings("It's raining again.","its raining, again")) # True

print(compare_strings("Learn to count: 1, 2, 3.","Learn to count: one, two, three.")) # False

print(compare_strings("They found some body.","They found somebody.")) # False

The screenshot of the program along with its output is attached.

Following are the modified program to the given question:

Program Explanation:

Import package.Defining a method "compare_strings" that takes two parameters "string1, string2".Inside the method, parameter variables have been used that convert and hold string values into lower case.In the next step, a variable "punctuation" is defined that holds value.After this, a parameter variable is used that calls the sub-method that checks parameter value with punctuation variable value, and at the return keyword is used that check string1 value equal to string2.Outside the method, multiple print method is used calls the method, and prints its value.

Program:

import re #import package

def compare_strings(string1, string2):#defining a method compare_strings that takes two parameters

   string1 = string1.lower().strip()#defining a variable string1 that converts and holds string value into lower case  

   string2 = string2.lower().strip()#defining a variable string1 that converts and holds string value into lower case

   punctuation = r'[^\w\s]'#defining a variable that holds value

   string1 = re.sub(punctuation, '', string1)#using the variable that calls the sub method that checks parameter value with punctuation variable value  

   string2 = re.sub(punctuation, '', string2)#using the variable that calls the sub method that checks parameter value with punctuation variable value  

   return string1 == string2#using return keyword that check string1 value equal to string2

print(compare_strings("Have a Great Day!", "Have a great day?")) # calling method that prints the return value

print(compare_strings("It's raining again.", "its raining, again")) # calling method that prints the return value

print(compare_strings("Learn to count: 1, 2, 3.", "Learn to count: one, two, three.")) # calling method that prints the return value

print(compare_strings("They found some body.", "They found somebody.")) # calling method that prints the return value

Output:

Please find the attached file.

Learn more:

brainly.com/question/21579839

Write Album's PrintSongsShorterThan() to print all the songs from the album shorter than the value of the parameter songDuration. Use Song's PrintSong() to print the songs.
#include
#include
#include
using namespace std;
class Song {
public:
void SetNameAndDuration(string songName, int songDuration) {
name = songName;
duration = songDuration;
}
void PrintSong() const {
cout << name << " - " << duration << endl;
}
string GetName() const { return name; }
int GetDuration() const { return duration; }
private:
string name;
int duration;
};
class Album {
public:
void SetName(string albumName) { name = albumName; }
void InputSongs();
void PrintName() const { cout << name << endl; }
void PrintSongsShorterThan(int songDuration) const;
private:
string name;
vector albumSongs;
};
void Album::InputSongs() {
Song currSong;
string currName;
int currDuration;
cin >> currName;
while (currName != "quit") {
cin >> currDuration;
currSong.SetNameAndDuration(currName, currDuration);
albumSongs.push_back(currSong);
cin >> currName;
}
}
void Album::PrintSongsShorterThan(int songDuration) const {
unsigned int i;
Song currSong;
cout << "Songs shorter than " << songDuration << " seconds:" << endl;
/* Your code goes here */
}
int main() {
Album musicAlbum;
string albumName;
getline(cin, albumName);
musicAlbum.SetName(albumName);
musicAlbum.InputSongs();
musicAlbum.PrintName();
musicAlbum.PrintSongsShorterThan(210);
return 0;
}

Answers

Answer:

Here is the function PrintSongsShorterThan() which prints all the songs from the album shorter than the value of the parameter songDuration.

void Album::PrintSongsShorterThan(int songDuration) const {

unsigned int i;

Song currSong;  

cout << "Songs shorter than " << songDuration << " seconds:" << endl;  

for(int i=0; i<albumSongs.size(); i++){  

currSong = albumSongs.at(i);  

if(currSong.GetDuration()<songDuration){  

currSong.PrintSong();     } } }

Explanation:

I will explain the working of the for loop in the above function.

The loop has a variable i that is initialized to 0. The loop continues to execute until the value of i exceeds the albumSongs vector size. The albumSongs is a Song type vector and vector works just like a dynamic array to store sequences.

At each iteration the for loop checks if the value of i is less than the size of albumSongs. If it is true then the statement inside the loop body execute. The at() is a vector function that is used to return a reference to the element at i-th position in the albumSongs.  So the album song at the i-th index of albumSongs is assigned to the currSong. This currSong works as an instance. Next the if condition checks if that album song's duration is less than the specified value of songDuration. Here the method GetDuration() is used to return the value of duration of the song. If this condition evaluates to true then the printSong method is called using currSong object. The printSong() method has a statement cout << name << " - " << duration << endl;  which prints/displays the name of the song with its duration.

If you see the main() function statement: musicAlbum.PrintSongsShorterThan(210);

The musicAlbum is the Album object to access the PrintSongsShorterThan(210) The value passed to this method is 210 which means this is the value of the songDuration.

As we know that the parameter of PrintSongsShorterThan method is songDuration. So the duration of each song in albumSongs vector is checked by this function and if the song duration is less than 210 then the name of the song along with its duration is displayed on the output screen.

For example if the album name is Anonymous and the songs name along with their duration are:

ABC 400

XYZ 123

CDE 300

GHI 200

KLM 100

Then the above program displays the following output when the user types "quit" after entering the above information.

Anonymous                                                                              

Songs shorter than 210 seconds:                                                                        

XYZ - 123                                                                                                              

GHI - 200                                                                                                              

KLM - 100

Notice that the song name ABC and CDE are not displayed because they exceed the songDuration i.e. 210.

The output is attached.

You should see an error. Let's examine why this error occured by looking at the values in the "Total Pay" column. Use the type function and set total_pay_type to the type of the first item from the "Total Pay" column.

Answers

Answer:

See below

Explanation:

Under this topic of functions, this question has been precisely answered in a word file and attached as an image herewith (in proper format). Visualizations and CEO incomes are some of the applications of this concept.

The response to this part shows the relation between total pay and raw compensation.

Hope that answers the question, have a great day!

1. Railroad tracks present no problems for a motorcyclist.
A. O TRUE
B. O FALSE

2. Which of the following is considered to be a vulnerable road user?
A. Bicyclists
B. Motorcyclists
C. Pedestrians
D. all of the above

Answers

Answer: 1 is A

2 is D

Explanation:

A__________provides an easier way for people to communicate with a computer than a graphical user interface (GUI).

Answers

Answer:

Natural language processing

Explanation:

NLP, because many people can use a device better when they can talk to it just like it is another person. Some systems that use an NLP are voice assistants such as Alexa and Siri.

function of network security​

Answers

Answer:ffffffffffffgggggg

Explanation:vvvc

Other Questions
A bond currently sells for $1,170, which gives it a yield to maturity of 5%. Suppose that if the yield increases by 30 basis points, the price of the bond falls to $1,140. What is the duration of this bond Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x modulo 2 (remainder is either 0 or 1) Assign x with x divided by 2 D o resultado da seguinte adio: (+27) + (+13) + (-28), (+90) + (-75) + (-47), (-50) + (-30) + (-12), (-11) + (+20) + (+35) + (-27) g Glycogen Phosphorylase is phosphorylated by ____________________. Glycogen Synthase Kinase Casein Kinase Protein Kinase G Phosphorylase Kinase Protein Kinase A The government of a small town is concerned about the litter created when people leave styrofoam cups used to serve large beverages on the ground. The government decides to tax these by implementing a $1 tax on these drinks. how much heat is required to raise the temperature of 5kg of iron from 50c to250c Why is this statement considered a theme and not a plot summary?True friends will always be there for you when you needthem.A It presents a conflict that has been resolvedB. It is a general idea about human nature.c. It relates the events of a specific storyD. It introduces the main characters,ST Which of the following observations would indicate that a material is a pure substance?O It does not dissolve in water.O It changes color after heating.O It cannot be physically broken down into different types of atoms.O It can be physically broken down into different types of moleculesSave and FyitNoy XYZ, Inc. just sold 700,000 shares in a public offering for an offering price of $24 per share. The underwriting fee was 7.50% of the issues total value based on the offering price. As soon as the shares were issued, the price jumped to $36 per share. What are the explicit, implicit, and total costs of the issue? Help I have to turn these in fast I'll give brainliest Rainbow Paints Inc. is a leading paints company in Pakistan. In June 2019, the higher management of the company deliberated and decided upon the production targets for the year 2020. The procurement department was directed to order the supplies of required chemicals and raw materials from Chinese company i.e. XingPe Chemicals for the target production. The supplies were expected to arrive in January-February 2020 but unexpected situation halted the normal operations in China due to the spread of a novel virus. The situation created panic at Rainbow Paints Inc. as lack of supplies meant falling short of the targets and plunging in losses. The supplier was contacted but they were of the view that they cannot send the supplies as per the contract due to the lockdown. Now, conflict aroused between the parties as Rainbow Paints Inc. wanted the raw materials which the XingPi Chemicals cannot process due to restrictions from their respective government. It resulted in losses for Rainbow Paints Inc. Rainbow Paints Inc. decided to consult an International arbitrator for the resolution of the dispute. During negotiations, the Rainbow Paints Inc. maintained that they faced losses due to lack of supplies which did not reach them at the promised time. So, the supplier must not only compensate for it but also return their payments. While XingPe Chemicals insisted that they couldnt move ahead due to unexpected and unavoidable pandemic situation, so the losses must be shared. They also reiterated the resolve to provide supplies in the future without any delays if the situation permits. They insisted on keeping the contract intact while finding a middle ground for the current dispute. Requirement: After analyzing the case, Identify the approaches to negotiation maintained by both the parties in conflict i.e. Rainbow Paints Inc. and XingPi Chemicals and explain them as per the scenario. What is the solution to the quadratic equation x2 + x - 30 = 0? how many tiger reserve are included under project tiger How many atoms are in 10g of Al The length and width of a rectangle are measured as 27 cm and 50 cm, respectively, with an error in measurement of at most 0.1 cm in each. Use differentials to estimate the maximum error in the calculated area of the rectangle. A student makes a Venn diagram as a study aid to compare asexual reproduction and sexual reproduction. Which process belongs in the region marked X? Fertilization Vegetative propagation Binary fission Sporulation Write Album's PrintSongsShorterThan() to print all the songs from the album shorter than the value of the parameter songDuration. Use Song's PrintSong() to print the songs. #include #include #include using namespace std; class Song { public: void SetNameAndDuration(string songName, int songDuration) { name = songName; duration = songDuration; } void PrintSong() const { cout currName; } } void Album::PrintSongsShorterThan(int songDuration) const { unsigned int i; Song currSong; cout Many enterprise organizations believe that cloud computing is essential to their business operations. There are some; however, that argue it is not cost efficient and operationally appropriate. Provide a use case where cloud computing is not appropriate and explain why you feel this is an appropriate decision for the enterprise. Heyy umm I need help Solve equation : A=Bt+c for t