Question: the outputs should look like this Inserting and deleting items from an one dimensional array are common and useful operations. In this lab, we will

the outputs should look like this




Inserting and deleting items from an one dimensional array are common and useful operations. In this lab, we will practice using Insert operation with array. We will add to the program written in open lab 9 such that we can add new books to the collection. Once read, it prints out the list of book titles, one title per line. You are required to define a user defined function to display the book titles You may refer back to the part of the source code from closed lab 9 Afterwards, the program goes into a loop prompting the user to add book titles, one at a time, to the collection. Each iteration through the loop: . First, it prompts the user for a new book title, . If this title is already in the collection, displays an error message Otherwise, it asks the user where to add the book in the collection, If the location entered is a valid location, insert the title, otherwise, display an error message. A user defined function is required to insert the value into the array, the input to the function include: 1. the new book title, and 2. the location where the new title is to be inserted This loop ends when the user enters an empty book title when prompted, i.e., press "ENTER" when prompted for book title. Here is an example run of the program: Inserting and deleting items from an one dimensional array are common and useful operations. In this lab, we will practice using Insert operation with array. We will add to the program written in open lab 9 such that we can add new books to the collection. Once read, it prints out the list of book titles, one title per line. You are required to define a user defined function to display the book titles You may refer back to the part of the source code from closed lab 9 Afterwards, the program goes into a loop prompting the user to add book titles, one at a time, to the collection. Each iteration through the loop: . First, it prompts the user for a new book title, . If this title is already in the collection, displays an error message Otherwise, it asks the user where to add the book in the collection, If the location entered is a valid location, insert the title, otherwise, display an error message. A user defined function is required to insert the value into the array, the input to the function include: 1. the new book title, and 2. the location where the new title is to be inserted This loop ends when the user enters an empty book title when prompted, i.e., press "ENTER" when prompted for book title. Here is an example run of the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
