Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please check this code and rewrite it thanks //in this we will convert flow char

ID: 3805291 • Letter: P

Question

Please check this code and rewrite it thanks

//in this we will convert flow chart into code
#include<iostream>
using namespace std;
int main()
{
double a, b, c;
double func_a, func_b, func_c;
cout << "Enter the values of a and c ." << endl;
cin >> a >> c;
cout << "Enter the salinity measurement of b ." << endl;
cin >> b;
cout << "Enter the value of func_a and func_c ." << endl;
cin >> func_a >> func_c;
if (a < b && b < c)
{
  func_b = func_a + (b - a) / (c - a)*(func_c - func_a);
  cout << "F(b) is =";
  cout << func_b << endl;
}
else
{
  cout << "Invalid data a,b,c !" << endl;
}
system("pause");
return 0;
}

HAND IN LABORATORY TASK: LAB #13EC 1. Modify the previous program to determine the freezing temperature for A salinity of 3.0 Run it and do a hand calculations on the paper to show your answer makes sense

Explanation / Answer

#include<iostream>
using namespace std;
int main()
{
double a, b, c;
double func_a, func_b, func_c;
cout << "Enter the values of a and c ." << endl;
cin >> a >> c;
cout << "Enter the salinity measurement of b ." << endl;
cin >> b;
cout << "Enter the value of func_a and func_c ." << endl;
cin >> func_a >> func_c;
if (a < b && b < c)
{
  func_b = func_a + (b - a) / (c - a)*(func_c - func_a);
  cout << "F(b) is =";
  cout << func_b << endl;
}
else
{
  cout << "Invalid data a,b,c !" << endl;
}
system("pause");
return 0;
}