WAP that allows a user to create and modify an array of size 10. Below is the menu that should be displayed.
- Clear the array
- Insert element at location
- Delete element at location
- Sort array
- Output sum of the array
- Output product of the array
- Print Array
Below is an specification of each of the 8 menu items.
- When a user clears the array, every spot should be replaced with a '0'
- When a user inserts into array, program should ask user for which location, and then ask for which value to insert.
- When a user deltes an element from array, program should ask user for which location. That location in array should be replaced with 0.
- When a user selects sort, the array should be sorted using bubble sort.
- When a user selects sum of array, program should output the sum of all elements in the array.
- When user selects product of array, program should output the product of all elements in the array.
- When user selects print array, program should print the entire array on one line in the following format. I.E. [10,3,4,5]
- When a user selects quit, program ends.
* This program will be easiest if you put different parts of it into subroutines (or functions). You will need to look up how to use a subroutine in QBASIC. They are much like functions, except they don't have a "return" statement.
* You need to create an array in a special way so it can be accessed within the subroutine. To do this, you must use the keyword shared. An example is: DIM shared arrName(10)
* You need to display the menu over and over again, so there should be a loop, that ends once a user enters 8.
* There are a lot of parts to this problem!! You may want to work on them separately at first. For example, you could first work on getting bubble sort to work in QBASIC separately.