Answered step by step
Verified Expert Solution
Question
1 Approved Answer
NEED HELP WITH QUESTIONS 2 AND 3. WE ARE USING THE PROGRAMMING LANGUAGE C 12. diff problem1.c problemlwodoc.c 2. In this problem, use linear interpolation
NEED HELP WITH QUESTIONS 2 AND 3. WE ARE USING THE PROGRAMMING LANGUAGE "C"
12. diff problem1.c problemlwodoc.c 2. In this problem, use linear interpolation to compute a new freezing temperature for water with a specified salinity. a. Create a file "freeze.txt" in the same folder as the C program with the following values in salinity (ppt) and freezing temperature (degrees Fahrenheit) will interpolate 33's corresponding Fahrenheit value i. 30 29.1 ii. 35 28.6 iii. 33 b. Create a C program to input the file, interpolate the new Fahrenheit value using the below equation, and output the new Fahrenheit value. No need to prompt for input (use printf's to ask for input). i. Fahrenheit_3 = Fahrenheit_1 + (salinity_3 - salinity_1)/(salinity_2 - salinity_1) * (Fahrenheit_2 - Fahrenheit_1) For example, with the file freeze.txt, i. Fahrenheit_3 = 29.1 + (33-30)/(35-30) * (28.6-29.1) = 28.8 ii. Example output: 1. New freezing temperature in degrees F: 28.8 d. Compile the program using gcc and run the program with input from freeze.txt and output to freeze_out.txt. Is the output a little neater without prompting for input? C. 3. C expressions a. Evaluate the following expression similarly to slides 32 and 33 of the chapter 2 lecture slides (be careful of integer division): 5/3 + 7/2*10 b. Transform the following equation into a C expression: b2-4ac Learning Outcomes: devoted thanStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started