Question

Programming Language: C# We all know that water can exist in solid, liquid and gaseous form....

Programming Language: C#

  1. We all know that water can exist in solid, liquid and gaseous form. Using Visual Studios Write a program that inputs the temperature for water in degrees Celsius, converts the temperature to degrees Fahrenheit according to the formula F = 9.0/5.0 * C + 32.0 and then prints both temperatures to a list box, message box or text box(s). In addition, the program will print the form of water (solid, solid or liquid, liquid, liquid or gas, gas.) at that temperature under normal conditions on earth.

For example: if 30 degrees C is entered the output will be: 30 degrees Celsius equals 86 degrees Fahrenheit. Water at this temperature is a liquid.

NOTE:

  • Water can be liquid or solid at 0.0 degrees C
  • Water is solid at temperatures less than 0.0 degrees C
  • Water can be a liquid or gas at 100 degrees C
  • Water is a gas at temperatures greater than 100.0 degrees C

Test the program with the following temperatures C: -5.5, 0.0, 50.0, 100.0, and 110.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The code for the temperature conversion into Fahrenheit from Celcius is as below :

 using System;                                        public class Program {         public static void Main()       {               Console.WriteLine("Enter temperature in Celcius: ");            float cel = float.Parse(Console.ReadLine());    // taking user input of celcius                                 float far = (9.0f/5.0f)*cel + 32.0f;                            Console.WriteLine(cel +" degrees Celsius equals " + far + " degrees Fahrenheit.");                              if (cel < 0.0)               {                       Console.WriteLine("Water is solid at this temperature");                }               else if(cel == 0.0)             {                       Console.WriteLine("Water can be liquid or solid at this temperature");          }               else if(cel>0.0 && cel < 100.0)           {                       Console.WriteLine("Water is liquid at this temperature");               }               else if(cel==100.0)             {                       Console.WriteLine("Water can be liquid or gas at this temperature");            }               else            {                       Console.WriteLine("Water is gas at this temperature");          }       } }

This code will run for the input temperature -5.5 as :

Enter temperature in Celcius: -5.5 -5.5 degrees Celsius equals 22.1 degrees Fahrenheit. Water is solid at this temperature

This code will run for the input temperature 0.0 as :

Enter temperature in Celcius: 0.0 0 degrees Celsius equals 32 degrees Fahrenheit. Water can be liquid or solid at this temperature

This code will run for the input temperature 50.0 as :

Enter temperature in Celcius: 50.0 50 degrees Celsius equals 122 degrees Fahrenheit. Water is liquid at this temperature

This code will run for the input temperature 100.0 as :

Enter temperature in Celcius: 100.0 100 degrees Celsius equals 212 degrees Fahrenheit. Water can be liquid or gas at this temperature

This code will run for the input temperature 110.0 as:

Enter temperature in Celcius: 110.0 110 degrees Celsius equals 230 degrees Fahrenheit. Water is gas at this temperature

Summary:

Hence the above code in C# will run as desired for all the inputs.

Add a comment
Know the answer?
Add Answer to:
Programming Language: C# We all know that water can exist in solid, liquid and gaseous form....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • "igure 1.2 Comparison of the Three Common Temperature Scales 373K 100°C 212F - Water Boils 100...

    "igure 1.2 Comparison of the Three Common Temperature Scales 373K 100°C 212F - Water Boils 100 degrees — 100 degrees 180 degrees 98.6°F Normal Body Temperature - Water Freezes 273K 0°C 327 Kelvin Celsius Fahrenheit Graphical Question 1.2 The following Celsius vs. Fahrenheit data is obtained. 0.0 10.0 25.0 100.0 32.0 50.0 77.0 212.0 Using excel plot the data and determine the equation that relates Fahrenheit to Celsius.

  • Solid carbon can react with gaseous water to form carbon monoxide gas and hydrogen gas. The...

    Solid carbon can react with gaseous water to form carbon monoxide gas and hydrogen gas. The equilibrium constant for the reaction at 700.0 KK is Kp=1.60×10−3Kp=1.60×10−3. If a 1.55-LL reaction vessel initially contains 249 torr of water at 700.0 K in contact with excess solid carbon, find the percent by mass of hydrogen gas of the gaseous reaction mixture at equilibrium.

  • Java program Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit....

    Java program Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating- point number for the temperature and a character for the scale, eitherでfor Celsius or 'F' for fahrenheit. The class should have Four constructors: one for the number of degrees, one for the scale, one for both the degrees and scale, and a default constructor. For each of these constructors, assume zero degrees if no value is specified and celsius if no...

  • Solid carbon can react with gaseous water to form carbon monoxide gas and hydrogen gas. The...

    Solid carbon can react with gaseous water to form carbon monoxide gas and hydrogen gas. The equilibrium constant for the reaction at 700.0 K is Kp=1.60×10−3. If a 1.55-L reaction vessel initially contains 174 torr of water at 700.0 K in contact with excess solid carbon, find the percent by mass of hydrogen gas of the gaseous reaction mixture at equilibrium. Please show step by step solutions. Thank you!

  • 16. Consider the combustion of solid sucrose (C12H22O11), to form liquid water and a gaseous product....

    16. Consider the combustion of solid sucrose (C12H22O11), to form liquid water and a gaseous product. a) Write & balance the equation, including phases. b)If 2.001 g of sucrose reacts with 1.00 L of O2 at 753 torr and 25.8 °C, how many grams of liquid water are theoretically formed? c) Assign oxidation numbers to each element in the reaction. d) Which substance undergoes oxidation? Reduction? e) Identify the oxidizing and reducing agents.

  • you decided to investigate how much energy it would take to get solid acetone to gaseous...

    you decided to investigate how much energy it would take to get solid acetone to gaseous acetone. So assuming you took 125 g of -100 degree Celsius solid acetone and heated it 56 degree Celsius gaseous acetone, how many joules of energy would be required to do this? Acetone has a melting point of -95 degree Celsius and a boiling point of 56 degrees Celsius. The heat of fusion (melting) is 98 j/g and the heat of vaporization is 538.9...

  • Review | Constants Periodic Table Solid carbon can react with gaseous water to form carbon monoxide...

    Review | Constants Periodic Table Solid carbon can react with gaseous water to form carbon monoxide gas and hydrogen gas. The equilibrium constant for the reaction at 700.0 K is 1.6x10-3Kp. Part A If a 1.55-L reaction vessel initially contains 120 torr of water at 700.0 K in contact with excess solid carbon, find the percent by mass of hydrogen gas of the gaseous reaction mixture at equilibrium. VO ALQ * 0 2 ? m H2 MHz +mco+mH2O Submit Previous...

  • II Review | Constants 1 Periodic Table Solid carbon can react with gaseous water to form...

    II Review | Constants 1 Periodic Table Solid carbon can react with gaseous water to form carbon monoxide gas and hydrogen gas. The equilibrium constant for the reaction at 700.0 K is 1.6x10-Kp. Part A If a 1.55-L reaction vessel initially contains 110 torr of water at 700.0 K in contact with excess solid carbon, find the percent by mass of hydrogen gas of the gaseous reaction mixture at equilibrium. V ACO O 2 ? m2 ma, tmco+ma1,0 = mH2...

  • C++ requirements All values must be read in as type double and all calculations need to...

    C++ requirements All values must be read in as type double and all calculations need to be done using type double. For part 2 you MUST have at least 4 functions, including main. The main function will be the driver of the program. It needs to either do the processing or delegate the work to other functions. Failure to follow the C++ requirements could reduce the points received from passing the tests. General overview This program will convert a set...

  • Please Read it all and carefully In visual basic(vba)do the following program Summary INGE Industry, Inc....

    Please Read it all and carefully In visual basic(vba)do the following program Summary INGE Industry, Inc. needs a program in which the date and temperature in Celsius degrees of an industry laboratory are recorded and stored in a sequential file. In addition, you can see the recorded data and convert the temperatures in the following units: Fahrenheit, Kelvin and Rankine. In addition, they want to see a linear graph that reflects how the temperature has fluctuated day by day, for...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT