Test Cases The following table represents button presses and the result that should be visible on...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Test Cases The following table represents button presses and the result that should be visible on the display, in a functioning calculator. User input Result 25+4.78= 29.78 1+2=*2= 6/5=+1.75 = 2...5-1= 2 + AC 3 + 2.5 = 6 2.95 1.5 5.5 10/0 = NaN / Infinity (application shouldn't crash) 0/7= 0 Logic Implementation All logic needs to be implemented manually to get points for logic implementation. Use of the eval(), regex, etc. (not an exhaustive list) will not result in allocation of full points. Why? Projects that do not implement logic manually will not have demonstrated command of using JavaScript or implementing logic. Therefore, they would get points allocated for HTML/CSS but not full points in logic implementation. Such projects will likely receive a highest score in the B to A- range. Projects that fully implement logic manually will demonstrate command of logical implementation and JavaScript and will receive more points than projects that use in-built functionality. Such projects could theoretically get an A+. The extent of sophistication needed is for a working project is limited to being able to use functions, implement condition logic using if statements and switch structures, and event handling. This is a problem-solving exercise and a fully function project will demonstrate the logic needed to track user input, store some basic information, and process it in the correct sequence. Program Overview Create a basic four-function Calculator using HTML, CSS, and JavaScript. It should allow addition, subtraction, multiplication, and division of two numbers (integers and floats). The calculator should have: • Numbers from 0 to 9 Four math operator buttons ⚫ Decimal button ⚫ All Clear button, which clears all the elements of the calculator ⚫ Equal button Sample calculator Look at the following online calculator to get acquainted with 4-function calculators if you have never used one. It is important that you look at it since they function differently than modern calculators. Calculators you use on your phone are far more sophisticated in behavior. Emulate the behavior found in this online calculator. https://www.theonlinecalculator.com/ You do not need memory functions, positive/negative number handling or other advanced math functions. Design Requirements You are free to choose a design or select button placements as you see fit. The overarching requirement is, however, that your application needs to have the look-and-feel of a calculator. The application needs to work based on clicks alone (no typing). . "Buttons" is a figure of speech. You can technically use a number of HTML elements to product the clickable "buttons". Use HTML and CSS features to design the calculator's User Interface (UI). ⚫ All buttons must have the same background color. . As the mouse moves over each button (hovers-in), the button's background color must change. ⚫ When the mouse moves away from the button (hovers-out), its background color should revert to its default color. • The "display" text element (where the numbers appear) should be read-only. The relative positioning and layout of the buttons should be as similar to that of a calculator. ⚫ The entire calculator should be horizontally centered on the page and have a title above it. Functionality Requirements 1) Allow users to enter numbers ONLY using buttons Number entry is NOT via keyboard / Textboxes 2) Have buttons for Add, Subtract, Multiply, and Divide 3) Enable the user to click buttons to entire the first number, followed by one operator followed by a second number • Be able to use the text being displayed as the first number. Entering the operator may clear the first number displayed The text entered by the user after the math operator should be used as the second number. This setup should not allow the entering of a complex math expression: e.g. "342+2.3*3-87/2", such as one is able to use in a modern scientific calculator (for which complex order of operations rules come into play). 4) Offer the user the ability to use decimals. Allows only 1 decimal point in a number 5) Have a Clear button ⚫ Clear resets all previous input 5) Be able to show decimals in results 6) Show accurate results for all four math functions. 7) Be able to recover and not crash when a number is divided by zero. Programming Requirements The application should be implemented as a front-end application, with design that uses manually implemented HTML & CSS. ⚫ All logic needs to be implemented manually using client-end JavaScript. No use of frameworks Optional Challenge Intermediate Level Challenge - No extra credit points Many calculators have a memory function, which allows a number to be stored, recalled, and cleared. Dedicated buttons also allow adding to or subtracting from the number stored in memory. This functionality is implemented using MR, M+, M-, and MC buttons Implement the memory functionality in your calculator. Test Cases The following table represents button presses and the result that should be visible on the display, in a functioning calculator. User input Result 25+4.78= 29.78 1+2=*2= 6/5=+1.75 = 2...5-1= 2 + AC 3 + 2.5 = 6 2.95 1.5 5.5 10/0 = NaN / Infinity (application shouldn't crash) 0/7= 0 Logic Implementation All logic needs to be implemented manually to get points for logic implementation. Use of the eval(), regex, etc. (not an exhaustive list) will not result in allocation of full points. Why? Projects that do not implement logic manually will not have demonstrated command of using JavaScript or implementing logic. Therefore, they would get points allocated for HTML/CSS but not full points in logic implementation. Such projects will likely receive a highest score in the B to A- range. Projects that fully implement logic manually will demonstrate command of logical implementation and JavaScript and will receive more points than projects that use in-built functionality. Such projects could theoretically get an A+. The extent of sophistication needed is for a working project is limited to being able to use functions, implement condition logic using if statements and switch structures, and event handling. This is a problem-solving exercise and a fully function project will demonstrate the logic needed to track user input, store some basic information, and process it in the correct sequence. Test Cases The following table represents button presses and the result that should be visible on the display, in a functioning calculator. User input Result 25+4.78= 29.78 1+2=*2= 6/5=+1.75 = 2...5-1= 2 + AC 3 + 2.5 = 6 2.95 1.5 5.5 10/0 = NaN / Infinity (application shouldn't crash) 0/7= 0 Logic Implementation All logic needs to be implemented manually to get points for logic implementation. Use of the eval(), regex, etc. (not an exhaustive list) will not result in allocation of full points. Why? Projects that do not implement logic manually will not have demonstrated command of using JavaScript or implementing logic. Therefore, they would get points allocated for HTML/CSS but not full points in logic implementation. Such projects will likely receive a highest score in the B to A- range. Projects that fully implement logic manually will demonstrate command of logical implementation and JavaScript and will receive more points than projects that use in-built functionality. Such projects could theoretically get an A+. The extent of sophistication needed is for a working project is limited to being able to use functions, implement condition logic using if statements and switch structures, and event handling. This is a problem-solving exercise and a fully function project will demonstrate the logic needed to track user input, store some basic information, and process it in the correct sequence. Program Overview Create a basic four-function Calculator using HTML, CSS, and JavaScript. It should allow addition, subtraction, multiplication, and division of two numbers (integers and floats). The calculator should have: • Numbers from 0 to 9 Four math operator buttons ⚫ Decimal button ⚫ All Clear button, which clears all the elements of the calculator ⚫ Equal button Sample calculator Look at the following online calculator to get acquainted with 4-function calculators if you have never used one. It is important that you look at it since they function differently than modern calculators. Calculators you use on your phone are far more sophisticated in behavior. Emulate the behavior found in this online calculator. https://www.theonlinecalculator.com/ You do not need memory functions, positive/negative number handling or other advanced math functions. Design Requirements You are free to choose a design or select button placements as you see fit. The overarching requirement is, however, that your application needs to have the look-and-feel of a calculator. The application needs to work based on clicks alone (no typing). . "Buttons" is a figure of speech. You can technically use a number of HTML elements to product the clickable "buttons". Use HTML and CSS features to design the calculator's User Interface (UI). ⚫ All buttons must have the same background color. . As the mouse moves over each button (hovers-in), the button's background color must change. ⚫ When the mouse moves away from the button (hovers-out), its background color should revert to its default color. • The "display" text element (where the numbers appear) should be read-only. The relative positioning and layout of the buttons should be as similar to that of a calculator. ⚫ The entire calculator should be horizontally centered on the page and have a title above it. Program Overview Create a basic four-function Calculator using HTML, CSS, and JavaScript. It should allow addition, subtraction, multiplication, and division of two numbers (integers and floats). The calculator should have: • Numbers from 0 to 9 Four math operator buttons ⚫ Decimal button ⚫ All Clear button, which clears all the elements of the calculator ⚫ Equal button Sample calculator Look at the following online calculator to get acquainted with 4-function calculators if you have never used one. It is important that you look at it since they function differently than modern calculators. Calculators you use on your phone are far more sophisticated in behavior. Emulate the behavior found in this online calculator. https://www.theonlinecalculator.com/ You do not need memory functions, positive/negative number handling or other advanced math functions. Design Requirements You are free to choose a design or select button placements as you see fit. The overarching requirement is, however, that your application needs to have the look-and-feel of a calculator. The application needs to work based on clicks alone (no typing). . "Buttons" is a figure of speech. You can technically use a number of HTML elements to product the clickable "buttons". Use HTML and CSS features to design the calculator's User Interface (UI). ⚫ All buttons must have the same background color. . As the mouse moves over each button (hovers-in), the button's background color must change. ⚫ When the mouse moves away from the button (hovers-out), its background color should revert to its default color. • The "display" text element (where the numbers appear) should be read-only. The relative positioning and layout of the buttons should be as similar to that of a calculator. ⚫ The entire calculator should be horizontally centered on the page and have a title above it. Functionality Requirements 1) Allow users to enter numbers ONLY using buttons Number entry is NOT via keyboard / Textboxes 2) Have buttons for Add, Subtract, Multiply, and Divide 3) Enable the user to click buttons to entire the first number, followed by one operator followed by a second number • Be able to use the text being displayed as the first number. Entering the operator may clear the first number displayed The text entered by the user after the math operator should be used as the second number. This setup should not allow the entering of a complex math expression: e.g. "342+2.3*3-87/2", such as one is able to use in a modern scientific calculator (for which complex order of operations rules come into play). 4) Offer the user the ability to use decimals. Allows only 1 decimal point in a number 5) Have a Clear button ⚫ Clear resets all previous input 5) Be able to show decimals in results 6) Show accurate results for all four math functions. 7) Be able to recover and not crash when a number is divided by zero. Programming Requirements The application should be implemented as a front-end application, with design that uses manually implemented HTML & CSS. ⚫ All logic needs to be implemented manually using client-end JavaScript. No use of frameworks Optional Challenge Intermediate Level Challenge - No extra credit points Many calculators have a memory function, which allows a number to be stored, recalled, and cleared. Dedicated buttons also allow adding to or subtracting from the number stored in memory. This functionality is implemented using MR, M+, M-, and MC buttons Implement the memory functionality in your calculator. Functionality Requirements 1) Allow users to enter numbers ONLY using buttons Number entry is NOT via keyboard / Textboxes 2) Have buttons for Add, Subtract, Multiply, and Divide 3) Enable the user to click buttons to entire the first number, followed by one operator followed by a second number • Be able to use the text being displayed as the first number. Entering the operator may clear the first number displayed The text entered by the user after the math operator should be used as the second number. This setup should not allow the entering of a complex math expression: e.g. "342+2.3*3-87/2", such as one is able to use in a modern scientific calculator (for which complex order of operations rules come into play). 4) Offer the user the ability to use decimals. Allows only 1 decimal point in a number 5) Have a Clear button ⚫ Clear resets all previous input 5) Be able to show decimals in results 6) Show accurate results for all four math functions. 7) Be able to recover and not crash when a number is divided by zero. Programming Requirements The application should be implemented as a front-end application, with design that uses manually implemented HTML & CSS. ⚫ All logic needs to be implemented manually using client-end JavaScript. No use of frameworks Optional Challenge Intermediate Level Challenge - No extra credit points Many calculators have a memory function, which allows a number to be stored, recalled, and cleared. Dedicated buttons also allow adding to or subtracting from the number stored in memory. This functionality is implemented using MR, M+, M-, and MC buttons Implement the memory functionality in your calculator.
Expert Answer:
Answer rating: 100% (QA)
Based on the information from the three images heres how we can build a basic calculator using HTML CSS and JavaScript 1 HTML Structure Create an HTML ... View the full answer
Related Book For
Mathematical Statistics With Applications In R
ISBN: 9780124171138
2nd Edition
Authors: Chris P. Tsokos, K.M. Ramachandran
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
1. Which type contains a single character enclosed within single quotes? A. Character B. Numeric C. Floating point 2. The modulus operator uses, B. - B. < A. + 3. Every variable should be separated...
-
The Agricultural Genetics Company's Cash account in its general ledger reported a balance of $6,782 on May 31, 2017. The company's bank statement from Western Bank reported a balance of $6,405 on the...
-
Determine the critical value and critical region that would be used in the classical approach to test the null hypothesis for each of the following multinomial experiments. a. Ho: P(1) = P(2) = P(3)...
-
Hippos spend much of their lives in water, but amazingly, they dont swim. They have, like manatees, very little body fat. The density of a hippos body is approximately 1030 kg/m 3 , so it sinks to...
-
Listed here are several examples of bad, or at least questionable, decisions. Evaluate the decision makers approach or logic. In which of the six decision steps might the decision maker have gone...
-
Use this website https://tradingeconomics.com/canada/government-debt-to-gdp. From a comparative standpoint, what can be said about the recent trend in Canada's and the USA's government debt to Gross...
-
17-21. The iron-binding site of transferrin in Figure 17-7 can ac- commodate certain other metal ions besides Fe and certain other anions besides CO. Data are given in the table for the titration of...
-
For a company/product of your choice, make a prospecting. In this plan consider: 1. What methods of prospecting will you choose 2. How will you determine and prioritize prospects 3. What sales...
-
What are the key components of a microkernel architecture in operating systems, and how does it differ from a monolithic kernel design in terms of modularity, performance, and security?
-
The landlord is responsible for paying property taxes for Westwood Plaza. However, each lease requires the tenants to pay their CAM share of property taxes above the level that existed when they...
-
Video: Watch: What will Marketing look like in 2030 Retrieved from https://www.youtube.com/watch?v=imjeJtl2tBg (1:58) The video is an overview of what many executives believe marketing is going to...
-
Discuss the design considerations and challenges associated with implementing multiprocessor and multicore support in modern operating systems, including issues related to synchronization, load...
-
Customers buy cars from three auto companies. Given the company from which a customer last bought a car, the probability that she will buy her next car from each company is as follows: a If someone...
-
With your classmates, form small teams of skunkworks. Your task is to identify an innovation that you think would benefit your school, college, or university, and to outline an action plan for...
-
The following data give the mean of SAT Mathematics scores by state for 1999 for a randomly selected 20 states (a) Construct a stem-and-leaf display and interpret. (b) Construct a frequency histogram...
-
A machine that is used to fill bottles with soda has been observed to have a true standard deviation in the amounts of fill of approximately = 1.25 ounces. However, the mean ounces of fill may...
-
An examination is designed where the students are required to answer any 20 questions from a group of 25 questions. How many ways can a student choose the 20 questions?
-
Uncertainty can impact many elements of an engineering economic analysis. Given the list of factors below, rank them from most to least uncertain, and briefly justify why you ranked them in that...
-
The Fence Company is setting up a new production line to create top rails. The relevant data for two alternatives are shown below. a. Based on MARR of 8 percent, determine the annual rate of...
-
Reconsider Problem 3. Indicate whether each of the following statements is true or false by determining the new breakeven for each case. Each case is independent of the other cases. Data from problem...
Study smarter with the SolutionInn App