Area and Volume Worksheet Generator
Generate a fresh 20-problem practice set on area and volume: polygons, circles, prisms, cylinders, missing dimensions, and real-world word problems.
Skill: area-volume
Each click of Generate builds a brand-new set of 20 problems. Toggle the answer key any time; printing includes the key only when it is visible.
Area and Volume Practice Worksheet
Answer Key
For the teacher or for self-checking after you finish.
'use strict'; /* ===================================================================== Area/Volume worksheet generator — pure logic (no DOM) so it can be tested. ===================================================================== */ function mulberry32(a){ return function(){ a |= 0; a = (a + 0x6D2B79F5) | 0; var t = Math.imul(a ^ (a >>> 15), 1 | a); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; } var _rand = Math.random; function setSeed(s){ _rand = mulberry32(s >>> 0); } function ri(lo, hi){ return lo + Math.floor(_rand() * (hi - lo + 1)); } function pick(arr){ return arr[Math.floor(_rand() * arr.length)]; } function chance(p){ return _rand() < p; } function shuffle(a){ for (var i = a.length - 1; i > 0; i--){ var j = Math.floor(_rand() * (i + 1)); var t = a[i]; a[i] = a[j]; a[j] = t; } return a; } var PI = Math.PI; function r2(v){ return Math.round(v * 100) / 100; } function piKey(n){ return n === 1 ? '\u03C0' : n + '\u03C0'; } function ansNum(v, unit){ return { k: 'n', v: r2(v), unit: unit }; } function ansPi(n, unit){ return { k: 'pi', n: n, v: r2(n * PI), unit: unit }; } function keyHTML(a){ var s = a.k === 'pi' ? piKey(a.n) + ' \u2248 ' + a.v : String(a.v); return '' + s + ' ' + a.unit; }
/* ---- generators: each returns {stemHTML, answer} ---- */ function gRect(diff){ var l = ri(2, diff === 'hard' ? 25 : 12), w = ri(2, diff === 'hard' ? 25 : 12); return { stemHTML: 'Find the area of a rectangle ' + l + ' by ' + w + '.', answer: ansNum(l * w, 'sq units') }; } function gTri(diff){ var b = ri(2, diff === 'hard' ? 20 : 12), h = ri(2, diff === 'hard' ? 20 : 12); return { stemHTML: 'Find the area of a triangle with base ' + b + ' and height ' + h + '.', answer: ansNum(b * h / 2, 'sq units') }; } function gPara(diff){ var b = ri(3, diff === 'hard' ? 20 : 12), h = ri(2, diff === 'hard' ? 16 : 10); return { stemHTML: 'Find the area of a parallelogram with base ' + b + ' and height ' + h + '.', answer: ansNum(b * h, 'sq units') }; } function gTrap(diff){ var b1 = ri(3, diff === 'easy' ? 8 : 14), b2 = ri(4, diff === 'easy' ? 10 : 16), h = ri(2, diff === 'easy' ? 6 : 10); if (b1 === b2) b2 += 2; return { stemHTML: 'Find the area of a trapezoid with bases ' + b1 + ' and ' + b2 + ' and height ' + h + '.', answer: ansNum((b1 + b2) * h / 2, 'sq units') }; } function gCirc(diff){ var r = ri(2, diff === 'easy' ? 5 : diff === 'medium' ? 8 : 12); return { stemHTML: 'Find the area of a circle with radius ' + r + '. (Exact with \u03C0 and decimal.)', answer: ansPi(r * r, 'sq units') }; } function gCircD(diff){ var r = ri(2, diff === 'hard' ? 10 : 7), d = 2 * r; return { stemHTML: 'Find the area of a circle with diameter ' + d + '. (Exact with \u03C0 and decimal.)', answer: ansPi(r * r, 'sq units') }; } function gCube(diff){ var s = ri(2, diff === 'hard' ? 12 : 9); return { stemHTML: 'Find the volume of a cube with side length ' + s + '.', answer: ansNum(s * s * s, 'cubic units') }; } function gPrism(diff){ var l = ri(2, diff === 'hard' ? 15 : 9), w = ri(2, diff === 'hard' ? 15 : 9), h = ri(2, diff === 'hard' ? 15 : 9); return { stemHTML: 'Find the volume of a rectangular prism ' + l + ' by ' + w + ' by ' + h + '.', answer: ansNum(l * w * h, 'cubic units') }; } function gCyl(diff){ var r = ri(2, diff === 'easy' ? 4 : 6), h = ri(3, diff === 'easy' ? 8 : 12); return { stemHTML: 'Find the volume of a cylinder with radius ' + r + ' and height ' + h + '. (Exact with \u03C0 and decimal.)', answer: ansPi(r * r * h, 'cubic units') }; } function gRevTri(diff){ var b = ri(2, 10), h = ri(3, 12), A = b * h / 2; if (A !== Math.floor(A)){ h += 1; A = b * h / 2; } return { stemHTML: 'A triangle has area ' + A + ' square units and base ' + b + '. Find its height.', answer: ansNum(h, 'units') }; } function gTank(diff){ var r = ri(2, 5), h = ri(4, diff === 'hard' ? 12 : 9); return { stemHTML: 'A cylindrical water tank has radius ' + r + ' m and height ' + h + ' m. Find its volume in cubic meters. (Exact with \u03C0 and decimal.)', answer: ansPi(r * r * h, 'm\u00B3') }; } function gFloor(diff){ var l = ri(8, diff === 'hard' ? 30 : 20), w = ri(6, diff === 'hard' ? 24 : 16); return { stemHTML: 'A rectangular room is ' + l + ' ft by ' + w + ' ft. How many square feet of carpet are needed?', answer: ansNum(l * w, 'sq ft') }; }
var PLAN = { easy: [gRect, gRect, gRect, gTri, gTri, gTri, gPara, gPara, gCirc, gCirc, gCube, gCube, gPrism, gPrism, gPrism, gCyl, gRevTri, gFloor, gRect, gTri], medium: [gRect, gRect, gTri, gTri, gPara, gTrap, gTrap, gCirc, gCircD, gCircD, gCube, gPrism, gPrism, gCyl, gCyl, gRevTri, gTank, gFloor, gTrap, gCyl], hard: [gRect, gTri, gPara, gTrap, gTrap, gCirc, gCircD, gCircD, gCube, gPrism, gPrism, gCyl, gCyl, gRevTri, gRevTri, gTank, gTank, gFloor, gCyl, gTrap] };
function generateSet(seed, difficulty){ if (!PLAN[difficulty]) throw new Error('generateSet: bad difficulty ' + difficulty); setSeed(seed >>> 0); var plan = shuffle(PLAN[difficulty].slice()); var problems = plan.map(function (gen){ return gen(difficulty); }); if (problems.length !== 20) throw new Error('generateSet: expected 20 problems'); return problems; }
/* ---- DOM wiring ---- */ var current = { problems: [], difficulty: 'medium', keyVisible: false, genCount: 0 }; var el = {}; function renderProblems(){ el.problems.innerHTML = current.problems.map(function (p, i){ return '
'; }).join(''); el.probCount.textContent = current.problems.length + ' problems \u00B7 ' + current.difficulty.charAt(0).toUpperCase() + current.difficulty.slice(1); } function renderKey(){ el.keyGrid.innerHTML = current.problems.map(function (p, i){ return '
'; }).join(''); } function newSet(seed){ current.seed = (seed === undefined) ? ((Date.now() + (current.genCount * 7919)) >>> 0) : (seed >>> 0); current.genCount++; current.problems = generateSet(current.seed, current.difficulty); renderProblems(); if (current.keyVisible) renderKey(); } function setKeyVisible(v){ current.keyVisible = v; el.keySection.hidden = !v; el.btnKey.setAttribute('aria-pressed', v ? 'true' : 'false'); el.btnKey.textContent = v ? 'Hide Answer Key' : 'Show Answer Key'; if (v) renderKey(); } function init(){ el.diffSel = document.getElementById('diffSel'); el.btnGen = document.getElementById('btnGen'); el.btnKey = document.getElementById('btnKey'); el.btnPrint = document.getElementById('btnPrint'); el.problems = document.getElementById('problems'); el.probCount = document.getElementById('probCount'); el.keySection = document.getElementById('keySection'); el.keyGrid = document.getElementById('keyGrid'); current.difficulty = el.diffSel.value; el.diffSel.addEventListener('change', function(){ current.difficulty = el.diffSel.value; newSet(); }); el.btnGen.addEventListener('click', function(){ newSet(); }); el.btnKey.addEventListener('click', function(){ setKeyVisible(!current.keyVisible); }); el.btnPrint.addEventListener('click', function(){ window.print(); }); newSet(); } if (document.readyState === 'loading'){ document.addEventListener('DOMContentLoaded', init); } else { init(); }
window.__WS = { generateSet: generateSet, keyHTML: keyHTML, ansNum: ansNum, ansPi: ansPi, getState: function(){ return current; }, newSet: newSet, setKeyVisible: setKeyVisible };