You will write methods of a program that calculates the number of occurrences of a specific type of animal in a list of animal names. For example, in the matrix with animal names as RosieMule TedFish DoodleCat WallyDog JessieDog DanaDog BibsCat MillieCat ElyFish SimonCat CloieFish GoldieFish ZippyFish AlexisDog BuckMule RascalMule GeorgeDog OscarFish GracieMule LuckyDog there are 6 dogs, 4 cats, etc.

Answers

Answer 1

Answer:

In Java:

public static void countAnimal(String [] animalList,String animal) {      

     int count=0;

     for(int i=0; i<animalList.length; i++ ) {

        if(animalList[i].toLowerCase().contains(animal.toLowerCase())) {

           count++;

        }

     }

     System.out.print("There are "+count+" "+animal);

  }

Explanation:

This line defines the method. The method gets a list of animals and a type of animal as its parameters

public static void countAnimal(String [] animalList,String animal) {      

This initializes count to 0

     int count=0;

This iterates through the animal list

     for(int i=0; i<animalList.length; i++ ) {

This checks if the current animal in the list is the type of animal (e.g. dog, cat, etc).

        if(animalList[i].toLowerCase().contains(animal.toLowerCase())) {

If yes, the count variable is incremented by 1

           count++;

        }

     }

This prints the number of animals of that type (e.g. dog, cat, etc).

     System.out.print("There are "+count+" "+animal);

  }

As an additional explanation:

if(animalList[i].toLowerCase().contains(animal.toLowerCase()))

animalList[i].toLowerCase() --> This converts the string of the current animal to lowercase

animal.toLowerCase() --> This converts the animal (e.g. dogs, cats) to lowercase

.contains -> compares if both strings to check if contains the particular animal

See attachment for complete program


Related Questions

In what way, if any, is a model different from a simulation?


Models are types of simulations that transform data sets into scenarios.

Models and simulations are completely different in that they achieve different results.

Models and simulations are essentially identical—they are two terms that describe the same thing.

Models are types of simulations that create ideal workers and members of leadership.

Answers

Answer:

Models and Simulations are completely different in that they achieve diffenet results.

Explanation:

Modeling is the act of building a model. A simulation is the process of using a model to study the behavior and performance of an actual or theoretical system. In a simulation, models can be used to study existing or proposed characteristics of a system. ... Simulating is the act of using a model for a simulation.

Answer:

Models are types of simulations that transform data sets into scenarios

Explanation:

Model - computer models take complex data sets and transform them into real-life simulations

What is a complier in computers

Answers

Answer:

Explanation:

A compiler is a computer program that translates source code into object code.

Select the qualification that is best demonstrated in each example.
Ginny carefully reviews the code in a program to make sure there are no errors.
Walker identifies why a program isn't working correctly and fixes it.
Donnell reviews code to help out a coworker who is in a hurry.
Hisako teaches herself a new programming technique.

Answers

Answer:

1. attention to detail

2.problem solving skills

3. teamwork

4. the ability to learn quickly

Explanation:

Answer:

2, 3, 2, 2

Explanation:

answer above was correct:)

Where do you go to connect to a VPN server in Windows 7?

Answers

Answer:

1) Start→Control Panel→View Network Status.

2) Click the Connect to a Network link.

3) Locate the VPN you want to connect to and click its name and then click the Connect button.

The button only appears after you click the name of the network.

To disconnect from a network, click the network name in this dialog box and then click the Disconnect button. Click Disconnect when prompted and then click Close.

4) Enter your network security key.

Most VPNs require a security key. It’s the same one you used to establish the connection.

Select the Hide Characters check box if you want to keep the Key hidden.

5) Click OK and then click the Connect button.

Windows 7 will use the key to establish a connection to the VPN network.

True/False. Debugging and sequencing are the same process; just different
terms.

Answers

False
debugging is the process of detecting flaws and removing them from code
sequencing is the order that commands are executed by computer

5 disadvantage of assembly
level language​

Answers

Disadvantages Of Assembly Language

