Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. In the file function-declaration.js comment out past code and follow the video to create the function calculateTax and return a value: Use the
1. In the file function-declaration.js comment out past code and follow the video to create the function calculateTax and return a value: Use the value 0.10 as the tax rate, i.e. 10% OST function calculateTax(amount) { let result = amount * 0.0825; return result; } let tax- calculateTax(100); console.log(tax); 2. Check your code runs and returns the correct outcome. Check you answer for $100 amount is $10 CST. 3. Take 2 screenshots of the final code and results: 1x showing all the code (readable)- name this image CODE Q3 (your first name) 1x showing the results of the code running - name this image RUN Q3 (your first name) Activity: Part 1 - Complete Revision Activity 5 Create the file function-declaration.js and follow the video to create the code and learn how to assign a variable to a function: 1. Create the function called sayHello JS function-declarations.js > sayHello function sayHello() { console.log('-- 1 2 3 4 5 10 6 } 7 console.log('hello'); console.log('- sayHello(); 2. Assign the variable "a" to the sayHello function. Note as you have already called the function (sayHello())- you will need to comment that call out to make the script run. Try leaving it not commented; then comment it to see the error code. -'); '); let a = sayHello; a(); 3. Add a variable "name" to the function to say hello to different names Amend the code used in the video to: 1. change the text in console log to say Hello from YOUR NAME to " instead of just "hello 2. change the names to pass in 3 friends names Check your code runs and returns the correct outcome. Activity: Part 2 - Personalise it 2. Amend the code used in the video to: change the text in console log to say Hello from YOUR NAME to " instead of just "hello" change the names to run to 3 friends names 2. Check your code runs and returns the correct outcome. 3. Take 2 screenshots of the final code and results: 1x showing all the code (readable) - name this image CODE Q2 (your first name) 1x showing the results of the code running - name this image RUN Q2 (your first name)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started