Please answer the questions using plain HTML, CSS, flexbox and Javascript to the
ID: 3719755 • Letter: P
Question
Please answer the questions using plain HTML, CSS, flexbox and Javascript to the extent that you can (avoid JQuery and other layout frameworks; four languages is plenty for one test!). Also avoid using the innerHTML property; change the DOM by adding, removing or modifying its nodes, and change text using the textContent property.
6. (15 pts) Here is the constructor of a Javascript object that contains a day's weather. Add a publicly callable method that returns the temperature in Celsius, so that we get the behavior at the bottom Recall that Celsius (Fahrenheit 32) *5/9. function Weather( t, w)f this.fahrenheit t; // temperature in fahrenheit this.wind - w; davisWeather - new Weather (77, 22); console.log( davisWeather.celsius) );// prints 25Explanation / Answer
function Weather(t, w) {
this.fahrenheit = t; // themerature in fahrenheit
this.wind = w;
this.celcius = function() {
return (this.fahrenheit - 32)*5.0/9;
}
}
davisWeather = new Weather(77, 22);
console.log(davisWeather.celcius());
25