Long programs written in such languages cannot be executed on small sized computers.It takes lot of time to code or write the program, as it is more complex in nature.Difficult to remember the syntax.Lack of portability of program between computers of different makes.No SDKs (System Development Kit).

Identify at least 6 errors from the following program code. Write all the errors and rewrite the correct program.(11 pts)

1. public E2
2. {
3. Public static void main(String )
4. {
5. System.Out.Println(“hello)
6. }

Answers

Answer:The code after rearrange the question segment:

public class Q// Class declaration of Q name.

{// Open the class body.

    public static void main(String[] a) // Main function declaration.

{ //Open the main-function body.

           System.out.println("Q"); // Print statement which print Q.

} //close the main-function body.

}//close the class body.

Output:

Q

Explanation:

a program execution is called ​

Answers

a program execution is called a process

Explanation

In the process, they process the data and also execute the data.

What happen in process?

First the data came from input, then go to the memory. The process take the data from the memory and process it and divide it, if there's arithmetic data thingy it will go to ALU and the rest to CU. After the data finish being proceed, the data will be sent to CU and executed there, then send back to the memory and go to the output to be shown.

#Sorry my grammar sucks

#Moderators please don't be mean, dont delete my answers just to get approval from your senior or just to get the biggest moderation daily rank.

Construct a class that will model a quadratic expression (ax^2 + bx + c). In addition to a constructor creating a quadratic expression, the following operations can be performed:
- query quadratic expression for each coefficient
- evaluate the quadratic expression at a specified value
- determine the number of real zeros (solutions to associated quadratic equation)
- determine the real zeros
Also construct a test program which will test whether your implementation of this class is correct.

Answers

Answer:

Following are the code to this question:

#include <iostream>//header file

#include<math.h>//header file

using namespace std;

class Quadratic//defining a class Quadratic  

{

private:

double a,b,c;//defining a double variable

public:

Quadratic()//defining default constructor

{

a = 0;//assigning value 0  

b = 0;//assigning value 0  

c = 0;//assigning value 0  

}

Quadratic(double a, double b, double c)//defining a parameterized constructor  

{

this->a = a;//use this keyword to hold value in a variable

this->b = b;//use this keyword to hold value in b variable

this->c = c;//use this keyword to hold value in c variable

}

double getA() //defining a get method  

{

return a;//return value a

}

void setA(double a)//defining a set method to hold value in parameter

{

this->a = a;//assigning value in a variable

}

double getB() //defining a get method  

{

return b;//return value b

}

void setB(double b)//defining a set method to hold value in parameter  

{

this->b = b;//assigning value in b variable

}

double getC() //defining a get method

{

return c;//return value c

}

void setC(double c)//defining a set method to hold value in parameter

{

this->c = c;//assigning value in c variable

}

double Evaluate(double x)//defining a method Evaluate to hold value in parameter

{

return ((a*x*x)+(b*x)+c);//return evaluated value

}

double numberOfReal()//defining a method numberOfReal to calculates the real roots

{

return (b*b)-(4*a*c);//return real roots

}

void findroots()//defining a method findroots

{

double d=numberOfReal();//defining double variable to hold numberOfReal method value

if(d<0)//use if block to check value of d less than 0

cout<<"Equation has no real roots"<<endl;//print message

else

{

double r1=(-b+sqrt(numberOfReal()))/(2*a);//holding root value r1

double r2=(-b-sqrt(numberOfReal()))/(2*a);//holding root value r2

if(r1==r2)//defining if block to check r1 equal to r2

cout<<"Equation has one real root that is "<<r1<<endl;//print message with value

else//else block

cout<<"The equation has two real roots that are "<<r1<<" and "<<r2<<endl;////print message with value

}

}

void print()//defining a method print  

{

cout<< a << "x^2 + " << b << "x + " << c <<endl;//print Quadratic equation

}

};

int main()//defining main method  

{

Quadratic q(5,6,1);//creating Quadratic class object that calls parameterized constructor

q.print();//calling print method

cout<<q.numberOfReal()<<endl;//calling method numberOfReal that prints its value

q.findroots();//calling method findroots

cout<<q.Evaluate(-1);//calling method Evaluate that prints its value

return 0;

}

Output:

5x^2 + 6x + 1

16

The equation has two real roots that are -0.2 and -1

0

Explanation:

In the above code, a class "Quadratic" is declared, which is used to define a default and parameter constructor to holds its parameter value.

In the next step, the get and set method is defined that holds and returns the quadratic value, and "Evaluate, numberOfReal, findroots, and print" in the evaluate method a double variable is used as a parameter that returns evaluated value.

In the "numberOfReal" method it calculates the real roots and returns its value. In the "findroots" method a double variable "d" is declared that hold "numberOfReal" value,

and use a conditional statement to check its value, and in the print method, it prints the quadratic equation.

In the main method, the lass object it calls the parameterized constructor and other methods.

When cropping a picture to shape, you can only turn it into a square or circle.
Select one:
O True
O False

Answers

I believe the answer is false
the answer is false!! .

similarities of ROM and RAM?​

Answers

Explanation:

both are primary storage devices

A computer connected to the internet that ask for data is a

Answers

Answer:

Client

Explanation:

When your computer is connected to the internet it is always asking and sending data. Your computer is the client which recieves the data from the sever.

how can you say that a painting is real? ​

Answers

Answer:Know the Artist. Prior to buying an artist's work, become familiar with their oeuvre. ...

Use a Magnifying Glass. Looking at the surface of a painting with a magnifying glass is one of the best ways to spot a print. ...

Turn the Painting Over.

Explanation:brainliest

See from the way they paint. You can see from the picture that its way different. Each artist has different way to paint. see the colour also

will give brainlyist

Which sentence in the following paragraph correctly describes mobile technology?
Mobile devices have become the main source of communication for many people around the world. However, businesses are still to capitalize on the wide reach mobile communication. Social media is being increasingly used in marketing research. Customized advertising can be integrated based on specific users' location. Smartphones do not have videoconferencing capabilities that is becoming a major business tool.

Answers

i think its the first sentence: Mobile devices have become the main source of communication for many people around the world

if im wrong im dum ;-;

Answer:

Customized advertising can be integrated based on specific users location.

Explanation:

Right for Plato/edmentum

Traffic flow analysis is classified as which?

Answers

Answer:

c. An active attack

d. A passive attack​

Explanation:

Traffic flow analysis is a cyber attack method of acquiring information by intercepting and examining messages so as to decode them by analysing patterns in the way the messages are communicated.

Traffic flow analysis can either be active or passive depending on if the attacker alters communication in the case of active analysis or simply extracts information in case of passive analysis.  

discuss some designs using columns, gutters, text alignment, graphics, etc.

Answers

Answer:

.......

Explanation:

O
O ^__^
o (oo)\_______
(__)\ )\/\
||----w |
|| ||

