EGR 104 Practice Practicum 1 Name: Ocean Salinity Guidelines: 1. Put your name at the top...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
EGR 104 Practice Practicum 1 Name: Ocean Salinity Guidelines: 1. Put your name at the top of this document and return it at the end of the exam. 2. Materials provided for reference: ASCII Table, Order of Operations, printf reference, math.h and string.h function lists 3. You are allowed to use your textbook and notes for the exam. This includes submitted homework, labs, and in class assignments. You may not use any other electronic reference material. 4. With about ~10 minutes remaining, you must wrap up what you are doing, and upload your source code to the Blackboard Assignment Manager. 5. Take a deep breath - you can do it! Problem & Instructions: The salinity of the water in the ocean is a function of the water temperature, ocean depth and current speed. Additionally, the salinity is highly dependent upon the particular ocean that is under consideration. Your task today will be to write a program that will serve as an ocean salinity calculator. Given the water temperature T in degrees Kelvin, ocean depth D in meters and current speed C in meters per second, the water salinity S in parts-per-hundred (pph) is given as log 10 10(+D+1)T/223.1 166 S = 33 C+1 + 3.0 where R is the reference salinity for a particular body of water (i.e., a particular ocean). Your task today is to create a program to compute S in pph. You are to query the user to enter the water temperature T in degrees Celsius (you will need to convert 7 temporarily to degrees Kelvin to compute S), ocean depth D in meters and current speed C in meters per second. Assume that the user enters the data correctly and in the correct unit. Furthermore, you are to have the user enter the name of the ocean and a single letter (N or S) to indicate the hemisphere. Follow these detailed instructions: Tier 1 Requirements (Minimum Deliverables to receive a 'C' on the exam): 1. Pay attention to the compiler messages as you go along. Also turn it in on time. Penalties are as follows: Each type of error Each type of warning Each minute late -10 -5 -10 2. (15 pts) Start from the provided template code. Include any additional libraries that are necessary. Use good formatting and style. Match your output to the examples given. 3. (15 pts) Include the usual comment block, including the program name, author, date, class, professor, description, and notes. Include descriptive comments throughout. 4. (10 pts) Prompt user and scan in values for temperature (in Celsius), depth, and speed. (Prompts not shown; use your best judgment.) 5. (10 pts) Print the first line of the output using a custom function. 6. (10 pts) Display the requested output for temperature, depth, and speed. Your output statement must display as shown in the examples. 7. (10 pts) Convert the temp from C to K using a custom function and output as shown. = Temp(K) Temp (C) + 273.15 EGR 104 Practice Practicum 1 Tier 2 Requirements (Minimum Deliverables to receive a 'B' on the exam): 8. (5 pts) Prompt (best judgment) user and scan in the ocean name. 9. (5 pts) Prompt (best judgment) user and scan in the hemisphere (N/S). 10. (5 pts) Print out the hemisphere and ocean name as shown. Tier 3 Requirements (Minimum Deliverables to receive an 'A' on the exam): 11. (5 pts) Create a function to calculate the salinity using the given equation. 12. (5 pts) Use the function to calculate the salinity. 13. (5 pts) Display the salinity and output as shown. EGR 104 Test set #3: Input: Practice Practicum 1 31.5 2.75 12.9875 Pacific N Output: Based on the following data: temperature of 31.5 degrees C (304.65 K), depth of 2.75 m, and current speed of 12.9875 m/s in the N Pacific Ocean, the water salinity is 4.579 parts-per-hundred. Example Input/Output: Below are example test cases with expected output in order to help you validate your code. The input data is listed as T, D, C followed by the ocean name and hemisphere. Overview: Based on the following data: temperature of Starter Code: #include #include // Function prototypes void printFirstLine (void); double convert Ctok (double Celsius); double calcSalinity (double T, double D, double C); degrees C K), Tier 1 depth of m, and current speed of in the m/s Ocean, Tier 2 the water salinity is parts-per-hundred. Tier 3 int main() { Test set #1: double tempC; double tempK; double depth; // Temp in Celcius // Temp in Kelvin // Depth (m) Input: -2.3 411 2.1 Arctic N Output: Based on the following data: temperature of -2.3 degrees C (270.85 K), depth of 411 m, and current speed of 2.1 m/s in the N Arctic Ocean, the water salinity is 13.307 parts-per-hundred. Test set #2: Input: 22.787 1000 0.1224 Indian S Output: Based on the following data: temperature of 22.787 degrees C (295.937 K), depth of 1000 m, and current speed of .1224 m/s in the S Indian Ocean, the water salinity is 20.267 parts-per-hundred. -2- double current; // Current Speed (m/s) double salinity; // Salinity (pph) char ocean [10]; // Ocean name char hemisphere; // Single character for hemisphere (N/S) // Additional variables may be created, but the variables above // must all be used for the indicated purposes. return 0; } -3- EGR 104 Practice Practicum 1 Name: Ocean Salinity Guidelines: 1. Put your name at the top of this document and return it at the end of the exam. 2. Materials provided for reference: ASCII Table, Order of Operations, printf reference, math.h and string.h function lists 3. You are allowed to use your textbook and notes for the exam. This includes submitted homework, labs, and in class assignments. You may not use any other electronic reference material. 4. With about ~10 minutes remaining, you must wrap up what you are doing, and upload your source code to the Blackboard Assignment Manager. 5. Take a deep breath - you can do it! Problem & Instructions: The salinity of the water in the ocean is a function of the water temperature, ocean depth and current speed. Additionally, the salinity is highly dependent upon the particular ocean that is under consideration. Your task today will be to write a program that will serve as an ocean salinity calculator. Given the water temperature T in degrees Kelvin, ocean depth D in meters and current speed C in meters per second, the water salinity S in parts-per-hundred (pph) is given as log 10 10(+D+1)T/223.1 166 S = 33 C+1 + 3.0 where R is the reference salinity for a particular body of water (i.e., a particular ocean). Your task today is to create a program to compute S in pph. You are to query the user to enter the water temperature T in degrees Celsius (you will need to convert 7 temporarily to degrees Kelvin to compute S), ocean depth D in meters and current speed C in meters per second. Assume that the user enters the data correctly and in the correct unit. Furthermore, you are to have the user enter the name of the ocean and a single letter (N or S) to indicate the hemisphere. Follow these detailed instructions: Tier 1 Requirements (Minimum Deliverables to receive a 'C' on the exam): 1. Pay attention to the compiler messages as you go along. Also turn it in on time. Penalties are as follows: Each type of error Each type of warning Each minute late -10 -5 -10 2. (15 pts) Start from the provided template code. Include any additional libraries that are necessary. Use good formatting and style. Match your output to the examples given. 3. (15 pts) Include the usual comment block, including the program name, author, date, class, professor, description, and notes. Include descriptive comments throughout. 4. (10 pts) Prompt user and scan in values for temperature (in Celsius), depth, and speed. (Prompts not shown; use your best judgment.) 5. (10 pts) Print the first line of the output using a custom function. 6. (10 pts) Display the requested output for temperature, depth, and speed. Your output statement must display as shown in the examples. 7. (10 pts) Convert the temp from C to K using a custom function and output as shown. = Temp(K) Temp (C) + 273.15 EGR 104 Practice Practicum 1 Tier 2 Requirements (Minimum Deliverables to receive a 'B' on the exam): 8. (5 pts) Prompt (best judgment) user and scan in the ocean name. 9. (5 pts) Prompt (best judgment) user and scan in the hemisphere (N/S). 10. (5 pts) Print out the hemisphere and ocean name as shown. Tier 3 Requirements (Minimum Deliverables to receive an 'A' on the exam): 11. (5 pts) Create a function to calculate the salinity using the given equation. 12. (5 pts) Use the function to calculate the salinity. 13. (5 pts) Display the salinity and output as shown. EGR 104 Test set #3: Input: Practice Practicum 1 31.5 2.75 12.9875 Pacific N Output: Based on the following data: temperature of 31.5 degrees C (304.65 K), depth of 2.75 m, and current speed of 12.9875 m/s in the N Pacific Ocean, the water salinity is 4.579 parts-per-hundred. Example Input/Output: Below are example test cases with expected output in order to help you validate your code. The input data is listed as T, D, C followed by the ocean name and hemisphere. Overview: Based on the following data: temperature of Starter Code: #include #include // Function prototypes void printFirstLine (void); double convert Ctok (double Celsius); double calcSalinity (double T, double D, double C); degrees C K), Tier 1 depth of m, and current speed of in the m/s Ocean, Tier 2 the water salinity is parts-per-hundred. Tier 3 int main() { Test set #1: double tempC; double tempK; double depth; // Temp in Celcius // Temp in Kelvin // Depth (m) Input: -2.3 411 2.1 Arctic N Output: Based on the following data: temperature of -2.3 degrees C (270.85 K), depth of 411 m, and current speed of 2.1 m/s in the N Arctic Ocean, the water salinity is 13.307 parts-per-hundred. Test set #2: Input: 22.787 1000 0.1224 Indian S Output: Based on the following data: temperature of 22.787 degrees C (295.937 K), depth of 1000 m, and current speed of .1224 m/s in the S Indian Ocean, the water salinity is 20.267 parts-per-hundred. -2- double current; // Current Speed (m/s) double salinity; // Salinity (pph) char ocean [10]; // Ocean name char hemisphere; // Single character for hemisphere (N/S) // Additional variables may be created, but the variables above // must all be used for the indicated purposes. return 0; } -3-
Expert Answer:
Related Book For
Financial Management for Public Health and Not for Profit Organizations
ISBN: 978-0132805667
4th edition
Authors: Steven A. Finkler, Thad Calabrese
Posted Date:
Students also viewed these mechanical engineering questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
You measure 30 textbooks' weights, and find they have a mean weight of 72 ounces. Assume the population standard deviation is 4 ounces. Based on this, construct a 90% confidence interval for the true...
-
Explain why Congress might pass laws against pollution and then not fund the agencies sufficiently to enforce them. Does it surprise you that a pro-business administration might choose to shift...
-
Solve each polynomial equation in Exercises 110 by factoring and then using the zero-product principle. 3x4 = 81x
-
A company decides to send email surveys on its new car polishing spray to random people, asking them to forward it to 10 of their contacts after they are finished. What form of sampling did the...
-
Using the following financial statements for Pamplin, Inc: a. Compute the following ratios for both 2012 and 2013 using the financial statements that follow. Industry Norm Current ratio...
-
Image transcription text 22 21.9615 0.6588 4.0606 0.3248 0.4648 35.1371 0./891 16 15.7412 0.4739 2.6706 0.3107 0.4507 35.1685 0.0258 10 9.9197 0.2982 1.4440 0.2890 0.4291 35.2908 0.0166 6 6.6168...
-
Uranyl ion (UO22+) is commonly used to form heavy-atom derivatives of proteins for X-ray crystallography. Given that the uranyl ion is a relatively hard ion, what sorts of functional groups would you...
-
What type of non-financial information is often used by managers to improve customer satisfaction? Explain.
-
Mr. Tamada, a Japanese Officer for the Toyo Toys Production, is asking for a certain budget list. due to old age, he cannot remember what kind of budget he is asking from the Finance Department. You...
-
Major Motors is compiling a manufacturing overhead budget for one of its assembly lines. It expects to spend the following: Factory rent - $20,000, Depreciation on robots and equipment - $15,000,...
-
Discuss the importance of a professional development plan (PDP). Describe the components of the PDP.
-
1. What is price in accounting, and why is it important? 2. Discuss the relationship between price and demand in accounting. 3. What are the primary factors that influence pricing decisions in...
-
Write a response identifying several search terms/key words you used to gather a number of scholarly resources for each potential topic area as well as potential resources and search engines you used...
-
(a) Prove that form an orthonormal basis for R3 for the usual dot product. (b) Find the coordinates of v = (1, 1, 1)T relative to this basis. (c) Verify formula (5.5) in this particular case. 48-65...
-
If the angle between vectors \(\vec{A}\) and \(\vec{B}\) is \(110^{\circ}\) and if \(A=1.7 \mathrm{~N}\) and \(B=2.0 \mathrm{~m}\), what is the value of \(\vec{A} \cdot \vec{B}\) ?
-
You throw a textbook to a friend who is at their dormitory window \(2.2 \mathrm{~m}\) above you. You are standing \(4.0 \mathrm{~m}\) away from the building and your throw is perfectly made such that...
-
A force \(\vec{F}=F_{x} \hat{\imath}+F_{y} \hat{\jmath}\) with \(F_{x}=50 \mathrm{~N}\) and \(F_{y}=12 \mathrm{~N}\) is exerted on a particle as the particle moves along the \(x\) axis from \(x=1.0...
The Human Rights Of Migrants And Refugees In European Law 1st Edition - ISBN: 0199644748 - Free Book
Study smarter with the SolutionInn App