I could really use some help with the question below! Must use C# and please mak
ID: 3832261 • Letter: I
Question
I could really use some help with the question below!
Must use C# and please make it simple as I am a beginner! Also it must be a form application. Thanks a million!!
(Celsius to Fahrenheit and vice versa)
Implement the following Celsius to Fahrenheit conversion (and vice versa)
Use WinForm application.
Use two buttons (C->F and F->C), input Textbox and output label.
You must use integer methods:
a) Method Celsius returns the Celsius equivalent of a Fahrenheit temperature, using thecalculation
c = 5.0 / 9.0 * ( f - 32 );
b) Method Fahrenheit returns the Fahrenheit equivalent of a Celsius temperature, usingthe calculation
f = 9.0 / 5.0 * c + 32;
c) Use the methods from parts (a) and (b) to write an app that enables the user either to
enter a Fahrenheit temperature and display the Celsius equivalent or to enter a Celsius
temperature and display the Fahrenheit equivalent.
d) you MUST validate user for presence of numbers and their range (-100 +800).
e) Add MessageBox for error handling.
f) Use Mnemonics
(Celsius to Fahrenheit and vice versa with radiobauttons and image)
-Same as above but with radio buttons to select which way to convert
-Add a background image.
Explanation / Answer
#include
int main()
{
int mybday = 20; //declare variable to be guessed
int guess; //declare variable to store guessed date
int max = 31; //declare variable to test for invalid input
int min = 1; //declare variable to test for invalid input
printf("Try to guess the day of my Birthday: "); //display the intro and
scanf("%d",&guess); //`get the users guess and store it in the
if (guess == mybday)
{
printf("OK Fine! You got it! "); //print you win if guess is correct
}
else if (guess < min)
{
printf("Kwani is that a DATE?"); //print `Error for invalid input
scanf("%d",&guess);
}
else if (guess > max)
{
printf("There isn't %d days in a month!",guess); //print Error for
}
else if (guess > mybday)
{
printf("Am Not That OLD!"); //print too high if guess is above answer
}
else if (guess < mybday)
{
printf("Hey! Am Not That YOUNG!"); //print too low if guess is below answer
}
else
{
printf("Looser!!"); //Print try again if guess if all else is not
}
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.