ou are working at the frozen yogurt shop in the mall. Your boss asks you to count how many flavors have the word chocolate in their name. You begin going through the list of flavors, but quickly realize that there are over 9000 flavors to check! Luckily, your boss stored all of the different flavors in a Java Array named flavorArray on the company computer. Write a Java program to count the number of flavors that have chocolate in their name.

Answers

Answer 1

Answer:

Following are the code to the given question:

int j,chocolateFlavorCount = 0;//declaring integer vvariable

for(j=0;j< flavorArray.length;j++)//defining a loop that starts from 1 to array length

{

if(flavorArray[i].contains("chocolate"))//use if that checks array contains string value that is chocolate

{

chocolateFlavorCount++;//incrementing integer variable value

}

}

System.out.println(chocolateFlavorCount);//printing integer variable

Explanation:

In this question, an integer variable "chocolateFlavorCount, and j" is declared, in which j used in the for loop. The loop starts from 1 and stops when it is equal to the array length it also defines an if block that checks array contains string value that is chocolate.If the condition is true it will increment integer variable value and print its values.

Related Questions

In the following nested loop structure, which loop does the program EXIT first?

Answers

Answer:

The loops are nested, and the program ends when loop 1 is completed. Since loop 4 is the innermost one, that one is completed first.

Alison wants to create a website with clickable elements, which languages will help her create a website with clickable functionality? scauer hi a {color:#FFF; tex #header .header-button {posit function new user(a) for (var b = ** scele #nav {position:relative; 2-3 #nav ul {margin:0; padding:0; length;C++) { b**** ale) #nav ul li {display:inline; #nav ul li a {display:block ; } return b; "page" #nay ul li:last-child a my Whine:15px 9px;) HTML CSS JavaScript > Sub submit(source as objece, e ls EventArgs) if red. Checked-True then pi. InnerHtml"You prefer red* who was the testy-second president of the 1.$.&.? willia Jefferson liten pl. Inner Html-"You prefer blue end it red.checked-false blue.checked-false End Sub ASP XML XML​

Answers

To make clickable elements she can use JavaScript language

Puede existir la tecnologia sin la ciencia y sin las tecnicas,explique si o no y fundamente el porque de su respuesta

Answers

Answer:

No

Explanation:

No, La ciencia organiza toda la informacion que obtenemos despues de hacer experimentos. Esta informacion se puede replicar y probar, ademas nos ayuda ampliar nuestro conocimiento de varios temas. Las tecnicas, son procedimientos y reglas que fueron formados para solucionar problemas y obtener un resultado determinado y efectivo. Sea como sea la ciencia y las tecnicas se necesitas para que exista la tecnologia. Sin la ciencia y las tecnicas se tendria que obtener la informacion para poder entender y crear tecnologia, y para hacer eso tenes que hacer experimentos, procedimientos, y reglas (ciencia y tecnicas.)

Please Help!
Computer Sci

Answers

Answer:

A.

Explanation:

Hope this helps :)

When the condition of an if statement is false, the computer will return an error message to the user.
A. True
B. False

Answers

The correct answer to your problem is A, True

How to mark someone the Brainliest

Answers

Answer:

Explanation: Once u get more than 1 answer of a question. A message is shown above each answer that is "Mark as brainiest". Click on the option to mark it the best answer.

Answer:

above

Explanation:

An accountant initially records adjusting entries in a(n) _____.
A. revenue record
B. ledger
C. expense record
D. Journal​

Answers

Journal!
Adjusting entries are changes to journal entries you've already recorded.

Answer:

Ledger

Explanation:

Believe me it's not a journal

how to save an edited document.​

Answers

