Question
C# SAMPLE CODE: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SimpleTempConversion { /* Class to convert Celsius temperature to Fahrenheit * Author ....
C# SAMPLE CODE:
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SimpleTempConversion { /* Class to convert Celsius temperature to Fahrenheit * Author .... * Date: July 2015 */ class CelsiusToFahrenheit { public static void Main() { double celsius = 0.0; //input the temperature in degrees Celsius Console.Write("Enter degrees Celsius: "); celsius = int.Parse(Console.ReadLine());
// Calculate degrees Fahrenheit and output the result Console.WriteLine(" The equivalent in Fahrenheit is " + celsius/5 * 9 + 32);
Console.WriteLine(" Hit Enter to exit."); Console.ReadLine(); } } }
The source code for the program is given below. It is a simple program that takes a temperature in degrees Celsius from the user and displays the same temperature in degrees Fahrenheit; the reverse of a program you wrote for last week's AMS exercises The code contains no input validation. The only requirement is that, if you enter a valid number, it should display the correct converted temperature This is an example of what the program should do when you run it: nter degrees Celsius 100 he equivalent in Fahrenheit is 212 Hit Enter to exit
Step 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