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
Blizzard [7]
3 years ago
7

Given the following function definition, what modifications need to be made to the search function so that it finds all occurren

ces of target in the array?int search(const int array[], int target, int numElements){int index=0;bool found=false;while((!found) && (index < numElements)){if(array[index] == target)found=true;elseindex++;}if(found==true)return index;elsereturn -1;}a. Add another parameter to indicate where to stop searchingb. Add another parameter to indicate where to start searchingc. This already can find all occurrences of a given targetd. Have the function return the whole array
Computers and Technology
1 answer:
svet-max [94.6K]3 years ago
8 0

Answer:

D. have function return the whole array

Explanation:

the given function only return first occurrence of target. In order to get all occurrences of target we have to change condition in while loop to check whole array even if first occurrence of target found and plus add another parameter of type array that will store different  indexes of occurrence of target and return that array

You might be interested in
A level breach of security could be expected to have a severe or catastrophic adverse effect on organizational operations, organ
rewona [7]

Answer:

Option D is correct.

Explanation:

A high-level safety violation could be anticipated to have a serious or disastrous negative impact on organisational activities, organisational assets.

The effect of the violation on an organisation may be staggering, and sometimes unknown until the outcomes are achieved. It is strange that, owing to harmful or neglectful acts, the greatest incidents of compromise come from within the business ; it requires time for an organisation to recover.

8 0
3 years ago
Counselors do NOT provide which service during treatment?
Ivan

Answer:

Civil settlement

Explanation:

5 0
3 years ago
Read 2 more answers
Why is it important to follow a consistent naming convention for variables?
Vitek1552 [10]

Answer:

today I am going to be out for the job interview so if I will make it happen I am going to New Orleans this week to get the kids to work on the spot and I can get ready to go out to dinner and I can make a few more people

4 0
2 years ago
Types of antivirus explain them
Veronika [31]

Answer: an antivirus is a type of program designed  to protect computers from  viruses, spyware, botnets, rootkits, keyloggers and such. There are many versions and types of anti-virus programs which can be very helpful.

Such as:

Norton.

Kaspersky.

Ad Aware.

AVG

Mc Afee

Hope this helps u...

Explanation:

3 0
3 years ago
Which of the following is FALSE? Select one: a. The fast-paced and collaboration-based business environment makes email less use
12345 [234]

Answer:

The Atos case demonstrates that it is possible to cut out e-mail entirely.

Explanation:

6 0
3 years ago
Other questions:
  • Write a program that prints the day number of the year, given the date in the form month-day-year. For example, if the input is
    9·1 answer
  • What important practice can help prevent hardware trouble?
    6·1 answer
  • Which of the following attack is a threat to confidentiality?
    10·1 answer
  • Any part of the computer that you plug into the CPU like a phone, tablet, headphones etc. are called
    5·1 answer
  • Disk ____ is the ability to spread data over multiple disks or volumes
    7·1 answer
  • Please Help Me!!!!!!!!!!!!!
    5·1 answer
  • The act of illegally copying software, music,or movies that are copied protect?
    7·2 answers
  • An end-user license agreement protects _____.
    7·1 answer
  • Reflection about information technology​
    11·1 answer
  • What is the correct format to use when<br> inserting a date in Excel?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!