Answers

Answer:?

Explanation: What is the question

Employment was expected to grow by 13 percent from 2010 to 2020 in which of the following fields?

A.) video game design
B.)graphic design
C.)animation
D.)computer engineering

Answers

Answer: B

Explanation:

Consider the declaration of the struct houseType given in this chapter. Suppose firstHouse and secondHouse are variables of houseType. Write C11 statement(s) to compare the style and price of firstHouse and secondHouse. Output true if the corresponding values are the same; false otherwise. (2, 3)

Answers

Answer:

See Explanation

Explanation:

The question is incomplete as there is no link pointing to the houseType struct of chapter 1.

So, I've answered the question from scratch

See attachment for explanation where I used comments to explain each line.

The program is as follows:

#include <iostream>

using namespace std;  

struct houseType{

   int firstHouse, secondHouse;

};

int main() {

   houseType hT;      

   cout << "Enter the price of both house: ";

   cin>> hT.firstHouse;

   cin>> hT.secondHouse;

   if(hT.firstHouse == hT.secondHouse){ cout<<"true";    }

   else{ cout<<"false";    }  

   return 0;

}

Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. You can assume that the list will have at least 2 integers and fewer than 20 integers. Ex: If the input is: 5 10 5 3 21 2

Answers

Answer:

Follows are the code to the given question:

#include <iostream>//header file  

using namespace std;

int main() //main method

