1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Naily [24]
3 years ago
9

Create a winform application that lets the user enter a temperature. With a ComboBox object offer the user three choices for inp

ut type: Farenheit, Celsius, and Kelvin. Offer the same three choices for the output type. Now when the user clicks the Calculate button, convert them temp and show the user the results.

Computers and Technology
1 answer:
Molodets [167]3 years ago
5 0

Answer:

See explaination

Explanation:

//namespace

using System;

using System.Windows.Forms;

//application namespace

namespace TemperatureConversionApp

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

//calculate button click

private void btnCalculate_Click(object sender, EventArgs e)

{

//taking temperature type

string temperatureType = cmbTemperatureType.SelectedItem.ToString();

//taking temperature entered by user

double temperature = double.Parse(txtTemperature.Text);

//taking conversion temperature type

string conversionType = cmbConversionType.SelectedItem.ToString();

//checking temperature type and conversion type

if(temperatureType == "Farenheit" && conversionType == "Celsius")

{

//if Farenheit to Celsius temperature then

double temp = (temperature - 32) * 5 / 9;

//display on the label

lblDetails.Text = temperature.ToString("0.00") + " Farenheit is " + temp.ToString("0.00") + " Celsius";

}

else if (temperatureType == "Farenheit" && conversionType == "Kelvin")

{

//if Farenheit to Kelvin temperature then

double temp = (temperature - 32) * 5 / 9+273.15;

//display on the label

lblDetails.Text = temperature.ToString("0.00") + " Farenheit is " + temp.ToString("0.00") + " Kelvin";

}

else if (temperatureType == "Celsius" && conversionType == "Kelvin")

{

//if Celsius to Kelvin temperature then

double temp = temperature + 273.15;

//display on the label

lblDetails.Text = temperature.ToString("0.00") + " Celsius is " + temp.ToString("0.00") + " Kelvin";

}

else if (temperatureType == "Celsius" && conversionType == "Farenheit")

{

//if Celsius to Farenheit temperature then

double temp = (temperature*9/5) +32;

//display on the label

lblDetails.Text = temperature.ToString("0.00") + " Celsius is " + temp.ToString("0.00") + " Farenheit";

}

else if (temperatureType == "Kelvin" && conversionType == "Farenheit")

{

//if Kelvin to Farenheit temperature then

double temp = (temperature-273.15) * 9 / 5 + 32;

//display on the label

lblDetails.Text = temperature.ToString("0.00") + " Kelvin is " + temp.ToString("0.00") + " Farenheit";

}

else if (temperatureType == "Kelvin" && conversionType == "Celsius")

{

//if Kelvin to Celsius temperature then

double temp = temperature - 273.15;

//display on the label

lblDetails.Text = temperature.ToString("0.00") + " Kelvin is " + temp.ToString("0.00") + " Celsius";

}

else

{

lblDetails.Text = "Select valid temperature conversion unit";

}

}

//Exit button click

private void btnExit_Click(object sender, EventArgs e)

{

this.Close();//close application

}

}

}

check attachment for the windows application

You might be interested in
True / False
blagie [28]

Answer: True

Explanation:

Variable length instructions generally implemented by CISC processors use memory more efficiently than fixed length instruction of RISC processors sets because CISC supports array whereas RISC does not. Also CISC uses more complex addressing modes which consumes less memory cycles and the the program is also reduces. In Fixed length instruction in RISC processor the simple instructions has to be used a number of time which leads to more memory cycles.

7 0
4 years ago
I will give the brainly or whatever its called
igomit [66]

Answer:

Just answer everyones questions and youll be at the right rank in no time

Explanation:

5 0
3 years ago
Read 2 more answers
Which of these is a physical health benefit provided by playing team sports? A. a spiritual connection to others B. lower choles
AfilCa [17]

Answer:

B. lowering cholesterol

Explanation:

Edge 2021, made a 100 on the quiz. Good luck :)

3 0
3 years ago
Read 2 more answers
n 3 to 4 sentences, write a note to a friend describing how to move text from one part of a document to a different part of the
EleoNora [17]
Select the part you want to move.  Highlight it, and click ctrl+x.  Then, go to the place you want to put it.  Click ctrl+v.  It should be cut and pasted
8 0
3 years ago
Read 2 more answers
The storage device which is not usually used as secondary storage is 1 point a) Semiconductor Memory b) Magnetic Disks c) Magnet
marshall27 [118]

Answer:

a) Semiconductor Memory

Explanation:

A primary storage device is a medium that holds memory for short periods of time while a computer is running

Semiconductor devices are preferred as primary memory.

ROM, PROM, EPROM, EEPROM, SRAM, DRAM are semiconductor (primary) memories.

7 0
3 years ago
Other questions:
  • Protected base class members cannot be accessed by: a.friends of the base class.
    6·1 answer
  • In 3-4 sentences, write a note to a friend describ
    6·2 answers
  • Which is an internet service? <br> A.) antivirus <br> B.) chat <br> C.) firewall<br> D.) router
    6·2 answers
  • Which of the following is the largest measurement for the weight of a bag of dog food?
    9·2 answers
  • Write a method that takes a Rectangle as a parameter, and changes the width so it becomes a square (i.e. the width is set to the
    8·1 answer
  • A machine that converts energy to useful work.
    9·2 answers
  • You arrive at school on Friday for a field trip ! What a lucky day!You need to figure out what room you are in before leaving. Y
    12·1 answer
  • Some elementary particles are positively or negatively
    11·2 answers
  • Descending selection sort with output during execution
    12·1 answer
  • What do you think is the most effective way to ensure that code adheres to good coding standards.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!