Question: C++ code Require the user to enter data values for 3 data samples (two interval ranges). A single sample is a salinity measure and its

C++ code

Require the user to enter data values for 3 data samples (two interval ranges). A single sample is a salinity measure and its corresponding temperature. Your program should verify that the salinity values of the three samples are in increasing order and that the temperature values of the three samples are in decreasing order; if not your program should simply print a message that the data are invalid and then exit.

  • If the samples are correctly ordered, your program should then ask the user to enter a salinity value.
  • If the salinity value lies within one of the two input intervals, the program should use linear interpolation to determine the corresponding temperature.
  • If the input value is not within either of the input intervals, then the program should print a message so indicating and exit.

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!