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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!