Question: Programming Assignment Objectives Use cin to read data from the user Use cout to output to the standard output stream Convert a mathematical formula to
Programming Assignment
Objectives
Use cin to read data from the user
Use cout to output to the standard output stream
Convert a mathematical formula to C++ code
Use variables and assignments
Use if/else statements
Tasks
The second law of thermodynamics helps us determine the quality and degradation of energy in a process. In engineering, it is to calculate the theoretical performance limits of systems such as heat engines and refrigerators. Entropy is a thermodynamic property to quantify second law effects. It is an abstract concept. Qualitatively speaking, it can be defined as measure of disorder. For instance engineering systems can be designed on the principle of minimizing entropy generation. Thermodynamic tables are available for various fluids to calculate the entropy and several other thermodynamic properties. Oftentimes these properties are tabulated at regular intervals. For instance, at 0.20 MPa entropy values for superheated water at various temperatures are given in table 1. If a user asks to calculate a value outside the range of 150-500 then your program should output the string Temp out of range and then exit. You must have the output string match exactly to pass the tests.
In actual calculations, engineers may need entropy values at any temperature (e.g., 175.3C). If the value is not readily available, a common practice is to apply a linear interpolation using known values. Figure 1 shows the result of linear interpolation. Formula 1 describes the calculation of y at x given x0, y0 and x1, y1.
Using the above background and theory develop a C++ program that asks a user for a temperature (e.g. 169.2, 183.4, 420.7, 322.1, 400.0), calculate the entropy value and outputs the final value. Using the information above we can calculate the entropy of superheated water at 0.20 MPa and 175.3C.

What not to do
Do not modify any header file given to you.
What you will be graded on
You will be graded on the following criteria:
Your program compiles and runs. If your program does not compile, 60% of the grade is in jeopardy. However, depending on the severity of the issue, you can receive some credit.
Your code logic is correct. Be sure to test your conditionals and all of your endpoints. Code that is not reachable (Dead Code) should not be present.
You code is well structured and your use of abstraction is good.
Your use of variables and constants. Well named variables should be used. Constants should be used when warranted. Proper case for constants and camel case for variables should be used.
Your use of commenting and white space. Each file that is turned in needs a file header. All functions need function headers. Comments should be used to aid in readability (for you, weeks later and for others). White space aids in readability. If you are using an IDE then indentation is handled for you automatically. Sections of code should be broken up using blank lines; i.e., to separate declarations and code, etc..
What to turn in
All the files should be well documented, to include file headers and headers for each function, as well as appropriate inline comments.
Turn in main.cpp. Any other submission will not be graded and will receive a grade of 0 (zero).
.The entropy is: 7.2855 kJ/ (ka.K) .The entropy is: 7.5081 kJ/ (kauK) .The entropy is: 7.5121 kJ/ (ka*K) . The entropy is: 8.5153 kJ/(kg~X) Enter a temperature in C (150-500): 151 Enter a temperature in C (150-500): 200 Enter a temperature in C (150-500): 201 Enter a temperature in C (150-500) 500 Enter a temperature in C (150-500): 501 Temp out of range Enter a temperature in C (150-500): 255 The entropy is: 7.7284 kJ/ (kauK) What not to do Do not modify any header file given to you. What you will be graded on You will be graded on the following criteria: I. Your program compiles and runs. If your program does not compile, 60% of the grade is in jeopardy. However, depending on the severity of the issue, you can receive some credit Your code logic is correct. Be sure to test your conditionals and all of your endpoints. Code that is not reachable (Dead Code) should not be present. You code is well structured and your use of abstraction is good. Your use of variables and constants. Well named variables should be used. Constants should be used when warranted. Proper case for constants and camel case for variables should be used Your use of commenting and 'white' space. Each file that is turned in needs a file header. All functions need function headers. Comments should be used to aid irn readability (for you, weeks later and for others). White space aids in readability. If you are using an IDE then indentation is handled for you automatically. Sections of code should be broken up using blank lines; i.e., t 2. 3. 4. 5. o separate declarations and code, etc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
