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
"The graphics driver was recently updated on a system. Now, the graphical user interface (GUI) is not displaying, preventing the
pickupchik [31]

You can access a full-screen TTY session by holding down the Ctrl+Alt keys, and pressing one of the function keys. Ctrl+Alt+F3 will bring up the login prompt of tty3.  If you log in and issue the tty command, you'll see you are connected to /dev/tty3.

Explanation:

  • tty2 is short for teletype, but it's more popularly known as terminal.
  • It's basically a device (implemented in software nowadays) that allows you to interact with the system by passing on the data (you input) to the system, and displaying the output produced by the system
  • You can either : press ctrl+alt+F7  Or  run the command startx if the above commands do not work.
  • The tty command of terminal basically prints the file name of the terminal connected to standard input.
  • In Linux, there is a pseudo-teletype multiplexor which handles the connections from all of the terminal window pseudo-teletypes (PTS). The multiplexor is the master, and the PTS are the slaves.
  • The multiplexor is addressed by the kernel through the device file located at /dev/ptmx.
  • The -s (silent) option causes tty to generate no output.

8 0
3 years ago
Mariel types a sentence. She then decides to include that sentence four more times. She then decides she only wants the sentence
Minchanka [31]
CTRL Z and CTRL Y
(undo)_____(redo)
8 0
3 years ago
Read 2 more answers
What information will you find in the 16-bit field in an IP datagram?
faust18 [17]

Answer: This 16-bit field defines the entire packet size in bytes, including header and data. The minimum size is 20 bytes (header without data) and the maximum is 65,535 bytes. All hosts are required to be able to reassemble datagrams of size up to 576 bytes, but most modern hosts handle much larger packets.

Explanation: Hopefully this helps you with what ever u are doing.

7 0
3 years ago
A customer seeks to buy a new computer and for a private use at home.The customer primarily needs the computer to use the Micros
sergeinik [125]

Answer: I would suggest a Solid State Drive (SSD)

Explanation: An SSD is faster than a HDD and can be compartmentalized easier. If your only option is an HDD, than I suggest the cheapest (the one with less data.) Especially, if you're only using it Microsoft PowerPoint. Is it a laptop or a desktop?

7 0
3 years ago
The Word program window contains many elements used to create and navigate a document. List five elements of the Word program wi
Veseljchak [2.6K]

Answer:

1. Insert a table

2. Setting margins

3. Spelling and grammar correction

4. Header and footer

5. Search a word

Explanation:

1) A table can be inserted in a word document to manage data easily and in a more presentable way.

2) Different margins can be set according to the requirement and rulers can be made visible and invisible.

3) If by chance typo errors happen, a red wavy line indicates spelling mistakes and green indicates grammar mistakes which can be corrected easily.

4) Sometimes writing some professional documents, we need some text to be visible either on top or bottom of every page of that document which can be done with the help of headers and footers.

5) By pressing Ctrl+f we can easily search for a particular word in a document.

6 0
4 years ago
Other questions:
  • ATM machines respond to request in__________​
    13·1 answer
  • True or False. A modern programming EXE provides a text editor, a file manager, a compiler, a linker and loader, and tools for d
    9·1 answer
  • What tab should you choose to locate the copy and paste tool?
    10·2 answers
  • GPS data can be used to track the rate and direction of plate movement. If a GPS unit measures a latitude velocity of 28.2 mm/yr
    8·1 answer
  • How do you navigate multiple computer screen at one time?
    5·1 answer
  • Stopping, standing, or parking is prohibited _____________.
    14·1 answer
  • Objectives
    8·2 answers
  • What was Pike's objective on his first expedition in 1805?​
    9·1 answer
  • Mk chưa hiểu nên các bạn giúp mk vs
    14·1 answer
  • BRAINLIESTTTT How does a project manager evaluate the scope of a project?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!