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
You use lpstat and determine that a user named User1 has placed two large print jobs in the queue for Printer1 that have yet to
ICE Princess25 [194]

A command that should be used to remove these two print jobs from the print queue is cancel Printer1-17 Printer1-21.

<h3>What is printing?</h3>

Printing can be defined as a process that typically involves sending print jobs from a computer system to a printer, especially through the print queue.

In Computer technology, "cancel Printer1-17 Printer1-21" is a command that should be used to remove the two (2) print jobs from the print queue of Printer1 which is yet to start printing.

Read more on printer here: brainly.com/question/17100575

#SPJ1

6 0
2 years ago
What are some objects in your home that demonstrate electrical energy to radiant energy to thermal energy
Bogdan [553]
Definitely a lamp or a stove
6 0
3 years ago
Read 2 more answers
Write a program that reads in an integer, and breaks it into a sequence of individual digits. Display each digit on a separate l
Montano1993 [528]

Answer:

The program in Python is as follows:

num = int(input())

for i in str(num):

   print(int(i))

Explanation:

This gets input for the number

num = int(input())

This converts the number to string and iterates through each element of the string

for i in str(num):

This prints individual digits

   print(int(i))

4 0
3 years ago
You are photographing your friend in a local park which of the following might be supporting details you want to include in the
rodikova [14]

The color of the leaves. or the scenery

5 0
3 years ago
Write a program that records high-score data for a fictitious game. the program will ask the user to enter five names, and five
Harman [31]

Scores.cpp

#include <iostream>

#include <string>

using namespace std;

void initializeArrays(string names[], int scores[], int size);

void sortData(string names[], int scores[], int size);

void displayData(const string names[], const int scores[], int size);

int main()

{

   string names[5];

   int scores[5];

   //reading names and scores

   initializeArrays(names, scores, 5);

   //sorting the lists based on score.

   sortData(names, scores, 5);

   //displaying the contents of both arrays

   displayData(names, scores, 5);

 

  return 0;

}

void initializeArrays(string names[], int scores[], int size){

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

       cout<<"Enter the name for score #"<<(i+1)<<": ";

       cin >> names[i];

       cout<<"Enter the score for score #"<<(i+1)<<": ";

       cin >> scores[i];

       }

}

void sortData(string names[], int scores[], int size){

   

       int temp = 0;

       string tempStr = "";

       

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

               for(int j=1; j < (size-i); j++){

                      //checking max score and sorting based on it.

                       if(scores[j-1]< scores[j]){

                               //swap the elements!

                           //swapping scores

                               temp = scores[j-1];

                               scores[j-1] = scores[j];

                               scores[j]=temp;

                               

                               //swapping names

                               tempStr = names[j-1];

                               names[j-1] = names[j];

                               names[j]=tempStr;

                       }

                       

               }

       }

}

void displayData(const string names[], const int scores[], int size){

   cout<<"Top Scorers:"<<endl;

       //printing the elements up to the size of both arrays.

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

           cout<<names[i]<<": "<<scores[i]<<endl;

       }

}

3 0
3 years ago
Other questions:
  • What effects will the different types of lighting produce on mountains?
    15·1 answer
  • A computer that delivers requested webpages to your computer or mobile device is a(n) _________.
    9·1 answer
  • Hi I am Khine Mye and I want to ask you a question I don't know that is square root of 2 is 1.4 and how to get that 1.4 and plz
    8·1 answer
  • Can you get financial aid with average grades
    15·1 answer
  • Does -8 = -21?<br>[this is NOT a trick question]<br>Yes....?<br>No!​
    12·2 answers
  • Lori Redford, who has been a member of the Project Management group, was recently promoted to manager of the team. She has been
    12·1 answer
  • Why is science, mathematics, and technology different from engineering?
    15·1 answer
  • 9. "मेरे तो गिरधर गोपाल, दूसरो ना कोई
    5·1 answer
  • Which type of computer is used microprocessor​
    5·1 answer
  • Bank Account Postings While reviewing your checking account balance online, you notice that debit card purchases have not posted
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!