Final Exam Model Paper 6
Theory paper: 50 marksTime: 2 hours
Practical exam: 25 marksTime: 1 hour 30 minutes
All questions are compulsory.
A full practice run of the Grade 8 final exam: the theory paper (50 marks, 2 hours) and, below it, the practical exam (25 marks, 1 hour 30 minutes, at a computer, marked by the school). In the theory paper, work out on paper what each program does, as in the exam hall: its programs have no Run button. In the practical exam, the programs run on this page.
A practice paper by Science Playground, made to its own course’s grid; not an official exam paper.
Write your answers on paper first. Then open each answer and its marking scheme, and give yourself one mark for each point you got. In multiple choice, your first choice counts.
Section A
10 × 1 = 101. Choose the correct option for each of the following questions.
Pasang runs a lodge in Namche Bazaar, at 3,440 m. Which of these lines stops his program with an error?
Pick an answer to see why.
A farmer in Jumla packs his apples into crates of 25. What does this program print?
apples = 130crates = 0while apples >= 25: apples = apples - 25 crates = crates + 1print(crates, apples)Pick an answer to see why.
A health post in Mugu keeps its 500 patient records sorted by date. Each evening, the day’s few new records are added at the end, almost in order, and the list is sorted again. Which sort is the better choice, and why?
Pick an answer to see why.
Which of these is an empty element, with no closing tag?
Pick an answer to see why.
Dawa takes a photo in the deep shade of the pine forest by Rara Lake. On his phone the faces and the snow on the far hills look too blue. Which edit fixes it best?
Pick an answer to see why.
Vaccines at a health post must be kept between 2 °C and 8 °C: too warm spoils them, and so does freezing. A micro:bit in the vaccine fridge reads the temperature into temp. Which condition should sound the alarm?
Pick an answer to see why.
Tashi’s photos of her trek sync between her phone and her online storage. To make room on the phone, she deletes 200 of them there. What happens to the copies online?
Pick an answer to see why.
A hotel near Rara Lake shows a chart to people who might invest in it. It has bars for only two months, Kartik and Baisakh, under the title “Full all year round”. Which judgment is right?
Pick an answer to see why.
What is a hallucination in a chatbot’s answer?
Pick an answer to see why.
Pemba asks a chatbot the same question twice, word for word, and gets two different answers. Why?
Pick an answer to see why.
Section B
8 × 1 = 82. Write very short answers to the following questions.
Which Python function turns the text "25" into the whole number 25?
Answer
int(): int("25") gives the number 25.
Marking scheme
int().
In the call boat_fare(4), what is the value 4 called?
Answer
An argument: the value given to the function when it is called. Inside the function, it goes into the matching parameter.
Marking scheme
- An argument.
Why does holding the phone closer to the speaker’s mouth make a recording clearer, even in a noisy room?
Answer
The voice that reaches the microphone gets stronger as the phone comes closer (at half the distance, twice as strong), while the room’s noise stays the same. So the voice is much louder than the noise.
Marking scheme
- Closer makes the voice stronger at the microphone, but not the room’s noise.
Dawa flashes his fridge alarm program onto a micro:bit, unplugs the USB cable and connects a battery pack. Why does the program still run, with no computer?
Answer
Flashing copied the program into the board’s own storage. The board runs it from there by itself; the computer was only needed to write the program and copy it in.
Marking scheme
- The program was copied into the board’s own storage, so the board runs it by itself.
Write one line of HTML for a link to the page rara.html, with the words “Rara Lake, Nepal’s biggest lake”.
Answer
<a href="rara.html">Rara Lake, Nepal’s biggest lake</a>Marking scheme
- An
<a>element withhref="rara.html"and the given words between the tags.
Dawa’s phone saves a minute of video as about 100 MB. His online storage has 2 GB free. About how many minutes of video fit? (1 GB = 1,024 MB.)
Answer
2 GB = 2 × 1,024 = 2,048 MB, and 2,048 ÷ 100 ≈ 20 minutes.
Marking scheme
- About 20 minutes.
A weather club’s program should count the rainy days in a week, but for any week with rain it prints 1. Which line is wrong, and what should it be?
rainy = 0for day in range(1, 8): rain = int(input(f"Rain on day {day}, in mm: ")) if rain > 0: rainy = 1print("Rainy days:", rainy)Answer
Line 5 sets rainy to 1 again on each rainy day instead of adding 1 to it, so it never goes past 1. It should be rainy = rainy + 1.
Marking scheme
- Line 5; it should be
rainy = rainy + 1.
Dawa plans to cross a pass tomorrow. Should he ask a chatbot what tomorrow’s weather will be, or read the official weather forecast? Give one reason.
Answer
The official forecast. A chatbot learned from text collected up to a certain date, so unless it searches as it answers, it knows nothing about tomorrow, and it may still write a confident, made-up answer. The forecast is made from today’s measurements by people who are responsible for it.
Marking scheme
- The official forecast, with a reason: the chatbot may be out of date or make the answer up.
Section C
8 × 2 = 16Write short answers to the following questions.
A weather club in Surkhet measured 12 °C in the morning and 20 °C in the afternoon, and wrote this to find the average:
morning = 12afternoon = 20average = morning + afternoon / 2print("Average:", average)It printed Average: 22.0.
- i.Why did it print 22.0 instead of 16?
- ii.Rewrite line 3 so that it prints the right average.
Answer
- i.Python does
/before+, as in mathematics, so it worked out20 / 2first (10.0) and then added 12: 22.0. - ii.Brackets make the addition happen first:
morning = 12afternoon = 20average = (morning + afternoon) / 2print("Average:", average)Output
Average: 16.0Marking scheme
- i. Division is done before addition, so only 20 was halved.
- ii.
average = (morning + afternoon) / 2.
A school in Surkhet keeps a record of the water in its tank, which holds at most 1,000 liters:
tank = 500tank -= 120tank -= 90tank += 300print("Liters in the tank:", tank)- i.Write the output of the program.
- ii.Write one line of Python, to go at the end, that prints how many more liters the tank can take before it is full.
Answer
i. tank -= 120 means tank = tank - 120, and += adds in the same way: 500 − 120 − 90 + 300 = 590.
Output
Liters in the tank: 590ii. The tank is full at 1,000 liters, so the room left is 1,000 minus what is in it:
tank = 500tank -= 120tank -= 90tank += 300print("Liters in the tank:", tank)print("Room for:", 1000 - tank)Output
Liters in the tank: 590Room for: 410Marking scheme
- i.
Liters in the tank: 590. - ii. A line that prints
1000 - tank(410), with or without words.
The ranger’s office at Rara National Park shows visitors this message:
def park_rules(): print("Stay on the trail.") print("Take your rubbish home.") print("Welcome to Rara National Park!")park_rules()print("Enjoy the lake.")- i.Write the output.
- ii.Lines 1 to 3 come first in the program. Why isn’t “Stay on the trail.” the first line printed?
Answer
i.
Output
Welcome to Rara National Park!Stay on the trail.Take your rubbish home.Enjoy the lake.ii. Lines 1 to 3 only define the function: Python remembers what park_rules means and goes on to line 5, without running the body. The body runs only when the function is called, on line 6; then Python comes back to the line after the call, line 7.
Marking scheme
- i. The four lines in the right order.
- ii. A definition runs nothing; the body runs only when the function is called (line 6), after line 5 has printed.
A trek leader plans 3 liters of drinking water a day for each person. Write a function water_needed(people, days) that returns the liters a group needs, and use it to print the total for 4 trekkers and 2 porters, all on a 3-day walk to Rara Lake.
Answer
def water_needed(people, days): return people * days * 3 print(water_needed(4, 3) + water_needed(2, 3))Output
54(water_needed(6, 3) gives the same 54.)
Marking scheme
- A function
water_neededwith two parameters that returnspeople * days * 3. - A line that calls it with the right arguments and prints the total (54).
Your class cleaned up the plastic along the shore of a lake, and wants a one-minute video of it for the school’s screen.
- i.Write a shot list of at least four shots, in order, with about how many seconds each lasts.
- ii.The first cut is 1 minute 40 seconds long. Name two things to do on the timeline to bring it down to about a minute.
Answer
i. For example:
- The shore with plastic on it, in the morning (5 seconds)
- The class with gloves and sacks, setting out (6)
- Close-ups of hands picking up bottles and wrappers (10)
- A student explaining why plastic harms the lake (20)
- The full sacks lined up (6)
- The clean shore at the end (5)
Six shots, about 52 seconds, leave room for a title and credits.
ii. Any two: trim the start and end of every clip (the wobble as the button was pressed, the moment before anything happened); split long clips and delete their dull middles; delete whole shots that are dull or repeat another. If a clip is boring to the person who filmed it, it is more boring to everyone else.
Marking scheme
- i. At least four shots in a sensible order, each with what it shows and its length, adding up to about a minute.
- ii. Two of: trim the starts and ends of clips, split clips to cut out dull parts, delete dull shots.
In 2010, five flood sensors were put on the Bhote Koshi river near the Friendship Bridge, about 6 km upstream of a hydropower plant. When the water rose to a dangerous level, they set off sirens downstream.
- i.What were the device’s input and output?
- ii.Why were the sensors put so far upstream?
Answer
- i.Input: the sensors measuring the water level in the river. Output: the sirens in four places downstream.
- ii.A flood takes time to travel 6 km down the river. Sensing it far upstream sets off the sirens before it arrives, giving people about 5 to 8 minutes to get away from the river.
Marking scheme
- i. Input the sensors (water level), output the sirens.
- ii. So that the warning comes minutes before the flood reaches the people downstream.
An app’s data about you comes in three kinds. Name them, with an example of each.
Answer
- Given: what you typed or posted yourself, such as your date of birth when you signed up, or a photo.
- Recorded: what the app noted as you used it, such as the time you opened it, how long you watched each video, or where the phone was.
- Guessed (inferred): what a computer worked out from the other two without asking, such as “likes cricket” or “probably a student”.
Marking scheme
- Any two of the three kinds named correctly with an example each.
- The third kind named correctly with an example.
Dawa asks a chatbot for a program that charts the rainfall at Rara Lake. The program it writes starts with import nepal_rainfall, and the chatbot tells him to install that library first. His friend says, “The AI must know libraries we haven’t heard of. Just install it.” Judge the friend’s advice, and say what Dawa should do.
Answer
The advice is risky. Chatbots sometimes make up the names of libraries that sound right but don’t exist, and a criminal can publish harmful code under such a name, waiting for someone to install it. Dawa should first check that the library is real, well known and trusted (or ask his teacher), and never install it just because an AI named it.
Marking scheme
- Risky, because chatbots can make up library names, and harmful code can be published under such a name.
- Check that the library is real, well known and trusted (or ask the teacher) before installing anything.
Section D
4 × 4 = 16Write long answers to the following questions.
In Jestha, a school in Surkhet records the highest temperature of each day for a week. It wants a program that asks for the 7 temperatures, and at the end prints the hottest temperature and on which day it came, how many days were above 35 °C, and “Heat warning!” if 3 or more days were.
- i.Write the program. (3)
- ii.Why should the hottest temperature so far start as the first day’s temperature rather than as 0? (1)
Answer
i.
hottest = int(input("Temperature on day 1: "))hottest_day = 1hot_days = 0if hottest > 35: hot_days = 1for day in range(2, 8): temp = int(input(f"Temperature on day {day}: ")) if temp > hottest: hottest = temp hottest_day = day if temp > 35: hot_days = hot_days + 1print("Hottest:", hottest, "on day", hottest_day)print("Days above 35:", hot_days)if hot_days >= 3: print("Heat warning!")For 33, 36, 38, 34, 37, 31, 35:
Output
Temperature on day 1: 33Temperature on day 2: 36Temperature on day 3: 38Temperature on day 4: 34Temperature on day 5: 37Temperature on day 6: 31Temperature on day 7: 35Hottest: 38 on day 3Days above 35: 3Heat warning!ii. Starting from 0 works only while some temperature is above 0. The same program used in Jumla in Poush, when every reading could be below 0, would print 0, a temperature that wasn’t in the list. Starting from the first value works for any temperatures. (A program that starts hottest at 0, and loops over all 7 days, is accepted in i for these readings.)
Marking scheme
- i. Asks for the 7 temperatures with
int(input(…)), using a loop. - i. Keeps the hottest so far and its day, changing both only when a temperature is bigger.
- i. Counts the days above 35 (not 35 itself), and prints “Heat warning!” only when there are 3 or more.
- ii. Starting at 0 gives a wrong answer if every temperature is below 0; the first value works for any list.
A weather club keeps one day’s rainfall, in millimeters, for five districts of Karnali in two lists:
rain = [42, 18, 35, 9, 27]districts = ["Mugu", "Jumla", "Humla", "Kalikot", "Dolpa"]heavy = 0for i in range(len(rain)): if rain[i] > 30: print(districts[i], "had heavy rain") heavy = heavy + 1print(heavy, "of", len(rain), "districts")- i.Write the output of the program. (2)
- ii.What are
rain[3]anddistricts[0]? (1) - iii.What happens if a line
print(rain[5])is added at the end? Why? (1)
Answer
i. len(rain) is 5, so i goes 0 to 4. Positions 0 (42) and 2 (35) are above 30; the others (18, 9, 27) are not:
Output
Mugu had heavy rainHumla had heavy rain2 of 5 districts- ii.
rain[3]is 9 (positions start at 0: 42, 18, 35, 9), anddistricts[0]is"Mugu", the first item. - iii.It stops with an IndexError: a list of 5 items has the positions 0 to 4 only, so there is no position 5.
Marking scheme
- i. The two lines for Mugu and Humla, in that order.
- i.
2 of 5 districts. - ii. 9 and
"Mugu". - iii. An IndexError, because the positions go only from 0 to 4.
Read the web page and its style sheet, and answer the questions that follow.
index.html
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <title>Rara Lake</title> <link rel="stylesheet" href="style.css"> </head> <body> <h1>Rara Lake</h1> <p class="note">Nepal’s biggest lake, in Mugu district.</p> <table> <tr> <th>Fact</th> <th>Rara Lake</th> </tr> <tr> <td>Height above sea level</td> <td>2,990 m</td> </tr> </table> <p>To read about the trek there, <a href="trek.html">click here</a>.</p> </body></html>style.css
.note { color: #aaaaaa; font-size: 20px;}- i.How does a browser show the lines from
<table>to</table>? (1) - ii.Which element does the CSS rule style, and what does it do to it? (1)
- iii.Write two things in this page that make it harder for some people to use, and how to fix each. (2)
Answer
- i.As a table of two rows and two columns: a header row with “Fact” and “Rara Lake” (in bold, because they are
<th>header cells), and under it a row with “Height above sea level” and “2,990 m”. - ii.
.notepicks every element withclass="note": here the first paragraph. The rule makes its text pale gray (#aaaaaa) and 20 pixels high. - iii.Any two:
- The note’s gray #aaaaaa on white has a contrast of only about 2.3 : 1, too faint to read in sunlight or on a cheap screen. Use a darker gray, such as #555555, or at least #767676 (4.5 : 1).
- The link says “click here”, which tells a screen-reader user who lists the links nothing. Make the link words say where it goes:
<a href="trek.html">the trek to Rara Lake</a>. - There is no viewport line, so a phone lays it out as a screen about 980 px wide and shrinks it. Add
<meta name="viewport" content="width=device-width, initial-scale=1">in the head.
Marking scheme
- i. A table with a header row (Fact, Rara Lake) and one row of data.
- ii. The paragraph with class note: its text is made pale gray and 20 pixels high.
- iii. One problem with its fix: the pale gray (darker color), “click here” (link words that say where it goes), or the missing viewport line (add it).
- iii. A second, different problem with its fix.
Read the given passage and answer the questions that follow.
The night before his trek to Rara Lake, Dawa’s phone says Storage full: it won’t take any more photos. His sister tells him to clear the cache of his video app, and not to press Clear data on his chat app.
- i.Where on the phone should he look first, to see what fills its storage? (1)
- ii.What is an app’s cache, and why is it safe to clear? (1)
- iii.What would he lose if he cleared the chat app’s data? (1)
- iv.What must he be sure of before deleting photos to make room? (1)
Answer
- i.The phone’s Storage settings, which show what fills it, biggest first.
- ii.A cache is a store of spare copies an app keeps to work faster, such as pictures from a feed he scrolled through. It is safe to clear because the app can fetch them all again.
- iii.His settings, his login and what the app holds for him, such as chats not yet backed up: clearing an app’s data is like installing it again from scratch.
- iv.That the photos are backed up somewhere else, and that he has checked the backup, so they aren’t the only copies.
Marking scheme
- i. The Storage settings.
- ii. Spare copies the app keeps to work faster, which it can fetch again.
- iii. His settings, login and chats (what the app holds that isn’t backed up).
- iv. That they are backed up, and the backup checked.
Practical exam
25 marksMarked by the school. Work alone at a computer, with no internet and no AI, in front of the teacher, for 1 hour 30 minutes. Write and run each program, show it working, and answer the teacher’s questions. On this page, press Edit on a program to type in it, and Run to run it.
Boats on Rara Lake. A boat on Rara Lake carries 6 people at most. Write a program for the boatman that:
- asks how many people are in each group that comes to the shore, until he types 0;
- prints how many boats each group needs (a group of 13 needs 3 boats, not 2);
- at the end, prints how many people came and how many boats went out that day.
Run it in front of the teacher with groups of 4, 13 and 6, then 0.
# Boats on Rara Lake: write your program hereboat_holds = 6Answer
boat_holds = 6total_people = 0total_boats = 0people = int(input("How many people in this group? (0 to stop) "))while people != 0: boats = people // boat_holds if people % boat_holds > 0: boats = boats + 1 print("Boats needed:", boats) total_people = total_people + people total_boats = total_boats + boats people = int(input("How many people in this group? (0 to stop) "))print("People today:", total_people)print("Boats today:", total_boats)Output
How many people in this group? (0 to stop) 4Boats needed: 1How many people in this group? (0 to stop) 13Boats needed: 3How many people in this group? (0 to stop) 6Boats needed: 1How many people in this group? (0 to stop) 0People today: 23Boats today: 5A while loop fits, because nobody knows in advance how many groups will come. Other ways of finding the boats are fine, such as adding a boat while people are left. Other wordings of the messages are fine.
Marking scheme
- Sets the running totals to 0 before the loop.
- Asks for a group’s size with
int(input(…)), before the loop and again at the end of each round (or an equivalent). - A
whileloop that stops when 0 is typed. - Works out the full boats with
//(or an equivalent). - An
ifthat adds one more boat when people are left over (%greater than 0), so 6 needs 1 boat and 13 needs 3. - Prints the boats for each group inside the loop.
- Adds each group’s people and boats to the totals, and prints both once, after the loop.
- Runs it in front of the teacher with 4, 13, 6, 0 and gets the right output.
The rain record. This program should record the day’s rain, and warn people near the river when more than 50 mm has fallen. Run it.
rain = int(input("Rain today, in mm: "))if rain > 50: print("Heavy rain: keep away from the river.")print("Rain recorded:" rain, "mm")- i.Write the kind of error and the line Python names.
- ii.Say why it happens.
- iii.Fix the program.
- iv.Test it with 18, 50 and 120 mm: write what each should print first, then run it.
Answer
i. and ii. A SyntaxError, on line 4:
Error message
File "main.py", line 4 print("Rain recorded:" rain, "mm") ^^^^^^^^^^^^^^^^^^^^^SyntaxError: invalid syntax. Perhaps you forgot a comma?The things to print must be separated by commas. Between the string "Rain recorded:" and rain there is no comma, so Python can’t tell where one ends and the next begins.
iii. Put the comma in:
rain = int(input("Rain today, in mm: "))if rain > 50: print("Heavy rain: keep away from the river.")print("Rain recorded:", rain, "mm")Output
Rain today, in mm: 18Rain recorded: 18 mmiv.
| Rain | Should print | Kind of test |
|---|---|---|
| 18 | Rain recorded: 18 mm | ordinary |
| 50 | Rain recorded: 50 mm, with no warning (50 is not more than 50) | edge |
| 120 | Heavy rain: keep away from the river. then Rain recorded: 120 mm | ordinary |
Marking scheme
- Names the SyntaxError and line 4.
- Explains that the comma between the string and rain is missing.
- Puts the comma in, and it runs.
- Writes the expected results for 18, 50 and 120 first, and the program gives them (50 gets no warning).
A page for visitors to Rara Lake. Make a small web page with:
- a title, and a main heading;
- a sentence or two about Rara Lake;
- a list of three things to take on the trek there;
- the photo
rara.jpg, of the lake at sunrise, with alt text; - at least one CSS rule in the style sheet that changes how the page looks.
Show it to the teacher, on a phone width as well.
Answer
One good page (yours will be different):
index.html
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Visit Rara Lake</title> <link rel="stylesheet" href="style.css"> </head> <body> <h1>Visit Rara Lake</h1> <p>Rara, in Mugu district, is Nepal’s biggest lake, ringed by pine forest at almost 3,000 meters.</p> <h2>Take with you</h2> <ul> <li>A warm jacket for the cold mornings</li> <li>A water bottle and purifying tablets</li> <li>A bag to carry your rubbish back</li> </ul> <img src="rara.jpg" alt="Rara Lake at sunrise, with mist over the water, forested hills behind and a wooden viewing tower on the shore"> </body></html>style.css
body { font-family: sans-serif; background-color: #eef6f8;} h1 { color: #1d4e6b;} img { max-width: 100%;}The max-width: 100% rule keeps the photo inside a phone’s screen.
Marking scheme
- A
<title>that says what the page is, with the skeleton (lang, head and body) kept correct. - One
<h1>main heading at the top of the body. - A paragraph (
<p>) about Rara Lake. - A list (
<ul>or<ol>) with three<li>items, opened and closed correctly. - The photo shown with
<img src="rara.jpg">. - Alt text that says what the photo shows (not just “photo” or “image”).
- A CSS rule with a selector and a declaration (property: value;) that changes how the page looks.
Viva. The teacher asks each student about their own work, for example:
- i.In your boat program, how does it decide whether a group needs one more boat? What would it print for a group of 12, and why? (2)
- ii.In the rain record, why does
printneed a comma between"Rain recorded:"andrain? What doesprintput between the things the commas separate? (2) - iii.A page’s style sheet says
font-family: "Noto Sans Devanagari", "Nirmala UI", sans-serif;. Which font does the browser use, and why does the list end withsans-serif? (2)
Answer
- i.
people // 6gives the full boats, andpeople % 6the people left over. If anyone is left over (% 6more than 0), they need one more boat. For 12,12 // 6is 2 and12 % 6is 0: nobody is left over, so it prints 2 boats, with both full. - ii.The comma separates the things to print: here a string and a number. Without it, Python sees two values side by side with nothing to say what to do with them. When it prints,
printputs one space between the things, soRain recorded: 18 mmcomes out with a space after the colon and beforemm, and the comma itself isn’t printed. - iii.The browser uses the first font in the list that the device has: Noto Sans Devanagari if it is there, else Nirmala UI.
sans-serifis a general kind of font, not one font: if the device has neither named font, the browser still uses some plain sans-serif font of its own, rather than any font it likes.
Marking scheme
- i. Explains the leftover check (
%more than 0 means one more boat). - i. 12 needs 2 boats, because 12 % 6 is 0.
- ii. The comma separates the things to print (a string and a number).
- ii.
printputs one space between them; the comma isn’t printed. - iii. The first font in the list that the device has.
- iii.
sans-serifis a general kind, so a device with none of the named fonts still shows a plain sans-serif font.
Your score
0 / 50 theory
0 / 25 practical
34 questions not marked yet
| Section A | – | Full marks 10 |
| Section B | – | Full marks 8 |
| Section C | – | Full marks 16 |
| Section D | – | Full marks 16 |
| Practical exam | – | Full marks 25 |
Marks lost, by unit
Mark a question to see your score here.
