Question

Write the JavaScript code for deriving Celsius from Fahrenheit and displaying it in an alert dialog...

Write the JavaScript code for deriving Celsius from Fahrenheit and displaying it in an alert dialog box

Homework Answers

Answer #1

\\HTML CODE

<button id="btn">Begin</button>

\\JavaScript

$(document).ready(function () {

        $("#btn").click(
            function () {
                bl();
            }          
        );
    });

function f2c(inputF)
{
return (inputF - 32) * (5/9);
}

function bl() {
var inputF = 0;
while (inputF != 999) {
var inputF = prompt("Enter degrees in Fahrenheit \n" + "Entering 999 will end the process", "999");
var inputF = parseInt(inputF);
var cdegree = f2c(inputF);
alert("Fahrenheit=" + inputF + "\nCelsius=" + cdegree);
}
    if (inputF == 999) {
        alert("Process Completed");
    }
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Program must be in JAVA. Write a program that converts temperature from Celsius to Fahrenheit or...
Program must be in JAVA. Write a program that converts temperature from Celsius to Fahrenheit or vice versa, depending on user's input. The formula for converting temperature in Celsius to Fahrenheit is, Fahrenheit = (9/5) * Celsius + 32 The formula for converting temperature in Fahrenheit to Celsius is, Celsius = (5/9) * (Fahrenheit – 32) Results should be rounded to two decimal points, e.g., 92.56
Write the below code to use HTML and JavaScript. 1)Write a JavaScript program to create a...
Write the below code to use HTML and JavaScript. 1)Write a JavaScript program to create a new string from a given string changing the position of first and last characters. The string length must be greater than or equal to 1. 2)Write a JavaScript program to check whether a string starts with 'Java' and false otherwise
Pick a favorite JavaScript topic you learned from this course and present a lesson using a...
Pick a favorite JavaScript topic you learned from this course and present a lesson using a page or series of web pages that fully teaches someone who may be interested in learning about that topic, and create a mini website for your tutorial. You must make use of JavaScript code snippets to provide valid examples of proper syntax. Code examples with errors in them will not earn full credit. For your code snippets make use of this JavaScript-based syntax highlighter...
write a verilog code for displaying all "0 to 7" numbers in a seven segment display...
write a verilog code for displaying all "0 to 7" numbers in a seven segment display in ddr board.
Write a program in java that generates a two-column table showing Fahrenheit temperatures from -40F to...
Write a program in java that generates a two-column table showing Fahrenheit temperatures from -40F to 120F and their equivalent Celsius temperatures. Each line in the table should be 5 degrees F more than the previous one. Both the Fahrenheit and Celsius temperatures should be accurate to 1 decimal place. I am not able to use: import java.text.DecimalFormat; Any feedback would be helpful.
C++ Fahrenheit to Celsius Tables Write a program that first asks the user which Temperature scale...
C++ Fahrenheit to Celsius Tables Write a program that first asks the user which Temperature scale conversion he/she would like to perform: 1. Convert F to C 2. Convert C to F 3. Quit What is your choice? Then it asks the user for input for three real number variables: start_temp, end_temp, temp_incr. It will then produce a two column Fahrenheit to Celsius table or a two column Celsius to Fahrenheit table, depending on the choice. For choice 1, the...
Given this array, write some JavaScript code that creates a new variable called "matchingAttendees" containing an...
Given this array, write some JavaScript code that creates a new variable called "matchingAttendees" containing an array with all attendees whose names start with an 'A' or a 'J'. let attendees = [ ["Jim", "Susan", "Emily", "Robert", "Carl"], ["Anthony", "Frank", "Hunter", "Colin", "Amanda"], ["Jenae", "Arthur", "Ronald", "Mary", "Rhonda"]
Complete the following C# code that uses the DisplayPrice() method for displaying one price from the...
Complete the following C# code that uses the DisplayPrice() method for displaying one price from the array of 4 prices. Because the DisplayPrice() method uses an array, an IndexOutOfRangeException might be thrown. Write a try block in which prompt the user for a subscript value and displays the appropriate price value stored in the corresponding array position. Create a catch block that catches any IndexOutOtRangeException, displays an appropriate error message and a price of $0.
Convert values in fvalues array from degree Fahrenheit to degree Celsius and print it import numpy...
Convert values in fvalues array from degree Fahrenheit to degree Celsius and print it import numpy as np fvalues= np.array([[67, 65, 54, 35], [78, 89, 75, 73]]) To convert degree F to degree C - Deduct 32, then multiply by 5, then divide by 9
Write a JavaScript program to create a new string from a given string changing the position...
Write a JavaScript program to create a new string from a given string changing the position of first and last characters. The string length must be greater than or equal to 1. it has to be in (HTML)
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT