Question: Question 1: Given the following sorted array with unique elements: 2 5 7 11 18 30 Write a C++ program that allows the user to
Question 1: Given the following sorted array with unique elements: 2 5 7 11 18 30 Write a C++ program that allows the user to update this array's elements by reading the index of the element to updated and the new value, while keeping the array sorted and contains only unique values. The program should continue asking the user to update the array's elements until the user enters zero. Sample Run: Array elements: 2 5 7 11 18 30 Update the array's elements: Enter an index: 2 Enter the new value: 18 sorry you can't update .. This value already exists! Enter & to stop, any value to continue: 1 Enter an index: 4 Enter the new value o array after update: 257 11 30 Enterotostop, arvy value to continue 1 Enter a indeki Enter the value se reyfter update 131 30 se Ne sast, any value to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