{

int nums[20];//defining an array

int n,i,k;//defining integer variables

cout<<"Enter total number you want to insert: ";//print message

cin>>n;//input value of n  

cout << "Enter array numbers: " << endl;//print message

for (i = 0;i<n;i++) //defining for loop for input values from user-end

{

   cin >> nums[i];//input values

}

for (i = 0; i < n;i++) //defining for loop for count array values

{

   for (k =i+1;k<n;k++)//defining for loop for arrange value in ascending  order  

   {

       if (nums[i] > nums[k])//checking first and second value

       {

           int t = nums[i];//defining integer variable that hold first element value in t

           nums[i] = nums[k];//holding second element value in first element

           nums[k] = t;//assign value in t

       }

   }

}

cout<<"Two smallest number in list are:";//print message

 for (i = 0; i <2; ++i)//defining for loop that prints first two smallest value  

     cout<<nums[i]<<" ";//print value

   return 0;

}

Output:

Enter total number you want to insert: 6

Enter array numbers:  

5

10

5

3

21

2

Two smallest number in list are:2 3  

Explanation:

In this code, an integer array "nums" is defined, and in the next step multiple integer variable is defined, that uses the for loop input value from the user-end, and in the next step, another two for loop is declared, that uses if block to arrange value into the ascending order at which it stores two smallest value in first and second position in the array element, and in the next step, it uses another for loop to print its element value.

what are node in a computer network​

Answers

Answer:

A node is a connection point inside a network that can receive, send, create, or store data. Each node requires you to provide some form of identification to receive access, like an IP address. A few examples of nodes include computers, printers, modems, bridges, and switches.

Which of the following are examples of IT
careers? Check all of the boxes that apply.
office administrator
computer hardware engineer
systems analyst
o real estate agent
database administrator
DONE

Answers

Answer:

Computer hardware engineer

Systems analyst

Database administrator

The following are examples of IT careers:

Computer hardware engineer

Systems analyst

Database administrator

Thus option (b), (c) and (e) are correct.

What is a computer?

A computer is a programmable device that stores, retrieves, and processes data.

The term "computer" was originally given to humans (human computers) who performed numerical calculations using mechanical calculators, such as the abacus and slide rule.

The term was later given to mechanical devices as they began replacing human computers. Today's computers are electronic devices that accept data (input), process that data, produce output, and store (storage) the results (IPOS).

The following are examples of IT careers: Computer hardware engineer; Systems analyst; Database administrator. Therefore, option (b), (c) and (e) are correct.

Learn more about computer here:

https://brainly.com/question/21474169

#SPJ5

design an algorithm to generate the first n terms of sequence 2,6,10,14​

Answers

Answer:

#Begin

a=2

k=0

temp=0

#Input

k=input()

temp=k

k=0

#Processing

while int(k)<int(temp):

print(a)

a=a+4

k=k+1

In this exercise, using the knowledge of computational language in python, we have that this code will be written as:

The code is in the attached image.

What is range?

The Python range function is a function native to the Python language that is used to generate a numerical sequence within a given range. It is normally used as an auxiliary to the for function. In Python, we can repeat an action a specified number of times using a for loop with the range function.

We can write the python  as:

a=2

k=0

temp=0

k=input()

temp=k

k=0

while int(k)<int(temp):

print(a)

a=a+4

k=k+1

See more about python at brainly.com/question/13437928

3) Which of the following operators is used for performing exponentiation?​

Answers

Answer:

pls make more detailed

Explanation:

The operator that is used for performing exponentiation is ^. The correct option is A.

What are exponential?

One technique to determine the exponential value of the supplied base and exponent values in Python is to use the exponentiation operator. Between the base and exponent values, we utilize the (**) double asterisk/exponentiation operator.

It provides a string in exponential notation that represents the Number object. Using the syntax number.to Exponential (value) The '.' operator is used with a number to invoke the toExponential() method, as demonstrated in the syntax above.

The ^ symbol represents the exponent. This symbol is known as a carrot (). As an illustration, 4 raised to 2 can be expressed as 42 or 42.

Therefore, the correct option is A) ^.

To learn more about exponential, refer to the link:

