Senait scored 72 in her maths test. The pass mark is 50. Create: passed — is score greater than or equal to passMark? isPerfect — is score exactly 100? (use ===) result — “Pass” if passed, otherwise “Fail” (use the …
Abel’s café in Asmara has special offers. Use the given values and create: getsDiscount — true if total is at least 150 or the customer is a member freeCake — true if the customer is a member and day is …
Merhawi filled in a sign-up form. Some fields are empty. Use Boolean() to turn each value into true (filled) or false (empty): hasName from fullName hasAge from age hasEmail from email hasAgeText from ageText Print exactly: Name filled: true Age …
Yonas is a member of the football club, but he has not paid this month yet. Create two boolean variables: isMember — true hasPaid — false Print them with labels, then print the type of isMember using typeof: Member: true …
The Asmara school club runs a lucky draw. Create: ticket — a random whole number from min (100) to max (120), both included. Use the min–max pattern with max – min + 1. percent — a random whole number from …
Create a variable dice that holds a random whole number from 1 to 6. Use Math.random() and Math.floor(). Then print it with a label, for example: Dice: 4 Your number will change every time you run the program — that …
Selam has a round garden with a radius of 4 metres. Calculate: area — π × radius², rounded to 2 decimals fence — the distance around the garden, 2 × π × radius, rounded to 1 decimal packs — fence …
Abel’s average score is 87.6. Use the Math toolbox to round it in three ways: nearest — rounded to the nearest whole number down — rounded down up — rounded up Then print exactly: Nearest: 88 Down: 87 Up: 88 …
A video in Asmara went viral. The starter has let likes = BigInt(Number.MAX_SAFE_INTEGER); Add 10 more likes with += and print likes. Create groups: how many full groups of 1000 likes (/). Print it. Create rest: the likes left over …
An old story: a king puts 1 grain of rice on the first square of a chessboard, 2 on the second, 4 on the third, doubling every time. On all 64 squares there are 264 − 1 grains. Create total …
