Question
Assignment: Intro to Ada Assignment: In this assignment, you will write a program to acclimate yourself to the Ada programming language. Write a program that
Assignment: Intro to Ada
Assignment: In this assignment, you will write a program to acclimate yourself to the Ada programming language. Write a program that reads up to N integers into an array. It then sorts the data and presents the user a menu, as in the figure. The user makes their choice and the program responds accordingly, looping until the user uses the Q option to exit the program.
Select: P)rint Array L)ook for Element C)hange an Element I)nsert New Element F)ind Average Q)uit |
Your program will implement each option using one or more subprograms. Your main routine (no longer named main!) may contain nothing more than function calls, a loop, and a multiple alternative (Ada equivalent to the C++ switch).
You must have a function for each of the following tasks:
- Print the array, well-formatted, with each value below its index (starting from index 1)
- Sort the array
- Search the array
o Input an element from the user, search the array for the element, and return whether the search succeeded.
- Alter an element of the array Determine whether the array is full Insert a new element, if there is room.
- Determine whether an element is in proper order, relative to its immediate neighbors
- Determine the exact average of all values 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