1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alisha [4.7K]
3 years ago
12

Write a function all_cats that consumes a comma-separated string of animals and prints whether all of the animals have "cat" in

their name. For example, the string "gerbil,catfish,dog,cat" would return False, but just "cat,catfish" would return True. If the function consumes an empty string, then it returns True. Call this function on a string of animals of your choice and print the result.

Computers and Technology
1 answer:
RoseWind [281]3 years ago
8 0

Answer:

  • Image 1 is for the function defining all_cats():

       (All the explanation is given in comments before each statement)

  • Image 2 has the code for testing the function all_cats()
  • Last image has the output of the code.

You might be interested in
Assume that a function named swapdoubles has been defined and is available for use in this exercise: that function receives two
Nata [24]

Answer:

C++ Code:

void sort3(double &a, double &b, double &c)

{

   if(a > b)

       swapdoubles(a,b);

   if (b > c)

       swapdoubles(b,c);

   if (a > b)

       swapdoubles(a,b);

}

Explanation:

To change the values of a,b,c within the function, we pass the values by reference. Let us assume that number a = 3.14, b = 2.71, c = 3.04. Since a > b, values of a and b will be swapped.Now a = 2.71 and b = 3.14. Similariy, since b > c, they will be swapped. This way, we move the largest number to its correct position in the first two steps. If there are only three numbers, and the largest number is in its correct position, then for the two remaining numbers, we will only need atmost one swap to exchange their positions. hence, we perform a comparison of a > b once again to see if the b is smaller than a. if its not, then all a,b,c are in sorted order.

6 0
4 years ago
Why do you think you are ready to handle the high school type of education and atmosphere? (in complete sentences)​
sertanlavr [38]

Answer:

I'm already in high school but at first, I was scared for my life literally. It wasn't what I expected it to be, though. Everyone was super nice to me and has been ever since I started. Turns out, high school is amazing.

Explanation:

5 0
3 years ago
How is gawain tempted​
jeyben [28]

Answer:

Sir Gawain and the Green Knight book cover

MENU

What are the temptations of Sir Gawain in "Sir Gawain and the Green Knight"?

print Print document PDF list Cite

Expert Answers info

HILLARD THIEL eNotes educator | CERTIFIED EDUCATOR

In addition to the obvious temptations in Berkilak's castle with his wife (all of which involve erotic temptation and the temptation to violate hospitality for personal pleasure), more significant spiritual temptations frame this story. First, Gawain displays an element of pride when he agrees to participate in the initial contest. While Arthur is more to blame and Gawain offers to take his place, it certainly is not prudent to participate in this contest with a character whose appearance suggests that he is not a normal, mortal man. The first part of this bargain therefore involves the temptation of pride.

r Gawain and the Green Knight by Pearl-Poet

Sir Gawain and the Green Knight book cover

MENU

What are the temptations of Sir Gawain in "Sir Gawain and the Green Knight"?

print Print document PDF list Cite

Expert Answers info

HILLARD THIEL eNotes educator | CERTIFIED EDUCATOR

In addition to the obvious temptations in Berkilak's castle with his wife (all of which involve erotic temptation and the temptation to violate hospitality for personal pleasure), more significant spiritual temptations frame this story. First, Gawain displays an element of pride when he agrees to participate in the initial contest. While Arthur is more to blame and Gawain offers to take his place, it certainly is not prudent to participate in this contest with a character whose appearance suggests that he is not a normal, mortal man. The first part of this bargain therefore involves the temptation of pride.

Later, the temptation that most condemns Gawain is the desire to continue living even if one will live a life compromised by deceit. While it is understandable that Gawain would hide the garter and flinch at the blow of an ax, the temptation to focus on his mortal rather than his spiritual life is the cause of his wearing the garter as a mark of shame.

Explanation:

6 0
4 years ago
Write a function called quadruple that quadruples a number and returns the result. Then make several calls to the quadruple func
valentina_108 [34]

def quadruple(n):

   return n*4

print(quadruple(3))

print(quadruple(1))

print(quadruple(2))

I wrote my code in python 3.8. I hope this helps.

7 0
3 years ago
Your auto insurance policy has a $200 monthly premium and $700 deductible. what is the maximum amount you will have to pay out o
saul85 [17]
Your monthly premium is the payment you make to your car insurance company that keeps your coverage active.

A car insurance deductible is the amount of money you have to pay toward repairs before your insurance covers the rest.

Therefore $700 is the maximum amount you will have to pay
<span>out of pocket for a car accident before your insurance covers your cost.</span>
4 0
3 years ago
Other questions:
  • If you turn your volume to loud on u'r headphones can it break the sound quality of the speaker?
    9·2 answers
  • In the FEMA case study, the BureauNet software was the primary reason behind the increased speed and relevance of the reports FE
    15·2 answers
  • Where do you go to create a workbook?​
    8·1 answer
  • _______is the equal distribution of visual weight on either side of an imaginary axis through the center of a design. A building
    6·2 answers
  • Do you watch markiplier?
    13·2 answers
  • What does it mean to say that a graph is complete?
    14·1 answer
  • Assume variables SimpleWriter out and int n are already declared in each case. Write a while loop that printsA. All squares less
    11·1 answer
  • How can you make sure to save all annotations from a slide show?
    7·2 answers
  • Key Vocabulary:
    7·1 answer
  • Your development team is planning to host a development environment on the cloud. This consists of EC2 and RDS instances. This e
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!