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
uranmaximum [27]
2 years ago
15

In this lab, you will implement a temperature converter in JavaScript. The user may type a temperature in either the Celsius or

Fahrenheit textbox and press Convert to convert the temperature. An image displays based on the converted temperature. (see the image uploaded here)

Computers and Technology
1 answer:
jek_recluse [69]2 years ago
5 0

Use the knowledge in computational language in JAVA to write a code that convert the temperature.

<h3>How do I convert Celsius to Fahrenheit in Java?</h3>

So in an easier way we have that the code is:

  • Fahrenheit to celsius:

<em>/* When the input field receives input, convert the value from fahrenheit to celsius */</em>

<em>function temperatureConverter(valNum) {</em>

<em>  valNum = parseFloat(valNum);</em>

<em>  document.getElementById("outputCelsius").innerHTML = (valNum-32) / 1.8;</em>

<em>}</em>

  • Celsius to Fahrenheit:

<em>function cToF(celsius) </em>

<em>{</em>

<em>  var cTemp = celsius;</em>

<em>  var cToFahr = cTemp * 9 / 5 + 32;</em>

<em>  var message = cTemp+'\xB0C is ' + cToFahr + ' \xB0F.';</em>

<em>    console.log(message);</em>

<em>}</em>

<em>function fToC(fahrenheit) </em>

<em>{</em>

<em>  var fTemp = fahrenheit;</em>

<em>  var fToCel = (fTemp - 32) * 5 / 9;</em>

<em>  var message = fTemp+'\xB0F is ' + fToCel + '\xB0C.';</em>

<em>    console.log(message);</em>

<em>} </em>

<em>cToF(60);</em>

<em>fToC(45);</em>

See more about JAVA at brainly.com/question/12975450

You might be interested in
Suppose as a computer programmer, you have been assigned a task to develop a program to store the sorted data in ascending order
shepuryov [24]

Answer:

In case the data is arranged in the ascending order, you can always change the Binary search tree into a Height BST, and which is also known as the self-balancing BT. And through this, it's quite on hand to better the operations like searching on the new BST. And these SBBTs are quite commonly made use of for constructing as well as maintaining the ordered list. This is the case in the case of the priority queue, and this is what is required here.

Explanation:

Please check the answer.

3 0
4 years ago
You are planning to depart on a flight from area 2 to area 4 in 12 hours. What weather is forecast to occur along your route?
Andre45 [30]
It depends on where you live!
5 0
2 years ago
Help!!!
Butoxors [25]

Answer:

ummmm try the inequality protragathron theorum

Explanation:

ok

3 0
3 years ago
Which two keys on the keyboard allow an access user to move the insertion point to the next field to the right in datasheet view
Mashcka [7]
Hey there!

In Microsoft Access, you can click the Tab key then the Enter key on your keyboard to establish a new insertion point directly to the right of your current insertion point when entering data in datasheet view. 

Hope this helped you out! :-)
4 0
3 years ago
There are 12 inches in a foot and 3 feet in a yard. Create a class named InchConversion. Its main() method accepts a value in in
Dafna1 [17]

Answer:

import java.util.Scanner;

public class InchConversion

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

   

 System.out.print("Enter inches: ");

 double inches = input.nextDouble();

 

 inchesToFeet(inches);

 inchesToYards(inches);

}

public static void inchesToFeet(double inches){

    double feet = inches / 12;

    System.out.println(inches + " inches = " + feet + " feet");

}

public static void inchesToYards(double inches){

    double yards = inches / 36;

    System.out.println(inches + " inches = " + yards + " yards");

}

}

Explanation:

In the inchesToFeet() method that takes one parameter, inches:

Convert the inches to feet using the conversion rate, divide inches by 12

Print the feet

In the inchesToYards() method that takes one parameter, inches:

Convert the inches to yards using the conversion rate, divide inches by 36

Print the yards

In the main:

Ask the user to enter the inches

Call the inchesToFeet() and inchesToYards() methods passing the inches as parameter for each method

7 0
3 years ago
Other questions:
  • Attention merchants define
    5·1 answer
  • Please answers the questions 1-15
    6·1 answer
  • When you use information hiding by selecting which properties and methods of a class to make public, you are assured that your d
    14·1 answer
  • Where can i watch bnha movie 2 online for free, with no sign up or pay?
    6·2 answers
  • Which method is used for resolving data dependency conflict by the compiler itself?
    6·1 answer
  • 60 POINTS IF YOU GET IT RIGHT
    6·2 answers
  • Why has base 2 been accepted and used as the basis for computing?​
    8·1 answer
  • You decide to test an audio clip that you have inserted into your presentation, but before you do that you make sure that the co
    6·1 answer
  • How does the issue of cybersecurity relate to the internet of things?.
    5·1 answer
  • When viewing an e-book section of an assignment in launchpad, you can return to your main course page at any time by clicking th
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!