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
Alex Ar [27]
3 years ago
10

The function retrieveAt of the class arrayListType is written as a void function. Rewrite this function so that it is written as

a value returning function, returning the required item. If the location of the item to be returned is out of range, use the assert function to terminate the program. Also, write a program to test your function. Use the class unorderedArrayListType to test your function.
Computers and Technology
1 answer:
Mariana [72]3 years ago
4 0

Answer:

int retrieveAt(int location, array){

   // Function to retrieve the element from the list at the position

   // specified by the location

   if (location <= array.size() - 1){

       return array[location];

   } else{

       cout<<"Location out of range";

       assert(); // Assuming the assert function is defined in the program.

   }

}

Explanation:

The void retrieveAt function is converted to a return function that returns the integer item of the array given the location and the array variable as arguments. The assert function is used to terminate the program.

You might be interested in
Describe the big data life cycle. Which step do you think is most useful and why?
Step2247 [10]

Answer:

Big data lifecycle consists of four phases: data collection, data storage, data analysis, and knowledge creation. Data collection phase consists of collecting data from different sources. In this phase, it is important to collect data from trusted data sources.

I think business cases analysis is the most useful step because (BCA) provides a best-value analysis that considers not only cost but other quantifiable and non-quantifiable factors supporting an investment decision. This can include but is not limited to, performance, producibility, reliability, maintainability, and supportability enhancements

Explanation:

mark me brainliest

7 0
3 years ago
Which of the following types of tool should be used only on round work, such as rigid or IMC conduit?
Dafna11 [192]
Its C. A pipe wrench 
6 0
3 years ago
Read 2 more answers
Calculate the formula unit mass if Al(NO3)3.(Al=27,N=14,O=16)​
Sergio039 [100]

Answer:

Explanation:

EMAIL query ? comment or request a type of GCSE calculation not covered? ... atomic masses are Al = 27 and O = 16; so the relative formula mass RFM or Mr = (2 x 27) + (3 x 16) = 102

3 0
3 years ago
A(n) ______ disk is a storage device that contains one or more inflexible, circular platters that use magnetic particles to stor
Delvig [45]
Hard






----------------------------------------------
5 0
3 years ago
Is a program that copies itself repeatedly, for example in memory or on a network, using up resources and possibly shutting down
alexandr402 [8]
It won't exactly shut down the network but it is usually a coding error that causes the program to replicate its self
7 0
4 years ago
Other questions:
  • What are two methods for playing a slide show from the first slide?
    9·2 answers
  • In terms of in-house custom engines versus third-party engines (like Unity), what has changed today from decades ago, and why?
    8·1 answer
  • A Windows user has been successfully saving documents to the file server all morning. However, the latest attempt resulted in th
    9·2 answers
  • SONET: is a standard for optical transmission that currently operates at Terabit per second speeds is almost identical to the IT
    7·1 answer
  • What information should the subtitles in the clips of your video per folio provide?
    14·1 answer
  • Which of the following methods is a static method? The class in which the method is defined is given in parentheses following th
    5·1 answer
  • Which staff member takes a set of plans and supervises their construction?
    6·1 answer
  • 1.what is a computer?
    5·1 answer
  • Choose a common cloud-based application from the lesson.(Infrastructure as a service, Software as a service, Platform as a servi
    5·1 answer
  • Outline various methods of collecting data
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!