Practice Practicum 1 Name: Ocean Salinity Problem & Instructions: The salinity of the water in the ocean is a function of the water temperature, ocean depth and current speed. Additionally, the...


C code, please.


Practice Practicum 1<br>Name:<br>Ocean Salinity<br>Problem & Instructions:<br>The salinity of the water in the ocean is a function of the water temperature, ocean depth and<br>current speed. Additionally, the salinity is highly dependent upon the particular ocean that is<br>under consideration. Your task today will be to write a program that will serve as an ocean<br>salinity calculator.<br>Given the water temperature Tin degrees Kelvin, ocean depth D in meters and current speed C in<br>meters per second, the water salinity S in parts-per-hundred (pph) is given as<br>logD+1)\T/223.1<br>+ R<br>VC+1<br>166<br>S =<br>33<br>where R is the reference salinity for a particular body of water (i.e., a particular ocean).<br>Your task today is to create a program to compute S in pph. You are to query the user to enter the<br>water temperature T in degrees Celsius (you will need to convert T temporarily to degrees Kelvin<br>to compute S), ocean depth D in meters and current speed C in meters per second. Assume that<br>the user enters the data correctly and in the correct units (no error checking on the data format is<br>necessary). Furthermore, you are to input a single character that will be used to indicate the<br>reference salinity R for a particular body of water. The choices for reference salinity are the<br>following: P for the Pacific Ocean, A for the Atlantic Ocean, I for the Indian Ocean, S for the<br>Southern Ocean and R for the Arctic Ocean. Allow the user to enter either upper or lower case<br>letters. Furthermore, in the event that the user does not enter a correct character denoting one of<br>the given oceans, you are to assume that they meant the Pacific Ocean. Based upon the character<br>the user enters, you will need to choose the correct value for the reference salinity R.<br>Reference Data:<br>Table 1: Ocean Reference Salinity in pph<br>Осean<br>Reference Salinity (pph)<br>Pacific<br>3.0<br>Atlantic<br>3.5<br>Indian<br>4.0<br>Southern<br>2.1<br>Arctic<br>2.3<br>Тетр(°К) — Тетp(°C) + 273. 15<br>

Extracted text: Practice Practicum 1 Name: Ocean Salinity 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 Tin 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 logD+1)\T/223.1 + R VC+1 166 S = 33 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 T 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 units (no error checking on the data format is necessary). Furthermore, you are to input a single character that will be used to indicate the reference salinity R for a particular body of water. The choices for reference salinity are the following: P for the Pacific Ocean, A for the Atlantic Ocean, I for the Indian Ocean, S for the Southern Ocean and R for the Arctic Ocean. Allow the user to enter either upper or lower case letters. Furthermore, in the event that the user does not enter a correct character denoting one of the given oceans, you are to assume that they meant the Pacific Ocean. Based upon the character the user enters, you will need to choose the correct value for the reference salinity R. Reference Data: Table 1: Ocean Reference Salinity in pph Осean Reference Salinity (pph) Pacific 3.0 Atlantic 3.5 Indian 4.0 Southern 2.1 Arctic 2.3 Тетр(°К) — Тетp(°C) + 273. 15
Practice Practicum 1<br>Follow these detailed instructions:<br>1. Start from the provided template code. Include any additional libraries that are<br>necessary. Use good formatting and style. Match your output to the examples given.<br>2. Include the usual comment block, including the program name, author, date, class,<br>professor, description, and notes. Include descriptive comments throughout.<br>3. Prompt user and scan in values for temperature (in Celsius), depth, and speed.<br>4. Display the requested output for temperature, depth, and speed. Your output<br>statement must display as shown in the examples (note spelling, punctuation, newlines, and<br>lack of trailing zeros):<br>5. Convert the temperature from Celsius to Kelvin and output as shown.<br>6 Prompt user and scan in character for ocean name.<br>а.<br>The user indicates the ocean choice by entering one of five characters. Assume that<br>the user may enter upper case or lower case letters. In the event that the user does not<br>enter one of the five letter choices but something else, use the reference salinity for<br>the Pacific Ocean. Otherwise, based on their entry, use the proper value for R.<br>7. Assign the correct reference salinity and print the ocean name.<br>а.<br>Write out the name of the Ocean (Pacific, Atlantic, Southern, Arctic or<br>Indian) that corresponds to the character the user entered. In the case where the<br>user's ocean choice did not match any of the available options, write out Unknown,<br>using Pacific for that field.<br>8. Calculate the salinity using the given equation.<br>9. Display the salinity and output as shown.<br>- 3 -<br>

Extracted text: Practice Practicum 1 Follow these detailed instructions: 1. 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. 2. Include the usual comment block, including the program name, author, date, class, professor, description, and notes. Include descriptive comments throughout. 3. Prompt user and scan in values for temperature (in Celsius), depth, and speed. 4. Display the requested output for temperature, depth, and speed. Your output statement must display as shown in the examples (note spelling, punctuation, newlines, and lack of trailing zeros): 5. Convert the temperature from Celsius to Kelvin and output as shown. 6 Prompt user and scan in character for ocean name. а. The user indicates the ocean choice by entering one of five characters. Assume that the user may enter upper case or lower case letters. In the event that the user does not enter one of the five letter choices but something else, use the reference salinity for the Pacific Ocean. Otherwise, based on their entry, use the proper value for R. 7. Assign the correct reference salinity and print the ocean name. а. Write out the name of the Ocean (Pacific, Atlantic, Southern, Arctic or Indian) that corresponds to the character the user entered. In the case where the user's ocean choice did not match any of the available options, write out Unknown, using Pacific for that field. 8. Calculate the salinity using the given equation. 9. Display the salinity and output as shown. - 3 -
Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here