You can either hit the save button (usually at the top of the window) or use CTRL-S or CMD-S (depending if you're on Windows or Mac).

Need the answer ASAP!!!

Type the correct answer in the box. Spell all words correctly.
What does the type of documentation depend on?

Apart from the documents required in SDLC phases, there is also other documentation (or variations in documentation) depending upon the nature, type, and_________of the software.

Answers

Answer: type and create of the software

Explanation:

pls mark brainliest

A group of students writes their names and unique student ID numbers on sheets of paper. The sheets are then randomly placed in a stack.

Their teacher is looking to see if a specific ID number is included in the stack. Which of the following best describes whether their teacher should use a linear or a binary search?

A. The teacher could use either type of search though the linear search is likely to be faster
B. The teacher could use either type of search though the binary search is likely to be faster
C. Neither type of search will work since the data is numeric
D. Only the linear search will work since the data has not been sorted

Answers

Answer:

D.

Explanation:

Binary searches are required to be first sorted, since they use process of elimination through halving the list every round until the answer is found. Linear searches just start from the beginning and check one by one.

give one reason why more people prefer to settle in areas of flat land than on steep slopes​

Answers

more people prefer to settle in areas of flat land than on steep slopes because it's safer. if someone settled their house on a steep slope there's a high chance that their house might get knocked down the slope during a natural disaster or something. but if it's on a flat piece of land then that's probably not gonna happen.

also it's easier to make farms on flat land rather than steep slopes.

Farmers prefer to settle in flat areas such as plains and valleys.

Flat land gave farmers more room to plant crops. The rich soil in coastal plains and river valleys was great for growing crops.

Plains are more suitable to agriculture than plateaus because they have deep, fertile soil.

I also had to answer this question, good thing I found it on my quizlet flashcards.

What are benefits of using debugging tools? Check all that apply.
A. Debugging tools help programmers catch errors they might otherwise miss.
B. Debugging tools can save time.
C. Debugging tools can introduce new errors into the code.
D. Debugging tools help programmers make methodical assessments of the problem.

Answers

Answer:

It's

A. Debugging tools help programmers catch errors they might otherwise miss.

B. Debugging tools can save time.

D. Debugging tools help programmers make methodical assessments of the problem.

Explanation:

got it right on edge.

Answer:

A, B and C

Explanation:

Which scenarios could be caused by software bugs? Check all that apply.
A. A person catches the flu and misses two days of work.
B. Smartphone users around the world are unable to get phone service.
C. A person is wrongfully arrested by the police.
D. A person receives a $10 bill at an ATM after requesting a $100 withdrawal.

Answers

Answer:

B- smartphone users around the world are unable to get phone service

C- A person is wrongfully arrested by the police

D- A person receives a $10 bill at an ATM after requesting a $100 withdrawal.

Explanation:

Software bugs are the fault and error in the application that affects the result. It can cause an error in receiving a different bill at ATM after withdrawing a different amount. Thus, option D is correct.

What is a software bug?

A software bug is a flaw or an error occurred in the applications of the system that generates unexpected results and causes crashing, and invalid outcomes.

Some software bugs include functional errors, missing commands, typos, crashes, calculation errors, etc. These types of errors can affect the ATM services causing errors in receipt generation.

Therefore, option D. a $10 bill is generated at ATM after withdrawing $100 is an example of software bugs.

Learn more about software bugs here:

https://brainly.com/question/4490366

#SPJ2

Which of these statements about the truck driving occupation in the U.S. are accurate?

Answers

Answer:

I'm unsure 38373672823

Answer:

I really hate to not give answers when answering for people but I'm not sure. It is definitely not A or D, I am tied between B and C. I'm so sorry I couldn't give the answer but hopefully you can narrow them down

Conflict on cross-cultural teams
O is inevitable and should just be ignored until it blows over
O should be handled immediately, so resentments do not grow
O is not likely to happen, since everyone works in basically the same way
cannot really be controlled, since barriers to communication are so high

Answers

Answer:

should be handled immediately, so resentments do not grow

Explanation:

Edge 2021

Convert the following numbers to binary numbers: 5 , 6 , 7 , 8 , 9 .​

Answers

Answer:

log 5,6,7,8,9 is the binary number according to the computer

Answer:

Divide by the base 2 to get the digits from the remainders:

For 5

Division by 2    Quotient Remainder(digit)

(5)/2                    2            1

(2)/2                    1              0

(1)/2                            0                  1

= (101)_2

For 6

Division by 2    Quotient Remainder(digit)

(6)/2                    3            0

(3)/2                    1              1

(1)/2                            0                  2

= (110)_2

For 7

Division by 2    Quotient Remainder(digit)

(7)/2                           3                    1

(3)/2                    1              1

(1)/2                            0                  1

= (111)_2

For 8

Division by 2    Quotient Remainder(digit)

(8)/2                    4            0

(4)/2                    2              0

(2)/2                            1                  0

(1)/2                             0                  1

= (1000)_2

For 9

Division by 2    Quotient Remainder(digit)

(9)/2                    4            1

(4)/2                    2              0

(2)/2                           1                  0

(1)/2                            0                  1

= (1001)_2

Explanation:

Which of the following was (and still is) used by computer programmers as a first test program?

Answers

Answer:

The "Hello World!" program

Explanation:

Options are not given, However, the answer to the question is the "Hello World!" program.

For almost all (if not all) programming language, this program is always the test program.

In Python, it is written as:

print("Hello World!")

In C++, it is:

#include <iostream>

int main() {

   std::cout << "Hello World!";

   return 0; }

Answer:

the following was (and still is) used by computer programmers as a first test program is "Hello world!".

and its computer program is:

Explanation:

[tex]\:{example}[/tex]

#include <stdio.h>

int main()

{

/* printf() displays the string inside

quotation*/

printf("Hello, World!");

return 0;

}

What are different ways that celebrities try to connect with fans using the Internet and social media?
*No links or files, I will report your answer so it gets taken down

Answers

Answer:

they ask fans questions they talk to fans they do many things with fans trying to connect with them

Which technology or technique standardized the process of publicly sharing and accessing information over the internet?

A.
TCP/IP
B.
HTTP
C.
dial-up connections
D.
coaxial cables
E.
internet forum

Answers

Answer:

B.

Explanation:

Hypertext Transfer Protocol, commonly known as HTTP, is an application protocol that allows the users to fetch information from web resources. It was created to make communication between web services and web resources possible. It also helps in the transmission of HTML documents.

Through this protocol, people can access and share information over the internet easily.

Therefore, option B is correct.

What type of internet connection do you think you'd get in Antarctica?

A.
cable
B.
DSL
C.
dial-up
D.
satellite
E.
ISDN

Answers

Hello!
My best guess is you would have to use mediocre satellites that float over for internet connection.

Need the answer ASAP !!!!

Type the correct answer in each box. Spell all words correctly.What type of maintenance does Desmond perform?

Desmond is responsible for modifying software to improve performance or meet new client requirements. Desmond performs_________
maintenance.

Answers

Answer: software

Explanation:

Software maintenance refers to modifying a software product in order to correct faults, and also to enhance the performance after it has been delivered.

Since Desmond is responsible for the modification of software to enhance performance or meet the new client requirements, then we can infer that Desmond performs software maintenance.

A farmer is reading a nature guide to learn how to make changes to a pond so that it will attract and support wildlife. The guide gives the suggestions listed below.
Help Your Pond Support Wildlife
1. Reduce soil erosion by keeping livestock away from the banks of the pond
2. Allow plants to grow along the shoreline to provide cover, nests, and food for wildlife
3. Float logs near the edge of the water to provide habitats for salamanders
4. Add large rocks to provide sunning sites for turtles

Which suggestion involves interactions between two groups of living organisms?
A. Suggestion 1

B. Suggestion 2

C. Suggestion 3

D. Suggestion 4

Answers

D is the answer


Hope this helps

According to the scenario, suggestion three involves the interactions between two groups of living organisms. Thus, the correct option for this question is C.

What is the process called when two groups of living organisms interact?

When two groups of living organisms interact with one another, the process is known as species interaction. It states that the population of one species interacts with the population of other species that live in the same locality.  

Suggestion three reveals that the floating logs near the bank of the water bodies significantly provides a habitat for salamander which are amphibians by nature. So, it gives the chance to aquatic organisms like fishes, phytoplankton, etc. to interact with salamanders. This mutually supports the wildlife of a particular region.

Therefore, according to the scenario, suggestion three involves the interactions between two groups of living organisms. Thus, the correct option for this question is C.

To learn more about Species interactions, refer to the link:

https://brainly.com/question/28062759

#SPJ2

Rafi is developing an application to send urgent information about global health crises over the Internet to hospitals. He is worried about packets getting lost along the way and the effect that will have on the accuracy of the information. What is his best option for dealing with lost packets

Answers

Have the packets virtual

Answer:

Rafi can use the Transmission Control Protocol for communication since TCP has ways to recover when packets are lost.

Explanation:

TCP is a data transport protocol that works on top of IP and includes mechanisms to handle lost packets, such as the retransmission of lost packets.

does anyone here like meta runner?

Answers

Answer:

Meta Runner is the best show! Sophia is my fav!

Explanation:

Answer:

YAS!! Tari is my fav. U watch smg4 too?

Explanation:

how should we utilize our rights​

Answers

Answer:

Human rights also guarantee people the means necessary to satisfy their basic needs, such as food, housing, and education, so they can take full advantage of all opportunities. Finally, by guaranteeing life, liberty, equality, and security, human rights protect people against abuse by those who are more powerful.

Explanation:

Answer:

Speak up for what you care about.  

Volunteer or donate to a global organization.  

Choose fair trade & ethically made gifts.  

Listen to others' stories.  

Stay connected with social movements.

Stand up against discrimination.

Explanation:

A run is a sequence of adjacent repeated values. Write a
program that generates a sequence of 50 random die tosses in
an array and prints the die values, making the runs by including
them in parentheses, like this:

1 2 (5 5) 3 1 2 4 3 (2 2 2 2) 3 6 (5 5) 6 3 1

Add a method alternatingSum() that returns the sum of the
alternating elements in the array and subtracts the others. For
example, if your array contains:

1 4 9 16 9 7 4 9 11
Then the method should compute:

1-4+9-16+9-7+4-9+11 = -2


I am having trouble with this code can someone please help me?

Answers

Answer: yeet

Explanation:

liker up

The required program illustrates an array, outputs the die values with runs in parenthesis, and computes the alternating sum of the array's elements.

What is the array?

An array is a type of data structure that holds a collection of elements. These elements are typically all of the same data type, such as an integer or a string.

Here is a program that generates a sequence of 50 random die tosses in an array, prints the die values with runs in parentheses, and computes the alternating sum of the elements in the array:

import java.util.Random;

public class Main {

   public static void main(String[] args) {

       // Create a random number generator

       Random rand = new Random();

       // Create an array to store the die tosses

       int[] tosses = new int[50];

       // Generate the random die tosses

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

           tosses[i] = rand.nextInt(6) + 1;

       }

       // Print the die tosses with runs in parentheses

       System.out.print(tosses[0]);

       for (int i = 1; i < tosses.length; i++) {

           if (tosses[i] == tosses[i - 1]) {

               System.out.print(" (" + tosses[i]);

               while (i < tosses.length - 1 && tosses[i] == tosses[i + 1]) {

                   System.out.print(" " + tosses[i]);

                   i++;

               }

               System.out.print(") ");

           } else {

               System.out.print(" " + tosses[i]);

           }

       }

       System.out.println();

       // Compute and print the alternating sum of the array elements

       System.out.println("Alternating sum: " + alternatingSum(tosses));

   }

   public static int alternatingSum(int[] array) {

       int sum = 0;

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

           if (i % 2 == 0) {

               sum += array[i];

           } else {

               sum -= array[i];

           }

       }

       return sum;

   }

}

