New Perspectives On Html5, Css3, And Javascript, Loose-leaf Version
New Perspectives On Html5, Css3, And Javascript, Loose-leaf Version
6th Edition
ISBN: 9781337685764
Author: Patrick M. Carey
Publisher: Cengage Learning
bartleby

Concept explainers

Question
Book Icon
Chapter 11, Problem 5CP2

a)

Program Plan Intro

To create a function named buttonClick ()to change the appearance of the calculator window when the user clicks the calculator button. Create a variable named calcValueand initialize it withthe value of the window text area box in the mt_calc.jsfile.

b)

Program Plan Intro

To create a variable named calcDecimaland initialize it with the value of the decimal input box in the mt_calc.jsfile.

c)

Program Plan Intro

To create anattribute variable named buttonValueand initialize it with the value of the event object target in the mt_calc.jsfile.

d)

Program Plan Intro

To create a switch-case structure for the variable named buttonValuein the mt_calc.js file

  • To delete the content of the variable named calcValueand set its value to the empty text string for the"del"value of the variable named buttonValue.
  • To erase thelast character of the variable named calcValueusing the eraseChar () function for the"bksp"value of the variable named buttonValue.
  • To change the content of the variable named calcValueto" = " + evalEq(calcValue, calcDecimal) + "\n";to calculate the value of the current expression for the"enter"value of the variable named buttonValue.
  • To copy thelast equation using the lastEq ()function usingvalue of the variable named calcValueas parameter for the"prev"value of the variable named buttonValue.
  • Otherwise, append the calcValue + buttonValuevalue to the variable named calcValue.

e)

Program Plan Intro

To set the value of the text area box of the calcWindowto the value of the variable named calcValuein the mt_calc.js file

f)

Program Plan Intro

To put the cursor focus within the calculator window by running the command document.getElementById("calcWindow").focus();in the mt_calc.js file

Blurred answer
Students have asked these similar questions
se Problem 1 Data Files needed for this Case Problem: sp_home_txt.html, sp_layout_txt.css, 2 CSS files, 11 PNG files Slate & Pencil Tutoring Karen Cooke manages the website for Slate & Pencil Tutoring, an online tutoring service for high school and college students. Karen is overseeing the redesign of the website. do you have this solution?
Case Problem 1 Data Files needed for this Case Problem: sp_home_txt.html, sp_layout_txt.css, 2 CSS files, 11 PNG files Slate & Pencil Tutoring Karen Cooke manages the website for Slate & Pencil Tutoring, an online tutoring service for high school and college students. Karen is overseeing the redesign of the website and has  do you have the solution?
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.
Recommended textbooks for you
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning