Skip to content

An AI skill that turns books into animated, narrated, interactive web experiences

feat(math): add taxes and fees chapter

yzr3b9b779be525
diff --git a/site/math-notebook/ch21/audio/en/dollars.mp3 b/site/math-notebook/ch21/audio/en/dollars.mp3
new file mode 100644
index 0000000..b1ba975
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/dollars.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/fee.mp3 b/site/math-notebook/ch21/audio/en/fee.mp3
new file mode 100644
index 0000000..d1cd929
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/fee.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/feeorig.mp3 b/site/math-notebook/ch21/audio/en/feeorig.mp3
new file mode 100644
index 0000000..5b91391
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/feeorig.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/final1.mp3 b/site/math-notebook/ch21/audio/en/final1.mp3
new file mode 100644
index 0000000..5cd0549
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/final1.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/final2.mp3 b/site/math-notebook/ch21/audio/en/final2.mp3
new file mode 100644
index 0000000..f904065
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/final2.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/final3.mp3 b/site/math-notebook/ch21/audio/en/final3.mp3
new file mode 100644
index 0000000..59cbbbd
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/final3.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/finish.mp3 b/site/math-notebook/ch21/audio/en/finish.mp3
new file mode 100644
index 0000000..1f90411
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/finish.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/intro.mp3 b/site/math-notebook/ch21/audio/en/intro.mp3
new file mode 100644
index 0000000..291e6f8
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/intro.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/method1.mp3 b/site/math-notebook/ch21/audio/en/method1.mp3
new file mode 100644
index 0000000..cb5921a
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/method1.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/method2.mp3 b/site/math-notebook/ch21/audio/en/method2.mp3
new file mode 100644
index 0000000..922f1c6
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/method2.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/methods.mp3 b/site/math-notebook/ch21/audio/en/methods.mp3
new file mode 100644
index 0000000..c4ad11d
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/methods.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/mistake.mp3 b/site/math-notebook/ch21/audio/en/mistake.mp3
new file mode 100644
index 0000000..6ce72d4
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/mistake.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/original.mp3 b/site/math-notebook/ch21/audio/en/original.mp3
new file mode 100644
index 0000000..64d8cb7
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/original.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/q1.mp3 b/site/math-notebook/ch21/audio/en/q1.mp3
new file mode 100644
index 0000000..e58813c
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/q1.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/q2.mp3 b/site/math-notebook/ch21/audio/en/q2.mp3
new file mode 100644
index 0000000..d685e6d
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/q2.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/q3.mp3 b/site/math-notebook/ch21/audio/en/q3.mp3
new file mode 100644
index 0000000..5537ec9
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/q3.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/rate.mp3 b/site/math-notebook/ch21/audio/en/rate.mp3
new file mode 100644
index 0000000..94c38f3
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/rate.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/timings.js b/site/math-notebook/ch21/audio/en/timings.js
new file mode 100644
index 0000000..dd2109f
--- /dev/null
+++ b/site/math-notebook/ch21/audio/en/timings.js
@@ -0,0 +1,528 @@
+window.TIMINGS = {
+ "intro": {
+ "dur": 20.4,
+ "marks": {
+ "sub": 10.742
+ },
+ "cues": [
+ [
+ 0.104,
+ "Chapter twenty-one."
+ ],
+ [
+ 1.523,
+ "Taxes and fees."
+ ],
+ [
+ 3.099,
+ "Shops, cities and rental companies often add a little extra to a price, and that extra is usually a percent."
+ ],
+ [
+ 10.742,
+ "We will see what the percent is a percent of, find the extra amount in three ways, and then work backward from a receipt to the price before the extra."
+ ]
+ ]
+ },
+ "rate": {
+ "dur": 37.608,
+ "marks": {
+ "sales": 5.469,
+ "eight": 10.195,
+ "forms": 18.19
+ },
+ "cues": [
+ [
+ 0.104,
+ "Governments collect taxes to pay for shared things, like roads and parks."
+ ],
+ [
+ 5.469,
+ "A sales tax is added to what you buy, and it is set as a percent."
+ ],
+ [
+ 10.195,
+ "Take an eight percent tax."
+ ],
+ [
+ 12.201,
+ "Here is one dollar, which is one hundred cents."
+ ],
+ [
+ 15.664,
+ "Eight of those hundred cents are the tax."
+ ],
+ [
+ 18.19,
+ "So eight percent means eight cents for every hundred cents."
+ ],
+ [
+ 22.487,
+ "It can be written as eight to one hundred, as the fraction eight over one hundred, or as the decimal zero point zero eight."
+ ],
+ [
+ 31.198,
+ "Different cities and states choose different rates, but the rate stays the same while prices change."
+ ]
+ ]
+ },
+ "dollars": {
+ "dur": 29.16,
+ "marks": {
+ "price": 0.117,
+ "each": 5.13,
+ "count": 10.078,
+ "result": 15.547
+ },
+ "cues": [
+ [
+ 0.117,
+ "Here is a forty dollar sweater, shown as forty one-dollar chips."
+ ],
+ [
+ 5.13,
+ "Every dollar carries its own eight cents of tax, the small pink strip."
+ ],
+ [
+ 10.078,
+ "Count the tax chip by chip."
+ ],
+ [
+ 12.07,
+ "Eight cents, sixteen, twenty-four, and on up."
+ ],
+ [
+ 15.547,
+ "Forty chips with eight cents each make three hundred twenty cents, which is three dollars and twenty cents."
+ ],
+ [
+ 22.305,
+ "A bigger price means more tax, because the rate is the same for every dollar."
+ ],
+ [
+ 27.786,
+ "That is a proportion."
+ ]
+ ]
+ },
+ "method1": {
+ "dur": 26.304,
+ "marks": {
+ "convert": 4.44,
+ "product": 9.18,
+ "bar": 14.74,
+ "money": 20.99
+ },
+ "cues": [
+ [
+ 0.091,
+ "Now the quick way."
+ ],
+ [
+ 1.289,
+ "Method one: multiply the price by the rate."
+ ],
+ [
+ 4.44,
+ "First change eight percent to a decimal: zero point zero eight."
+ ],
+ [
+ 9.18,
+ "Then multiply: forty times zero point zero eight is three point two."
+ ],
+ [
+ 14.74,
+ "On the strip, the tax is eight percent of the price, a small piece beside the forty dollars."
+ ],
+ [
+ 20.99,
+ "Money gets two decimal places, so the tax is three dollars and twenty cents."
+ ]
+ ]
+ },
+ "method2": {
+ "dur": 29.712,
+ "marks": {
+ "top": 2.474,
+ "bottom": 5.925,
+ "equation": 15.677,
+ "cross": 19.219,
+ "answer": 23.32
+ },
+ "cues": [
+ [
+ 0.091,
+ "Method two: a proportion."
+ ],
+ [
+ 2.474,
+ "For a hundred dollars of price, eight dollars of tax."
+ ],
+ [
+ 5.925,
+ "For a forty dollar price, the tax is unknown."
+ ],
+ [
+ 9.896,
+ "Both strips are drawn to the same scale, so the second one is shorter all the way through."
+ ],
+ [
+ 15.677,
+ "Eight over one hundred equals x over forty."
+ ],
+ [
+ 19.219,
+ "Cross multiply: one hundred x equals three hundred twenty."
+ ],
+ [
+ 23.32,
+ "Divide by one hundred, and x is three point two."
+ ],
+ [
+ 27.201,
+ "The same three dollars and twenty cents."
+ ]
+ ]
+ },
+ "methods": {
+ "dur": 21.552,
+ "marks": {
+ "ask": 1.419,
+ "eq": 6.172,
+ "same": 11.12
+ },
+ "cues": [
+ [
+ 0.104,
+ "There is a third way."
+ ],
+ [
+ 1.419,
+ "Ask the question in words: what is eight percent of forty dollars?"
+ ],
+ [
+ 6.172,
+ "Translate it: x equals zero point zero eight times forty."
+ ],
+ [
+ 11.12,
+ "All three methods land on the same answer."
+ ],
+ [
+ 13.997,
+ "Multiply, set a proportion, or write an equation."
+ ],
+ [
+ 17.786,
+ "Pick the one that feels easiest, and use another to check."
+ ]
+ ]
+ },
+ "q1": {
+ "dur": 2.904,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Quick check."
+ ],
+ [
+ 1.237,
+ "Find the total with tax."
+ ]
+ ]
+ },
+ "total": {
+ "dur": 23.712,
+ "marks": {
+ "add": 1.51,
+ "pct": 9.154,
+ "one": 17.161
+ },
+ "cues": [
+ [
+ 0.104,
+ "What do you actually pay?"
+ ],
+ [
+ 1.51,
+ "The price plus the tax."
+ ],
+ [
+ 3.425,
+ "Forty dollars plus three dollars twenty is forty-three dollars and twenty cents."
+ ],
+ [
+ 9.154,
+ "In percents, the price is one hundred percent and the tax adds eight more, so you pay one hundred eight percent of the price."
+ ],
+ [
+ 17.161,
+ "That gives a one-step method: one point zero eight times forty is forty-three point two zero."
+ ]
+ ]
+ },
+ "original": {
+ "dur": 42.6,
+ "marks": {
+ "receipt": 1.419,
+ "pct": 10.521,
+ "eq": 17.943,
+ "divide": 24.505,
+ "check": 32.357
+ },
+ "cues": [
+ [
+ 0.104,
+ "Now work backward."
+ ],
+ [
+ 1.419,
+ "You buy headphones, and the receipt says fifty-three dollars and ninety-nine cents, with eight percent tax included."
+ ],
+ [
+ 8.464,
+ "What was the price before tax?"
+ ],
+ [
+ 10.521,
+ "The total is the whole price plus eight percent more, so it is one hundred eight percent of the original price."
+ ],
+ [
+ 17.943,
+ "Write fifty-three ninety-nine equals one point zero eight times the original price."
+ ],
+ [
+ 24.505,
+ "Divide both sides by one point zero eight."
+ ],
+ [
+ 27.526,
+ "The original price is about forty-nine ninety-nine, rounded to the nearest cent."
+ ],
+ [
+ 32.357,
+ "Check forward: one point zero eight times forty-nine ninety-nine is fifty-three point nine eight nine two, which rounds to fifty-three ninety-nine."
+ ]
+ ]
+ },
+ "mistake": {
+ "dur": 25.416,
+ "marks": {
+ "wrong": 4.141,
+ "why": 7.083,
+ "test": 12.253,
+ "right": 22.448
+ },
+ "cues": [
+ [
+ 0.104,
+ "A tempting shortcut is to subtract eight percent of the total."
+ ],
+ [
+ 4.141,
+ "That gives about forty-nine sixty-seven."
+ ],
+ [
+ 7.083,
+ "But the tax was eight percent of the original price, not eight percent of the total."
+ ],
+ [
+ 12.253,
+ "Check it."
+ ],
+ [
+ 13.034,
+ "Eight percent of forty-nine sixty-seven is about three ninety-seven, and the total would be fifty-three sixty-four, not fifty-three ninety-nine."
+ ],
+ [
+ 22.448,
+ "Divide by one point zero eight instead."
+ ]
+ ]
+ },
+ "q2": {
+ "dur": 3.0,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Quick check."
+ ],
+ [
+ 1.159,
+ "Which price gives this total?"
+ ]
+ ]
+ },
+ "fee": {
+ "dur": 26.328,
+ "marks": {
+ "bike": 1.966,
+ "rate": 8.359,
+ "fee": 12.07,
+ "total": 19.427
+ },
+ "cues": [
+ [
+ 0.156,
+ "Fees can work just like taxes."
+ ],
+ [
+ 1.966,
+ "A bike shop charges a seventeen percent late fee."
+ ],
+ [
+ 5.221,
+ "The regular rental is sixty-five dollars."
+ ],
+ [
+ 8.359,
+ "Seventeen percent is zero point one seven."
+ ],
+ [
+ 12.07,
+ "Sixty-five times zero point one seven is eleven point oh five, so the fee is eleven dollars and five cents."
+ ],
+ [
+ 19.427,
+ "Add it to the rental: sixty-five plus eleven oh five is seventy-six dollars and five cents."
+ ]
+ ]
+ },
+ "feeorig": {
+ "dur": 28.104,
+ "marks": {
+ "receipt": 1.185,
+ "pct": 7.8,
+ "divide": 15.404,
+ "check": 20.417
+ },
+ "cues": [
+ [
+ 0.104,
+ "Backward again."
+ ],
+ [
+ 1.185,
+ "A snowboard rental came to sixty-six dollars and eight cents, including a twelve percent late fee."
+ ],
+ [
+ 7.8,
+ "The rental price is one hundred percent, the fee adds twelve, so the total is one hundred twelve percent, or one point one two."
+ ],
+ [
+ 15.404,
+ "Sixty-six oh eight divided by one point one two is fifty-nine."
+ ],
+ [
+ 20.417,
+ "Check: twelve percent of fifty-nine is seven oh eight, and fifty-nine plus seven oh eight is sixty-six oh eight."
+ ]
+ ]
+ },
+ "q3": {
+ "dur": 3.24,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Quick check."
+ ],
+ [
+ 1.185,
+ "Find the fee and the total."
+ ]
+ ]
+ },
+ "wrap": {
+ "dur": 22.296,
+ "marks": {
+ "w1": 1.589,
+ "w2": 5.208,
+ "w3": 13.333,
+ "w4": 17.786
+ },
+ "cues": [
+ [
+ 0.117,
+ "Four things to remember."
+ ],
+ [
+ 1.589,
+ "A tax or fee is a percent of the original price."
+ ],
+ [
+ 5.208,
+ "Extra equals rate times price, and the total is the price plus the extra, or one plus the rate, times the price."
+ ],
+ [
+ 13.333,
+ "Know the total and want the original?"
+ ],
+ [
+ 15.69,
+ "Divide by one plus the rate."
+ ],
+ [
+ 17.786,
+ "Round money to the nearest cent, and check by building the total forward."
+ ]
+ ]
+ },
+ "final1": {
+ "dur": 2.832,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Chapter practice."
+ ],
+ [
+ 1.628,
+ "Find the tax."
+ ]
+ ]
+ },
+ "final2": {
+ "dur": 3.768,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Chapter practice."
+ ],
+ [
+ 1.523,
+ "Totals and original prices."
+ ]
+ ]
+ },
+ "final3": {
+ "dur": 2.472,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "Chapter practice."
+ ],
+ [
+ 1.628,
+ "Fees."
+ ]
+ ]
+ },
+ "finish": {
+ "dur": 2.496,
+ "marks": {},
+ "cues": [
+ [
+ 0.104,
+ "That is the chapter."
+ ],
+ [
+ 1.406,
+ "Here is how you did."
+ ]
+ ]
+ }
+};
diff --git a/site/math-notebook/ch21/audio/en/total.mp3 b/site/math-notebook/ch21/audio/en/total.mp3
new file mode 100644
index 0000000..f44c80f
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/total.mp3 differ
diff --git a/site/math-notebook/ch21/audio/en/wrap.mp3 b/site/math-notebook/ch21/audio/en/wrap.mp3
new file mode 100644
index 0000000..517889f
Binary files /dev/null and b/site/math-notebook/ch21/audio/en/wrap.mp3 differ
diff --git a/site/math-notebook/ch21/index.html b/site/math-notebook/ch21/index.html
new file mode 100644
index 0000000..b8e6af7
--- /dev/null
+++ b/site/math-notebook/ch21/index.html
@@ -0,0 +1,54 @@
+<!doctype html>
+<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Taxes and Fees — Elementary Mathematics</title><link rel="stylesheet" href="../lib/engine.css"><link rel="expect" href="#bar" blocking="render"><style>.band .prompt{font-size:27px}.screen .blanks .bline{gap:12px}.screen .blanks .box{width:8ch!important}.screen .blanks .why{font-size:21px}.screen .blanks .bline svg tspan{font-style:normal}</style></head><body>
+<script src="../lib/engine.js"></script><script src="audio/en/timings.js"></script><script>
+'use strict';
+const CHAPTER={number:21,title:'Taxes and Fees',minutes:9,language:'en', next: '../ch22/' };
+// Colours: chalk = original price, pink (rat) = tax/fee amount, amber = rate, blue = total.
+const TAX=COL.rat,TOT=COL.whole;
+const txText=(p,s,x,y,t=0,size=30,col=COL.chalk,anchor='start')=>{const e=T(p,s,{x,y,size,fill:col,anchor,o:0});show(e,t);return e;};
+const txMath=(p,s,x,y,t=0,size=52,col=COL.chalk)=>{const e=M(p,Array.isArray(s)?s:[s],{x,y,size,fill:col,anchor:'middle',o:0});show(e,t);return e;};
+const txTitle=(p,s,sub='')=>{txText(p,s,100,110,.1,43);if(sub)txText(p,sub,100,165,.15,27,COL.dim);};
+// price strip at u px per dollar; tax/fee segment (pink) beside it at the same scale
+function txBar(p,x,y,u,price,extra,t=0,h=100){const g=G(p,{x,y,o:0});g.dataset.price=String(price);g.dataset.extra=String(extra);const pr=mk('rect',{width:price*u,height:h,fill:COL.chalk,'fill-opacity':.14,stroke:COL.chalk,'stroke-width':3},g);const ex=mk('rect',{x:price*u,width:extra*u,height:h,fill:TAX,'fill-opacity':.7,stroke:TAX,'stroke-width':3},g);show(g,t);return {g,pr,ex,w:(price+extra)*u};}
+function txChoices(p,items,u,price0){return items.map(([price,tax,total],i)=>{const x=140+i*480,g=G(p),b=txBar(g,x,360,u,price,tax,0,100);txText(g,String.fromCharCode(65+i),x+190,270,0,34,COL.dim,'middle');txText(g,'price $'+price,x,330,0,28);txText(g,'+ tax $'+tax,x,500,0,29,TAX);txText(g,'= total $'+total,x,550,0,31,TOT);return {el:g,box:[x-20,235,430,360],label:'Picture '+String.fromCharCode(65+i)+', price '+price+', tax '+tax+', total '+total,bar:b};});}
+const BEATS=[
+['intro','Taxes and Fees',(m,D)=>{const g=G(scene,{o:0,y:24});T(g,'Unit 2 · Ratios, Proportions, and Percents · Chapter 21',{x:800,y:195,size:28,fill:COL.dim,anchor:'middle'});T(g,'Taxes and Fees',{x:800,y:390,size:90,weight:600,anchor:'middle'});T(g,'extra = rate × price',{x:800,y:560,size:50,fill:COL.task,anchor:'middle'});tw(g,{o:1,y:0},.2,1,out);txText(g,'Find the extra · or work back to the price',800,720,m('sub'),35,COL.dim,'middle');hide(g,D-.8,.7);}],
+['rate','Sales tax is a percent',m=>{const p=panel(0);txTitle(p,'Sales tax: a percent of the price','One dollar = 100 cents · drawn as 100 equal cells');const g=G(p,{x:160,y:230,o:0});for(let i=0;i<100;i++)mk('rect',{x:(i%10)*34,y:Math.floor(i/10)*34,width:34,height:34,fill:i<8?TAX:'none','fill-opacity':.75,stroke:COL.dim,'stroke-width':1.5},g);show(g,.3);txText(p,'$1 = 100¢',330,625,m('eight'),36,COL.chalk,'middle');txText(p,'8 of the 100 cents are tax',330,675,m('eight',2),31,TAX,'middle');txText(p,'sales tax 8%',700,300,m('sales'),46,COL.task);txText(p,'8¢ extra for every 100¢',700,375,m('eight',1),34);txMath(p,['8% = 8:100 = ',F('8','100'),' = 0.08'],1060,520,m('forms'),52,COL.task);txText(p,'rates differ by state and city · the rate stays fixed as prices change',1060,650,m('forms',6),27,COL.dim,'middle');}],
+['dollars','Tax on every dollar',m=>{const p=panel(0);txTitle(p,'A $40 sweater · 8% sales tax','Each chip = $1');const g=G(p,{o:0}),sl=[],hl=[];for(let i=0;i<40;i++){const x=130+(i%10)*68,y=230+Math.floor(i/10)*90,c=G(g,{x,y});mk('rect',{width:56,height:56,fill:COL.chalk,'fill-opacity':.14,stroke:COL.chalk,'stroke-width':2},c);const s=mk('rect',{y:56-56*.08,width:56,height:56*.08,fill:TAX},c);put(s,{o:0});sl.push(s);const h=mk('rect',{x:-4,y:-4,width:64,height:64,fill:'none',stroke:COL.task,'stroke-width':3},c);put(h,{o:0});hl.push(h);}
+show(g,m('price'));sl.forEach(s=>show(s,m('each'),.5));
+const cnt=txText(p,'tax so far: 0¢',1010,420,m('count'),44,TAX);prog(q=>{const n=Math.floor(q*40+1e-8);hl.forEach((h,i)=>put(h,{o:i<n?1:0}));cnt.textContent='tax so far: '+n*8+'¢';},m('count'),5,lin);
+txText(p,'40 × 8¢ = 320¢ = $3.20',1010,540,m('result'),44,TAX);txText(p,'more dollars, more tax: same rate each dollar',1010,620,m('result',5),27,COL.dim);}],
+['method1','Method 1: multiply',m=>{const p=panel(0);txTitle(p,'Method 1 · multiply by the decimal rate','The tax is 8% of the price');const b=txBar(p,160,260,22,40,3.2);txText(p,'price $40',160+440,395,0,32,COL.chalk,'middle');txText(p,'tax',160+880+35,235,m('bar'),30,TAX,'middle');tw(b.ex,{o:1},m('bar'),.1);txMath(p,'8% = 0.08',800,520,m('convert'),52,COL.task);txMath(p,'40 × 0.08 = 3.2',800,640,m('product'),60);txText(p,'tax = $3.20 · money gets two decimal places',800,780,m('money'),38,TAX,'middle');}],
+['method2','Method 2: proportion',m=>{const p=panel(0);txTitle(p,'Method 2 · same ratio, two prices','Both strips use the same scale');txBar(p,160,230,6,100,8,0,70);txText(p,'price $100 · tax $8',160+318,335,m('top'),30,COL.chalk,'middle');const b2=txBar(p,160,370,6,40,3.2,0,70);txText(p,'price $40 · tax x',160+130,475,m('bottom'),30,COL.chalk,'middle');b2.g.style.opacity=1;txMath(p,[F('8','100'),' = ',F('x','40')],800,610,m('equation'),62);txMath(p,'100x = 320',800,730,m('cross'),56);txMath(p,'x = 3.2',800,825,m('answer'),56,TAX);}],
+['methods','Method 3 and a check',m=>{const p=panel(0);txTitle(p,'Three methods · one answer','Pick one, check with another');[['Multiply',['40 × 0.08 = 3.2'],'ask'],['Proportion',[F('8','100'),' = ',F('x','40'),' → x = 3.2'],'eq'],['Equation: “What is 8% of $40?”',['x = 0.08 × 40 = 3.2'],'same']].forEach(([lab,eq,k],i)=>{txText(p,lab,150,300+i*150,m(k),32,COL.dim);txMath(p,eq,420,375+i*150,m(k,.3),56);txText(p,'$3.20',1350,375+i*150,m('same',1+i*.5),50,TAX,'middle');});}],
+['q1','Total with tax',()=>{const p=panel(0);txTitle(p,'A $50 game · 6% sales tax','All strips use the same scale: 5 px = $1');S.txCh=txChoices(p,[[50,3,53],[50,6,56],[50,30,80]],5);},{ask:done=>quiz(BAND,[{id:'c-total',prompt:'Which picture shows the total price of the game?',build:pickEls(S.txCh,0,'0.06 × 50 = 3, so the total is $53.',i=>i===1?'$6 treats 6% as 6 dollars. 6% of $50 is only $3.':'$30 would be 60% of $50. 6% is 0.06 × 50 = $3.')}],done)}],
+['total','Price plus tax',m=>{const p=panel(0);txTitle(p,'What do you pay?','price + tax = total');const b=txBar(p,160,260,22,40,3.2);txText(p,'price $40',160+440,395,0,32,COL.chalk,'middle');txText(p,'tax $3.20',160+880+35,235,0,30,TAX,'middle');txMath(p,'40 + 3.20 = 43.20',800,520,m('add'),58,TOT);const br=path(p,'M160 420V440H1040.4V420',{stroke:TOT,'stroke-width':3,fill:'none'},{d:0});draw(br,m('pct'),.8);txText(p,'100% + 8% = 108% of the price',800,495,m('pct'),0,COL.task,'middle');txMath(p,'1.08 × 40 = 43.20',800,720,m('one'),58,TOT);txText(p,'one step: (1 + rate) × price',800,810,m('one',1),32,COL.dim,'middle');}],
+['original','Work back to the price',m=>{const p=panel(0);txTitle(p,'Total $53.99 · 8% tax included','What was the price before tax?');const b=txBar(p,160,255,22,40,3.2);txText(p,'original price p = 100%',160+440,390,m('pct'),32,COL.chalk,'middle');txText(p,'tax 8%',160+880+35,230,m('pct'),30,TAX,'middle');txText(p,'total $53.99 = 108%',800,462,m('receipt'),38,TOT,'middle');txMath(p,'100% + 8% = 108% = 1.08',800,540,m('pct',1),46,COL.task);txMath(p,'53.99 = 1.08 × p',800,625,m('eq'),56);txMath(p,'p = 53.99 ÷ 1.08 ≈ 49.99',800,725,m('divide'),56,COL.chalk);txText(p,'check: 1.08 × 49.99 = 53.9892 ≈ 53.99',800,820,m('check'),33,COL.dim,'middle');}],
+['mistake','Tax is of the original',m=>{const p=panel(0);txTitle(p,'A tempting shortcut','Subtract 8% of the total?');txMath(p,'53.99 − 0.08 × 53.99 ≈ 49.67',800,330,m('wrong'),54);const x=path(p,'M270 360L1330 300',{stroke:COL.bad,'stroke-width':6},{d:0});draw(x,m('why'),.6);txText(p,'The tax was 8% of the original price, not of the total.',800,470,m('why'),34,COL.task,'middle');txText(p,'test: tax on $49.67 ≈ $3.97 → total $53.64, not $53.99',800,570,m('test'),34,COL.dim,'middle');txMath(p,'p = 53.99 ÷ 1.08 ≈ 49.99',800,735,m('right'),58,TOT);}],
+['q2','Which price?',()=>{const p=panel(0);txTitle(p,'The total is $54.00 · 8% tax','Same scale: 4 px = $1');S.txCh=txChoices(p,[[49.68,3.97,'53.65'],[50,4,'54.00'],[58.32,4.67,'62.99']],4);},{ask:done=>quiz(BAND,[{id:'c-orig',prompt:'Which original price gives a total of $54.00?',build:pickEls(S.txCh,1,'54 ÷ 1.08 = 50, and 1.08 × 50 = 54.',i=>i===0?'That subtracts 8% of the total. Its own tax is $3.97, so the total is only $53.65.':'That multiplies the total by 1.08, going the wrong way. Its total would be $62.99.')}],done)}],
+['fee','Fees are percents too',m=>{const p=panel(0);txTitle(p,'Bike rental: $65 · 17% late fee','A fee works like a tax');const b=txBar(p,160,260,12,65,11.05);txText(p,'rental $65',160+390,395,m('bike'),32,COL.chalk,'middle');txText(p,'late fee',160+780+66,235,m('fee'),30,TAX,'middle');txMath(p,'17% = 0.17',800,520,m('rate'),50,COL.task);txMath(p,'0.17 × 65 = 11.05',800,625,m('fee'),56,TAX);txMath(p,'65 + 11.05 = 76.05',800,735,m('total'),58,TOT);txText(p,'late fee $11.05 · total $76.05',800,830,m('total',1.5),34,COL.dim,'middle');}],
+['feeorig','Work back from a fee',m=>{const p=panel(0);txTitle(p,'Snowboard: total $66.08 · 12% fee included','What was the rental price?');const b=txBar(p,160,255,22,40,4.8);txText(p,'rental price = 100%',160+440,390,m('pct'),32,COL.chalk,'middle');txText(p,'fee 12%',160+880+50,230,m('pct'),30,TAX,'middle');txMath(p,'100% + 12% = 112% = 1.12',800,500,m('pct',1),46,COL.task);txMath(p,'66.08 = 1.12 × p',800,610,m('receipt'),56);txMath(p,'p = 66.08 ÷ 1.12 = 59',800,715,m('divide'),56);txText(p,'check: 0.12 × 59 = 7.08 and 59 + 7.08 = 66.08',800,820,m('check'),33,COL.dim,'middle');}],
+['q3','Fee and total',()=>{const p=panel(0);txTitle(p,'A $45 charge · 20% service fee','Strip: price + fee, to scale');txBar(p,160,260,16,45,9);txText(p,'price $45',160+360,395,0,32,COL.chalk,'middle');txText(p,'fee ?',160+720+72,235,0,30,TAX,'middle');},{ask:done=>quiz(BAND,[{id:'c-fee',prompt:'Find the fee and the total in dollars.',build:blanks([{parts:['fee $',{box:'9'},' total $',{box:'54'}],why:'0.20 × 45 = 9, and 45 + 9 = 54 (or 1.20 × 45).'}])}],done)}],
+['wrap','Four habits',m=>{const p=panel(0);txTitle(p,'Taxes and fees · the same percent idea');[['A tax or fee is a percent of the original price.','w1'],['Extra = rate × price. Total = price + extra = (1 + rate) × price.','w2'],['Know the total? Divide by (1 + rate) to get the original price.','w3'],['Round money to the cent; check by building the total forward.','w4']].forEach(([s,key],i)=>{const g=G(p,{x:-16,y:285+i*145,o:0});mk('circle',{cx:130,cy:-10,r:26,fill:COL.task},g);T(g,String(i+1),{x:130,y:0,size:30,anchor:'middle',fill:COL.board});T(g,s,{x:195,size:31});tw(g,{x:0,o:1},m(key),.6);});}],
+['final1','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-tax',prompt:'Find the tax. Round to the nearest cent; type only the number.',build:blanks([
+{parts:['8% tax on $12.00 = $',{box:'0.96'}],why:'0.08 × 12 = 0.96.'},
+{parts:['8.5% tax on $12.00 = $',{box:'1.02'}],why:'0.085 × 12 = 1.02.'},
+{parts:['9.25% tax on $27.50 = $',{box:'2.54'}],why:'0.0925 × 27.50 = 2.54375, which rounds to 2.54.'},
+{parts:['8% tax on $234.25 = $',{box:'18.74'}],why:'0.08 × 234.25 = 18.74.'}
+])}],done,'Chapter practice 1 of 3')}],
+['final2','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-total',prompt:'Totals and original prices. Round to the nearest cent; type only the number.',build:blanks([
+{parts:['Total with 8.5% tax on $27.50 = $',{box:'29.84'}],why:'27.50 + 2.34 = 29.84, or 1.085 × 27.50 rounded.'},
+{parts:['Total $11.65 includes 6% tax. Original price = $',{box:'10.99'}],why:'11.65 ÷ 1.06 ≈ 10.99.'},
+{parts:['Total $21.80 includes 9% tax. Original price = $',{box:'20'}],why:'21.80 ÷ 1.09 = 20.'},
+{parts:['Total $63 includes 5% tax. Original price = $',{box:'60'}],why:'63 ÷ 1.05 = 60.'}
+])}],done,'Chapter practice 2 of 3')}],
+['final3','Chapter practice',()=>panel(0),{ask:done=>quiz(SCREEN,[{id:'p-fee',prompt:'Fees. Type only the number of dollars.',build:blanks([
+{parts:['15% late fee on an $80 rental = $',{box:'12'}],why:'0.15 × 80 = 12.'},
+{parts:['Total with a 20% fee on a $45 charge = $',{box:'54'}],why:'1.20 × 45 = 54.'},
+{parts:['Total $66.08 includes a 12% fee. Original price = $',{box:'59'}],why:'66.08 ÷ 1.12 = 59.'},
+{parts:['Total $45 includes a 25% fee. Original price = $',{box:'36'}],why:'45 ÷ 1.25 = 36.'}
+])}],done,'Chapter practice 3 of 3')}],
+['finish','Finished',()=>panel(0),{ask:finishCard}]
+].map(([id,title,run,extra])=>({id,title,run,...extra}));
+boot();
+</script></body></html>