https://brainly.com/question/28596571

#SPJ6

The question is incomplete. Your most probably complete question is given below:

A) ^

B) #

C) *

D) /

Animations
Animations are !
Blank which can be Applied to blank in a presentation?

Answers

Animation is a graphic element that depicts movement. Animations are visual effects applied to individual items on a slide

Libraries order items, check out items to patrons, process returned items, and organize items on shelves. What data management solution should a library use to track this information?
a spreadsheet
a database
a flat file
a filing cabinet

Answers

A database because it will allow to track all these in real time

Answer:

a database

Explanation:

hope this help tell me if im wrong

what is the quotient of 8.16 ÷ 100​

Answers

Answer:

0.0816

Explanation:

8.16 ÷ 100 = 0.0816 (Ans)

Compared with space operations specialists, intelligence officers are which of the following?
A.) less likely to perform on-the-job training
B.)more likely to participate in technical training
C.)less likely to obtain a bachelor’s degree
D.)more likely to work with highly classified information

Answers

Answer:

more involved in aligning communications systems

Explanation:

I think this should be it

Answer could be:

more likely to work with highly classified information

or

something before Z

hi um... i just wanna say hi :P

Answers

Lol Heyy , how are you

hi hope ur having a good day / night :D

Draw a flowchart or write pseudocode to represent a program's logic that allows the user to enter a value. The program multiplies the value by ten and outputs the result.

Answers

Ill choose flowchart. Look picture for the answer

ask me if you have any doubts about my answer.

Other Questions
I WILL MARK Brainest Hi, I really need help, my mental health is horrible right now and I cant do any work, and I really just need help answering these questions because I really dont want to get bad marks but I dont have the motivation to do anything, thanks so much! A total of 5.9 percent of the prime time viewing audience watched shows on ABC, 7.6 percent watched shows on CBS, 5.5 percent on Fox, 6.0 percent on NBC, 2.0 percent on Warner Brothers, and 2.2 percent on UPN. A total of 70.8 percent of the audience watched shows on other cable networks, such as CNN and ESPN. You can find the latest information on TV viewing from the following website:Develop a pie chart or a bar chart to depict this information. Write a paragraph summarizing your findings. On the number line, which point is the closest pi .A.B.C.D. A destructive wave created by underwater earthquakes or volcanoes is called a what?btw don't mind the subject. El jueves se vendieron 13.520 entradas para ver un partido de hockey y el viernes 14.608. Si en el polideportivo caben 50.000 personas. Cuntas entradas se pueden vender todava? this is so true ............................... simplify 3(x-y)+3x+2 The distribution of the amount of money spent by first-time gamblers at a major casino in Las Vegas is approximately normal in shape with a mean of $600 and a standard deviation of $120. According to the standard deviation rule, almost 84% of gamblers spent more than what amount of money at this casino? A. $360 B. $480 C. $600 D. $720 E. $840 On the number line bug A is moving in the positive direction from the point 0, and a bug B is moving in the negative direction from the point 0. The speeds of both bugs are constant. Both leave 0 at the same time, and three seconds later A has reached 18 and B has reached -15If x is the point reached by A after t seconds, and y is the point reached by B after t seconds, express x and y in terms of t. I have been to the dentist many test, so I know the drill.Which word is being utilized for its multiple meanings in the pun?A. TimesB. DrillC. Dentist D. Been Can someone help with the one thats not answered You can always completely surround a point by placing the vertices of four squares together. A 6 inch personal pizza has 590 calories, with 240 of those from fat. A 12 inch pizza is cutinto 8 slices. Estimate the number of calories in one slice of a 12 inch pizza.calories Nickel and iron are two main elements synonymous to? Sebuah persegi di bagi menjadi 3 persegi panjan yang jika di sejajarkan mempunyai keliling 140cm Berapa luas persegi sebelum di bagi definition of a rhombus Can somebody help me with this ASAP!!! What decision did indigenous tribes conquered by Cortes decide?why 47 mm2 60m2 +5 km2 47 dm2 to m2Plsss help me I can't solve it How would I go about solving this problem? I used the Pythagorean theorem but still got it wrong