CS365 Program 6- basics of programming with a strongly typed language Solved

30.00 $ 15.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment

Description

5/5 - (1 vote)

Objective

Learn the basics of programming with a strongly typed language

Assignment

Write a program in Ada that asks the user for a series of integers, sorts the list, finds the average of the list, the smallest value in the list, and displays the entire list on screen.

There will be no attempts to crash the program through entering illegal data types.

The program must meet the following specifications:

  • A comment section at the top of the file with your name, email address and a description of the program.
  • A function that fills an array of integers. The maximum number of integers the array will need to hold will be 100. This function asks the user for positive (non-zero, nonnegative) integer values until the user enters a value that is zero or negative. There is no guarantee the array will be filled. The function will return the array. The function does not accept any arguments.
  • A procedure that sorts the array. If you find a built-in sort routine in Ada, don’t use it. Write your own sort routine. Quicksort, bubble sort, I don’t care. You MUST write a sort routine. The procedure does not return the array, it sorts the array in place. Use an in out parameter for the array.
  • A function that determines and then returns the average of the values in an array. The average will be a floating point value. The function accepts an integer array of values. The parameter should be an in Call this function, with the appropriate labeling of the information, at some point after the integer array is filled.
  • A function that determines and then returns the largest of the values in an array. The largest value will be an integer value. The function accepts an integer array of values. The parameter should an in Call this function, with the appropriate labeling of the information, at some point after the integer array is filled.
  • A procedure that print out the elements of the array, one per line. Only print out the positive values. Call this function, with appropriate labels, both before and after calling the sort procedure.
  • Program6-gwxtb7.zip