using_abstractions_project (1)
using_abstractions_project (1)
Part I: Coding
Create a program using functions that simulates purchasing items from an online store.
The program must include the following.
1. Include comments with your name, the date, and the purpose of your program at
the start of the program.
2. Include the name of your store and a greeting for your customer.
4. Display the price for each item. (You decide the prices for each item and code
them into your program. For example, the first item would always be $3.50.)
5. Prompt the user to enter how many of each item they would like to buy.
7. Display the grand total for the purchases, including tax. You may choose the tax
rate.
a. Create a function that calculates the total of the items plus the tax.
b. Return the total amount.
c. Tax can be calculated by adding up the items and multiplying the total by
the tax rate.
d. Total can be calculated by adding the tax to the total value of the items.
To round the total to two decimal places, you may use the following calculation:
Example:
Unless Otherwise Noted All Content © 2023 Florida Virtual School. FlexPoint Education Cloud™ is a trademark of Florida Virtual School
let total = 35.505544;
let roundedTotal = Math.round(total * 100) / 100;
console.log(roundedTotal);
Outputs 35.51
Expected Output
Your output may look different depending on the type of store you set up and your
customer inputs.
Unless Otherwise Noted All Content © 2023 Florida Virtual School. FlexPoint Education Cloud™ is a trademark of Florida Virtual School
Part II: Written Response
In the word processing program of your choice, respond to the following prompts. For
prompts two and three, your responses should be in complete sentences using proper
grammar, spelling, and punctuation.
1. Copy and paste (or screen capture and paste) two program code segments.
a. The first program code segment must include one of your functions and the
following:
i. The function's name
b. The second program code segment must show where the function is called in
the program.
2. Describe what the function does and how it contributes to the overall program.
3. Explain in detail, line by line, the way your function works. Your description must
have enough detail that someone else could recreate it.
Unless Otherwise Noted All Content © 2023 Florida Virtual School. FlexPoint Education Cloud™ is a trademark of Florida Virtual School