Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this unit, you will complete a program to demonstrate the skills presented in this lesson using C# . Please keep in mind that with
In this unit, you will complete a program to demonstrate the skills presented in this lesson using C# Please keep in mind that with all the assignments in this course, any given scenarios are hypothetical and intended solely to demonstrate specific skills. In this hypothetical scenario your local weather office needs a temporary solution to take a temperature in Celsius, convert it to Fahrenheit, and issue a general statement or warning based on that temperature. You will build two separate functions. The first will accept the Celsius value and return the temperature in Fahrenheit and the second will accept the Fahrenheit temperature value and use it to determine the appropriate public statement. Another programmer will be writing the GUI. Your role is to create the two functions and test them using six decimal values stored in four different variables. Assignment Requirements Define six variables of appropriate data type and assign them the following values: notice this last value is negative one Write a function that will accept a decimal value representing the Celsius temperature, convert the value to Fahrenheit, and return that Fahrenheit value as a rounded integer value. Hint : The formula to convert from C to F is TempF TempC Hint : An easy way to round integer values is to add to the decimal value before converting it to integer. Write a function that will accept an integer value representing the temperature in Fahrenheit. The function will check the value and determine the correct weather statement to return as a string value. The criteria for these statements are as follows: F A heat advisory has been issued. F to F Pleasant but warm. F to F Very pleasant weather today. F to F Pleasant but cool. F to F Cold weather. F A freeze warning has been issued. For each test variable, call the conversion function followed by a call to the weather statement function. After each call, display to the console the temperature in Celsius and in Fahrenheit followed by the appropriate weather statement as determined by the function.
In this unit, you will complete a program to demonstrate the skills presented in this lesson using C# Please keep in mind that with all the assignments in this course, any given scenarios are hypothetical and intended solely to demonstrate specific skills.
In this hypothetical scenario your local weather office needs a temporary solution to take a temperature in Celsius, convert it to Fahrenheit, and issue a general statement or warning based on that temperature.
You will build two separate functions. The first will accept the Celsius value and return the temperature in Fahrenheit and the second will accept the Fahrenheit temperature value and use it to determine the appropriate public statement. Another programmer will be writing the GUI. Your role is to create the two functions and test them using six decimal values stored in four different variables.
Assignment Requirements
Define six variables of appropriate data type and assign them the following values: notice this last value is negative one
Write a function that will accept a decimal value representing the Celsius temperature, convert the value to Fahrenheit, and return that Fahrenheit value as a rounded integer value.
Hint : The formula to convert from C to F is TempF TempC
Hint : An easy way to round integer values is to add to the decimal value before converting it to integer.
Write a function that will accept an integer value representing the temperature in Fahrenheit. The function will check the value and determine the correct weather statement to return as a string value. The criteria for these statements are as follows:
F A heat advisory has been issued.
F to F Pleasant but warm.
F to F Very pleasant weather today.
F to F Pleasant but cool.
F to F Cold weather.
F A freeze warning has been issued.
For each test variable, call the conversion function followed by a call to the weather statement function. After each call, display to the console the temperature in Celsius and in Fahrenheit followed by the appropriate weather statement as determined by the function.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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