Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create the application describe below. Be sure to follow all of the instructions

ID: 3562723 • Letter: C

Question

Create the application describe below. Be sure to follow all of the instructions provided. Project 8-1: Temperature Converter User interface Web Interface.JPG Operation This application allows the user to select the type of temperature conversion. If the user selects one of the radio buttons, this application disables the text box that's used to display the results of the calculation, it enables the text box that's used to get data from the user, and it removes any data from both text boxes. This application displays the converted temperature in the disabled text box when the user clicks on the Convert button. Specifications The formula for converting temperatures from Fahrenheit to Celsius is: c = (f-32) * 5/9 The formula for converting temperatures from Celsius to Fahrenheit is: f = c * 9/5 + 32 This application should accept decimal entries like 77.5, but it should round the result of the conversion to the nearest integer value. This application should validate data to make sure that the user enters a valid number for the conversion. Note To disable or enable a text box, you can set its disabled property to true or false.

index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Temperature Converter</title>
<link rel="stylesheet" type="text/css" href="default.css" />
<script type="text/javascript" src="convert_temp.js"></script>
</head>
<body>
<div id="content">
<h1>Convert temperature</h1>
  
<input type="radio" name="conversion_type" id="to_celcius" checked="checked" />From Fahrenheit to Celcius<br />
<input type="radio" name="conversion_type" id="to_fahrenheit" />From Celcius to Fahrenheit<br />
<br />

<label>Degrees Fahrenheit:</label>
<input type="text" id="degrees_fahrenheit" class="disabled" /><br />
<label>Degrees Celcius:</label>
<input type="text" id="degrees_celcius" disabled="disabled" class="disabled"/><br />
<br />
  
<input type="button" id="convert" value="Convert" /><br />
<br />
</div>
</body>
</html>

convert_temp.js

var $ = function (id) { return document.getElementById(id); }

default.css

body {
font-family: Arial, Helvetica, sans-serif;
background: #666666;
}

#content {
width: 450px;
margin: 10px auto;
padding: 5px 20px;
background: #FFFFFF;
border: 1px solid #000000;
}

h1 {
font-size: 140%;
}

label {
display: block;
width: 10em;
padding-right: 1em;
float: left;
}

input, label {
display: block;
float: left;
}

.disabled {
color: #000000;
}

br {
clear: left;
}

Explanation / Answer

Hear is the code You are Looking For.

And Output is.

=== Converting Temperature ===

Enter 1 for Fahrenheit to Celsius
Enter 2 for Celsius to Fahrenheit Something else to Exit.
Your Option:1

Enter a degree in Fahrenheit:200

200.0 Fahrenheit is 93.33333333333334 celsius

Enter 1 for Fahrenheit to Celsius
Enter 2 for Celsius to Fahrenheit Something else to Exit.
Your Option:2

Enter a degree in Celsius:8754

8754.0 celsius is 15789.2 Fahrenheit

Enter 1 for Fahrenheit to Celsius
Enter 2 for Celsius to Fahrenheit Something else to Exit.
Your Option:3

Bye..

Hear is the code You are Looking For.

  package stackoverflow.java.Answers;    /*  Program for  http://stackoverflow.com/questions/18971591/converting-celsius-to-fahrenheit-using-variables-c-or-f  */    import java.util.Scanner;    public class Temp_Convert{        public static void main(String[] args) {          // TODO Auto-generated method stub          print(" === Converting Temperature === ");          convertTemperature();      }        private static void convertTemperature() {          // TODO Auto-generated method stub          Scanner input = new Scanner(System.in);          print(" Enter 1 for Fahrenheit to Celsius"                  + " Enter 2 for Celsius to Fahrenheit"                  + " Something else to Exit." + " Your Option:");          int selection = input.nextInt();          if (selection == 1) {              print("Enter a degree in Fahrenheit:");              far2cel();          } else if (selection == 2) {              print("Enter a degree in Celsius:");              cel2far();          } else {              print("Bye..");          }      }        private static void cel2far() {          // TODO Auto-generated method stub          Scanner input = new Scanner(System.in);          Double celsius = input.nextDouble();          print(celsius + " celsius is " + ((celsius * 9 / 5.0) + 32)                  + " Fahrenheit");          convertTemperature();      }        private static void far2cel() {          // TODO Auto-generated method stub          Scanner input = new Scanner(System.in);            Double Fahrenheit = input.nextDouble();          print(Fahrenheit + " Fahrenheit is " + ((Fahrenheit - 32) * (5 / 9.0))                  + " celsius");          convertTemperature();      }        private static void print(String string) {          // TODO Auto-generated method stub          System.out.print(" " + string);      }  }  

And Output is.

=== Converting Temperature ===

Enter 1 for Fahrenheit to Celsius
Enter 2 for Celsius to Fahrenheit Something else to Exit.
Your Option:1

Enter a degree in Fahrenheit:200

200.0 Fahrenheit is 93.33333333333334 celsius

Enter 1 for Fahrenheit to Celsius
Enter 2 for Celsius to Fahrenheit Something else to Exit.
Your Option:2

Enter a degree in Celsius:8754

8754.0 celsius is 15789.2 Fahrenheit

Enter 1 for Fahrenheit to Celsius
Enter 2 for Celsius to Fahrenheit Something else to Exit.
Your Option:3

Bye..

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote