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 Matlab function convert T such that convert T(x, ’C’) converts from degrees Celsius to...
Write a Matlab function convert T such that convert T(x, ’C’) converts from degrees Celsius to degrees Fahrenheit, while convert T(x, ’F’) converts from Fahrenheit to Celsius. Need to submit program online to see if successful. Please help! function T = convert_T (x, flag) %convert between Celsius and Fahrenheit temperatures %for example, convert_T(10, 'C') should return 50 %and convert_T(50, 'F') should return 10
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.
Use visual studio code to write the javascript programme. Write a function that counts the number...
Use visual studio code to write the javascript programme. Write a function that counts the number of values each item attribute has. This is effectively a group-by on the item table for each column. For example: if the first attribute is colour, and its values are [ ‘red’, ‘black’, ‘white’, ‘black’, ‘red’ ], the counts for colour would be: red 2 black 2 white 1
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...
3. Write a JavaScript code that print 3 color (yellow, black, red). You should create an...
3. Write a JavaScript code that print 3 color (yellow, black, red). You should create an array that has all the color then use a loop to print the array.
Use visual studio code to write the javascript programme. For this lab you must use a...
Use visual studio code to write the javascript programme. For this lab you must use a reasonable faceted search example, each item must have at least three categorical attributes and at least one numeric attribute. Attributes such as ID, name etc do not count as categorical or numeric attributes. (a) Define a class for your item that meets the above three categorical and one numeric attribute requirements. (b) Create a text file that contains at least 5 such records in...