When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data.  Write a program to adjust the values by subtracting the smallest value from all the values. Assume that the list will always contain different numbers. Ex. If the list of numbers is:    40  50  10  90  75       The adjusted list is:            30  40  0    80  65 The program first will ask the user to enter the number of integers to be adjusted. Then The following functions should be used:

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 4GZ
icon
Related questions
Question

When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data.  Write a program to adjust the values by subtracting the smallest value from all the values. Assume that the list will always contain different numbers.

Ex. If the list of numbers is:    40  50  10  90  75

      The adjusted list is:            30  40  0    80  65

The program first will ask the user to enter the number of integers to be adjusted. Then The following functions should be used:

  • The function dataCollection should be called to make a dynamic array to hold the user entered integers. It prompts the user to enter the list of numbers. A pointer to the array should be returned.
  • The function minVal receives an array and its size as arguments. It finds and returns the smallest number in the array.
  • The function adjust receives an array, the array size, and an integer as arguments. It will create an array with the same size as the argument array, but subtract the last argument integer from each element.
  • The function showVal receives an integer array and its size as arguments. It displays the array contents.
  • Function main.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT