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

  Validation and test documentation

The final project consists of a currency conversion application. This application-similar to simple, practical programs on many travel or financial Web sites-includes the following elements: Validation and test documentation

  How to update web pages using navy for unvisited link

The Marketing Director at Steel Solutions is unhappy that links on company Web page appear in blue. She has asked you to update Web pages to use navy for unvisited link.

  A fixed quantum of information packaged together

A fixed quantum of information packaged together with an IP address and other data for sending information over the internet

  Write a perl program to parse out the file

Do a search for the term "anthrax" in PubMed. Then search the Protein and Nucleotide databases -

  Program ask user to enter starting amount in savings account

There is a Savings and a Checking account. Your program should begin by asking the user to enter the starting amount in the checking and savings accounts.

  Program in perl that have two subroutines add() and multiply

Write a program in PERL that have two subroutines add() and multiply() that will add or multiply its arguments and print the result to screen.

  Supports drag-and-drop of elements into a receiver

HTML5 now supports drag-and-drop of elements into a receiver called a "canvas". o Trueo False

  Program for saving account balance report

Savings account balance report from customer savings account file. Every input savings account record contains account number, balance forward, deposits (sum of all deposits).

  Write a function to calculate your wages for a part-time job

Explain how an animation uses still images and loops to create the illusion of motion. Write a function to calculate your wages for a part-time job. (Don't worry about calculating overtime.)

  Write an arm subroutine which allocate memory for new string

Prepare an ARM subroutine which will extract a substring from a string and you will need to use the library routine malloc to allocate memory for the new string - CS252 Programming Assignment

  Write a test application named labtest

Write a test application named LabTest. In the main method, do the following: Input the department name then create a department object. Display a menu to the user and asking for a choice to be entered.

  Prompt for and get the number of miles to drive

CPS 151: drive - prompt for and get the number of miles to drive (allow fraction), invoke the methods c.drive(miles) and c.display()

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