The alternatingSum() method computes the alternating sum of the elements in the array by adding the elements at even indices and subtracting the elements at odd indices.

To learn more about the arrays click here:

brainly.com/question/22364342

#SPJ2

Why would a designer choose to use a static layout? Check all of the boxes that apply.

It helps to avoid horizontal scrolling.

It adjusts the size and shape of content blocks.

It is easier to control layout choices.

It always fits the width of the screen.

Answers

Answer:

Explanation:a & c

Answer:

a c core

Explanation:

#done with school already

Answers

Answer: omg yes same hate it

Explanation:school is boring and we have to do work.

What is the difference between HTML and C?
A. C allows programmers to write code for different devices, while
HTML makes code easier to analyze on a single device.
O B. HTML is a language used for web pages, while C is a language
commonly used in operating systems.
C. C is a language invented for interactive television, while HTML is a
language designed for smartphones.
D. HTML is a language for computer operating systems to sync with
other devices, while C is a language for web browsers to read web
pages.

Answers

Answer:

B

Explanation:

HTML is interpreted in web browsers, while C is complied and is low level, which is why many operating systems, including Linux use it.

I'm a programmer :)

HTML is a language used for web pages, while C is a language commonly used in operating systems. Then the correct option is B.

What is the difference between HTML and C?

The Hypertext Markup Language (HTML) is the most dominant language for organizing and formatting websites and other materials on the Internet.

C is a programming language.

HTML is a language used for web pages, while C is a language commonly used in operating systems.

Then the correct option is B.

More about the HTML and C link is given below.

https://brainly.com/question/13384476

#SPJ2

what adaptation Judy and her parents have that help them run from predators coming?​

Answers

Answer:

.57

Explanation:

The adaptation which Judy and her parents have that helps them run from predators coming is:

Self preservation/survival

According to the given question, we are asked to state the adaptation which Judy and her parents has that helps them run from predators coming and continue to survive.

As a result of this, we can see that humans have adapted over the years to run from predators who are capable of killing them because of the sense of self preservation or survival which is helped by the adrenaline to escape from danger

Read more here:

https://brainly.com/question/20594263

Other Questions
Why might a person assume the Mr. White could be doing well financially Is it possible to construct a triangle with the given side lengths?1 ft, 6 ft, 9 ft Yes or no? Need to find the value of N. need ASAP due to it being a hand in Find the valu of x round yo the nearest tenth Which point on the number line represents - 2/3?A. Point QB. Point PC. PointsD. Point R What fear did Robert Darwin have for his son? When they retired, my grandparents converted their home to a bed and breakfast (B&B). A B&B is a guesthouse that provides travelers with a place to sleep and breakfast the following morning. My grandparents remodeled their house to add two extra bedrooms. During the summer, the B&B now hosts several guests every week. My grandparents enjoy meeting new people and appreciate the extra income. My grandpa loves to cook and is happy to ,begin underline,accommodate,end underline, special requests for breakfast. Some mornings he prepares waffles, country ham, grits, and customized omelets as well as his famous silver-dollar pancakes!Which word means the same as ,begin emphasis,accommodate,end emphasis, as it is used in the passage?A. AdjustB. ContainC. LodgeD. Oblige hey! please help ill give brainliest A from of government in which people elect representatives to govern the country is called dictatorship. what is the right word that will make the sentence true? If f(x) = 3x - 2 and g(x) = -x + 4, find (g o f)(x). Please help me! I need it fast!I will give brainly( The subject is science) a zoologist hides in a bush 200 feet away from a tree inhabited by a family of monkeys. if the zoologist is looking up at an angle.of 15, how high in the tree ate monkeys? Theres a picture provided Super easy but not for me. Please help Write a five sentence diary entry imagining that you are a north/south soldier preparing to go to war against the other side. What are you fighting for? How do you feel? What are things to look for in an Expository text?They have many rhyming patterns.They have imaginary characters.The story is based on a play.They may have dates, images and a thesis statement that are informative. Must show work, please helppp diferencia entre los tejidos vasculares xilema y floema Please help. What is the answer? Im struggling. How do your write a feaction with a denominator of 20 as a decimal? Select the correct text in the passage.Which lines in this excerpt of Charles Dickens's A Christmas Carol reflect the theme of compassion versus material gain?"But you were always a good man of business, Jacob,"faltered Scrooge, who now began to apply this to himself."Business!" cried the Ghost, wringing its hands again. "Mankind was my business. The common welfare was my business; charity, mercy,forbearance, and benevolence, were, all, my business. The dealings of my trade were but a drop of water in the comprehensive ocean of mybusiness!"It held up its chain at arm's length, as if that were the cause of all its unavailing grief, and flung it heavily upon the ground again."At this time of the rolling year," the spectre said, "I suffer most. Why did I walk through crowds of fellow-beings with my eyes turned down, andnever raise them to that blessed Star which led the Wise Men to a poor abode! Were there no poor homes to which its light would haveconducted me!"Scrooge was very much dismayed to hear the spectre going on at this rate, and began to quake exceedingly."Hear me!" cried the Ghost. "My time is nearly gone.""I will," said Scrooge. "But don't be hard upon me! Don't be flowery, Jacob! Pray!""How it is that I appear before you in a shape that you can see, I may not tell. I have sat invisible beside you many and many a day."It was not an agreeable idea. Scrooge shivered, and wiped the perspiration from his brow."That is no light part of my penance," pursued the Ghost. "I am here to-night to warn you, that you have yet a chance and hope of escaping myfate. A chance and hope of my procuring, Ebenezer."'You were always a good friend to me," said Scrooge. "Thank'ee!"ResetNex