Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Algorithm

We already have an algorithm for Patient Temperature. It will not change.

The Algorithm for Patient Temperature:

  1. get the temperature
    • implementation: with a prompt box before, now it will come from a widget
  2. assess it with conditionals and variables
    • implementation: pretty much the same as before
  3. output a user-friendly message
    • implementation: with an alert box or text before, now some text and images

Your Mission

For each of the two if-statements:   

  1. replace false  with the correct conditional expressions for this program to make sense.
  2. change each of the three images by finding new urls.

<!DOCTYPE html><html><body>

90°<input type="range" min="90" max="110" id="temperature" step=.1 oninput="changeTemp()">110°
<p id="assessmentText">Move the slider</p>
<img id="assessmentImage" width=50 src='https://www.maxpixel.net/static/photo/1x/Questions-Puzzle-Cartoon-Consider-Smiley-3082809.png'>


<script>
const temperatureFever = 99.5 ; // maximum
const temperatureHypothermia = 95 ; // minimum
const imageFever='https://cdn.pixabay.com/photo/2018/12/24/17/07/catch-a-cold-3893262_960_720.png';
const imageHypothermia='https://cdn.pixabay.com/photo/2018/12/19/20/23/samuel-3884706_960_720.png';
const imageNormal='https://cdn.pixabay.com/photo/2019/02/19/19/45/thumbs-up-4007573_960_720.png';

function changeTemp() { // Automatically happens when the slider
// Algorithm step 1: get the temperature
// Implementation: get it from the range finder:
var userResponse=document.getElementById("temperature").value;
var assessmentText='?';
var assessmentImage='';

// Algorithm step 2: assess
// Implementation: not much different than before
if ( false ) {
assessmentText=" Hypothermia";
assessmentImage=imageHypothermia;
}
else if (false) {
assessmentText=" Fever";
assessmentImage=imageFever;
}
else {
assessmentText=" Normal";
assessmentImage=imageNormal;
}
// Algorithm step 3: display user-friendly output
// Implementation: using variables makes this code work every time
document.getElementById('assessmentText').innerHTML=userResponse+'° '+assessmentText;
document.getElementById('assessmentImage').src=assessmentImage;
}
</script></body></html>

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education