Question
Write Programs for the following exercises: 1. Use my basic arrays starter program. This should already have an array called list with some numbers in
Write Programs for the following exercises: 1. Use my basic arrays starter program. This should already have an array called list with some numbers in it. The CAP or capacity of this is array is 10 elements. The int size variable keeps track of the number of elements in the array. 2. Delete an element from the array: Ask the user to enter an index and delete the value from that position. When this is done, you must decrement size by 1 and then print the array and make sure the element is deleted. Print only from 0 to size, so you should only see 9 elements after one has been deleted. 3. Insert an element into the array: Ask the user to enter the index where to insert an element. Then ask the user to enter the value for that index. Then insert the value into that index by shifting the other elements. After inserting the element, increment the size by 1. Print again from 0 to size, so you should see 10 elements again in the array.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started