Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

body { width: 80%; margin: auto; } input { color: grey; font-size: 80%; padding: 2px 15px 2px 15px; text-align: right; } button { margin: 20px;

Assignment 7

CS 170 Computer Applications for Business Fall 2017 Assignment7 JavaScrip Event Driven Programming To get credit for this assignment : U pload and submit the Assignment7 _answers. html file through Sakai. Learning Objectives : This assignment is designed to practice: 1.Understand the basic input and output mechanisms of dynamic web applications from the code perspective 2.Implement JavaScript code which will handle user events 3.Display feedback of said processed interactions back to the user 4.Practice your understanding of basic JavaScript from the prior Assignment a variables, including; i The declaration, initialization and assignment processes

b Use of the conditional if statements

c Use ofarithmetic and logic operators d Use of comments Directions : You are provided an HTML program. Your responsibility is to insert the HTML tags with the appropriate JavaScript statements that will solve the problem discussed below, and to comment the html file with the requested information per the requirements. The problem description and HTML program provided are slightly different from Assignment 6. Be sure to start fresh. Problem to solve : The Good Sipping Coffee Shop has afrequent buyer club that awards points to its customersbased on the number of coffees purchased each month. The points are awarded as follows: If the customer purchases 0 coffees, they earn 0 points If the customer purchases 1 coffee, they earn 3points If the customer purchases 2 coffees, they earn 6 points If the customer purchases 3 coffees, they earn 10 points If the customer purchases more than 3 coffees, they earn an additional 2 points on top of the 10 points for each coffee above 3.

GoodSippingCoffeeShop also awards points based on the dollar value spent on non -coffee merchandise.Three(3) points are awarded for every $15 spent. Partial awards are not provided. For example 3 points will be awarded for spending $15.00 up to $29.99. No points are awarded for less than $15. Preferred Customers receive a bonus of double award points. The GoodSippingCoffeeShop website needs to be updated to ask the customer to enter the number of coffees purchased last month, the dollars spent on non -coffee merchandise, confirm if they are a Preferred Customer, and then calculate and display the number of award points earned. Requirements: For this assignment 1. Your program will calculate the award points as described above. 2.

3.Utilize a

tag 4. You will then add the HTML tags with the proper JavaScript code to produce: a. A textbox to solicit the number of coffees purchased b. A textbox to solicit the dollars of non-coffee merchandise c.Grouped radio buttons to determine Preferred Customer membership d.A button to calculate the number of points awarded e.A read-only textbox to display the result thecalculation 5.Utilize JavaScript comments to explain the steps you are preforming within your code. A JavaScript comments form is: /* Place your comment between the stars*/ 3 6.Variable names should be descriptive. For example, if a program is calculating the total charge for a bill at a restaurant, it may have a variable named tipAmount. 7. Utilize at least one if/elsestatement. Consider using the if/else in determining the bonus points. A sample of what your webpage could look like: Additional Information: Since the contents of a textbox, is going to be used in mathematical operations. Textboxes sometimes treat input as Strings. Use the function parse Int() to convert the String text to a number. Otherwise your calculation operations will not perform as expected. JavaScript provides several math utilities.The Math. floor() method rounds a number DOWNWARDS to the nearest integer, and returns the result.

References: Fluency 6 -Chapter 17- Fundamental Concepts Expressed in JavaScript -Chapter 18 A JavaScript Program w3schools.com Lectures slides and examples Recitation Week 6 Recitation Week 7

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Administration The Essential Reference

Authors: Brian Laskey, David Kreines

1st Edition

1565925165, 978-1565925168

More Books

Students also viewed these Databases questions

Question

3. Evaluate a Web-based training site.

Answered: 1 week ago