Declare the variables needed to solve the problem

Assignment Help Programming Languages
Reference no: EM131324236

Assignment- Computer Applications for Business

Learning Objectives:

This assignment is designed to practice:

1. Basic understanding of JavaScript variables, including;

a The declaration, initialization and assignment processes

2. Obtain user input by via the prompt() function and present output to the user through the alert() function

3. Data type conversion in variables (strings to numbers, convert to upper case)

4. Use of the conditional if and if/else statements

5. Use of arithmetic and logic operators

6. Use of comments

Directions:

You are provided an html program. Your responsibility is to insert the JavaScript statements that will solve the problem discussed below, and to comment the html file with the requested information per the requirements.

For the JavaScript, you will only complete the section inside of the <script> tags that are located within the provided skeleton program:

<script id="COMPLETE_THIS_SECTION_ASSIGNMENT_6">

Insert your JavaScript code here

</script>

Problem to solve:

The Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows:

• If a customer purchases 0 books, they earn 0 points
• If a customer purchases 1 book, they earn 3 points
• If a customer purchases 2 books, they earn 7 points
• If a customer purchases 3 books, they earn 12 points
• If a customer purchases more than 3 books, they earn an additional 5 points on top of the 12 points for each book above 3.

Preferred Customers receive a bonus of double award points.

The Serendipity Booksellers website needs to be updated to ask the customer to enter the number of books purchased last month, 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. You will generate HTML comments to add your name, section and TA name. Each on a separate line within the <Head> tags. This will (should) NOT be visible in the document on the web browser).

3. You will then add JavaScript code to the provided assignment6.html skeleton file within the <script> tags:

<script id="COMPLETE_THIS_SECTION_ASSIGNMENT_6">
/* INSERT YOUR JAVASCRIPT HERE */
</script>

4. A typical program flow would declare the variables needed to solve the problem, initialize the variables, solicit input, perform the data manipulation and/or calculations and display the result.

5. Utilize JavaScript comments to explain the steps you are preforming within your code. A JavaScript comment's form is:

/* Place your comment between the stars */

6. You will utilize prompt() functions to request input from the customer. Your message should be descriptive enough to solicit data from someone not familiar with the assignment.

7. You will utilize the alert() function to display your output as a clear and unstandable message to the customer.

8. 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.

9. Utilize at least one if/else statement. Consider using the if/else in determining the bonus points.

Additional Information:

Since the contents of a text box, which is what the prompt() function generates, is going to be used in mathematical operations, use the function parseInt() to convert the text to a number. Otherwise your calculation operations will not perform as expected.

Example: variableName = parseInt(variableName)

To simplify the comparison of solicited text, it is often easier to convert this text to upper case. Example: variableName = variableName.toUpperCase();

References:

Fluency 6 - Chapter 17 • Fundamental Concepts Expressed in JavaScript w3schools.com • https://www.w3schools.com/js/default.asp
Firefox Tools - https://developer.mozilla.org/en-US/docs/Tools/Debugger
Lectures' slides and examples Recitation.

Reference no: EM131324236

Questions Cloud

Write a cpp program that will declare a vector of integers : CPSC P#9- Write a complete C++ program that will: Declare a vector of integers with no specified size. Use a pointer to dynamically allocate an array of 10 integers Inside a loop:
Evaluate the august 165 puts and calls : Evaluate the August 165 puts and calls, and recommend a conversion or a reverse conversion. Determine the profit from the transaction if the options are held to expiration.
Find the initial speed of the van : A(n) 2655 kg van runs into the back of a(n) 848 kg compact car at rest. They move off together at 8.8 m/s. Assuming no friction with the ground, find the initial speed of the van
Determine the profit equations for the given strategies : Determine the profit equations for the following strategies, assuming that the options are held to expiration and exercised if in-the-money rather than sold back.
Declare the variables needed to solve the problem : A typical program flow would declare the variables needed to solve the problem, initialize the variables, solicit input, perform the data manipulation and/or calculations and display the result.
What factors should the trader consider : Explain why option traders often use spreads instead of simple long or short options and combined positions of options and stock?
Some various interesting pieces of financial news : There are some various interesting pieces of financial news in the media recently such as, China's slowing economy, European Union's antitrust lawsuit against google etc. I want each of you to dig into financial media, such as Wall Street Journal, CN..
Define the castle doctrine and stand your ground laws : In 1987, Florida became a "shall issue" concealed carry state, which opened a floodgate of states who adopted similar laws. Currently, all 50 states allow some form of concealed carry. This has brought attention to many theories of self-defense an..
What will its final velocity be : An elevator is moving upward at 0.96 m/s when it experiences an acceleration 0.35 m/s2 downward, over a distance of 0.71 m. What will its final velocity be

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd