课程: JavaScript Essential Training
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Challenge intro: Calculate sales tax - JavaScript教程
课程: JavaScript Essential Training
Challenge intro: Calculate sales tax
(upbeat music) - [Instructor] Computers are really good at doing mathematical calculations. That's why they're called computers. And working with JavaScript, you'll often use math formulas to accomplish tasks. In this challenge, you'll get to try this for yourself by creating a basic sales tax calculator for a store. In the test code setup, you'll find an almost completed setup to calculate taxes and totals for a store in British Columbia, Canada. There are two taxes here, the GST, which is 5%, and the PST, which is 8%, and both of these taxes need to be applied independently to the before tax total to get the final price. Your task is to complete the calculateTotal function by adding GST, PST, and sum properties to the totals objects and performing the necessary math to get the right numbers in each property. You can see at the bottom here that all this information gets output at the end and you want this output to…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
-
-
Variables: Containers for everything2 分钟 31 秒
-
(已锁定)
Var3 分钟 15 秒
-
(已锁定)
Scope3 分钟 37 秒
-
(已锁定)
Let4 分钟 34 秒
-
(已锁定)
Const2 分钟 58 秒
-
(已锁定)
Data types3 分钟 7 秒
-
(已锁定)
Assignment vs. comparison4 分钟 35 秒
-
(已锁定)
Math operators6 分钟 13 秒
-
(已锁定)
Challenge intro: Calculate sales tax1 分钟 35 秒
-
(已锁定)
Solution: Calculate sales tax3 分钟 30 秒
-
-
-
-
-
-