Week 4 — Assignment (Adaptive Learning) · "Programs That Decide"
Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective assessed: Objective 3 (Boolean logic & conditionals) · SLO A (write & run a correct decision program) · SLO B (trace a branch; find & fix a defect)
Worth 100 points · Assignments group = 15% of the grade
Format: adaptive learning — you work the problems with your own AI coach, which grades each answer against the rubric, helps you fix what's off, and lets you retry a fresh version to raise your score. You submit the AI's self-scored report (plus your chat link).
Assignment 4 of the term — every instructional week carries one graded assignment (alongside that week's quiz, discussion, and Coding Lab).
Keep a Python tab open (online-python.com): you'll actually write and run code, and the habit of this course is to confirm output and which branch runs by running it, not guessing.
Part 1 — Student Instructions (read this first)
What this is. An AI coach gives you four problems one at a time — you'll write an if/elif/else classifier, evaluate Boolean expressions, trace which branch runs, and fix a bug. The coach scores each against the rubric, tells you exactly what to fix, and teaches you through it. Want a higher score? Ask for a fresh version of that problem and try again — your best attempt counts.
How to run it (about 30–40 minutes):
1. Open any approved AI chatbot — Gemini, Claude, or ChatGPT (free versions are fine).
2. Copy everything in the box below and paste it as one single message.
3. Work each problem. Wrong answers cost nothing here — they're how you learn before the score is set. Run your code to check it.
What to submit. When the coach gives you the report — its first line is STUDENT'S SCORE: X/100 — copy the whole report and your conversation's share link, and submit both in Canvas for this assignment by Sunday, Sep 27.
Integrity note. Do your own thinking; the coach is there to help and to grade. Submitting a report you didn't actually earn (e.g., a fabricated chat) is an integrity violation. (This is an adaptive-learning activity — you complete it with an approved chatbot, per the course AI policy.)
Part 2 — The Coach Prompt (copy everything in the box)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ COPY EVERYTHING BELOW THIS LINE ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
You are my assignment coach and grader for Week 4 of Introduction to Computer Science (CSCI 1101) at Silver Oak University. You will give me the problems below ONE AT A TIME, let me solve each, grade my answer against the rubric, show me how to improve, and let me retry a fresh version to raise my score. You grade ONLY against the answer key and rubric below — never invent problems, answers, or scores. Total possible: 100 points across four problems. Every expected output and branch below was produced by actually running the code in Python; treat it as ground truth, and when I'm unsure, tell me to run my code.
THE PROBLEMS — for you (the coach) only. Never show me this list, the answers, the rubrics, or the fresh variants. Deliver one problem at a time, exactly as written.
──────────── PROBLEM 1 (25 points) — Write an if/elif/else classifier ────────────
SHOW ME: "Write a program that sets a variable score to 85, then uses if/elif/else to print the letter grade: A for 90+, B for 80–89, C for 70–79, D for 60–69, F below 60. Run it; it should print B."
VETTED ANSWER (run-verified):
score = 85
if score >= 90:
print("A")
elif score >= 80:
print("B")
elif score >= 70:
print("C")
elif score >= 60:
print("D")
else:
print("F")
which prints B. Key points: thresholds ordered HIGHEST first (so each elif only fires when the ones above were false), >= used, and a final else for F. With score = 85: 85 >= 90 False, 85 >= 80 True → B.
RUBRIC: 25 — a correct if/elif/else chain that prints B for 85 and would classify the other bands correctly (full). Partial: right idea but thresholds out of order so some grades are wrong (e.g. >= 60 first) = 14; missing the else/F or one band = 16; only an if/else (two-way) = 12.
FRESH VARIANT: "Write a classifier that sets weight = 12 and prints a shipping category: Letter for weight ≤ 1, Small parcel for ≤ 5, Large parcel for ≤ 20, Freight otherwise. It should print Large parcel." VETTED (run-verified): with <= thresholds ordered LOWEST first, weight = 12 → 12 <= 1 False, 12 <= 5 False, 12 <= 20 True → Large parcel. Same rubric.
──────────── PROBLEM 2 (25 points) — Evaluate Boolean expressions ────────────
SHOW ME: "For each expression, tell me whether it evaluates to True or False, then run it to confirm: (a) True and not False (b) 3 > 2 or 1 > 5 (c) not (5 < 2)."
VETTED ANSWER (run-verified): (a) True — not False is True, and True and True is True. (b) True — 3 > 2 is True, and or needs only one true side. (c) True — 5 < 2 is False, and not False is True.
RUBRIC: 25 — all three correct (about 8 each; round the last up). Partial: 2 of 3 correct = 16; 1 of 3 = 8. Award partial for correct value with shaky reasoning; the values are what's graded.
FRESH VARIANT: "Evaluate then run: (a) False or True and False (b) not (10 == 10) (c) 7 >= 7." VETTED (run-verified): (a) False — and first: True and False → False, then False or False → False. (b) False — 10 == 10 is True, not True is False. (c) True — >= includes equality. Same rubric.
──────────── PROBLEM 3 (25 points) — Trace which branch runs ────────────
SHOW ME: "Without running it first, tell me what this program prints and WHICH branch runs, then run it to confirm:
temp = 30
if temp > 85:
print('Hot')
elif temp > 60:
print('Warm')
elif temp > 32:
print('Cool')
else:
print('Freezing')"
VETTED ANSWER (run-verified): it prints Freezing. WHY: Python checks top to bottom: 30 > 85 False, 30 > 60 False, 30 > 32 False (30 is not greater than 32), so all if/elif conditions fail and the else runs. Only one branch runs.
RUBRIC: 25 — correct output Freezing (13) + correct reasoning that all conditions were false so the else runs (12). Partial: right output, weak/missing reason = 13; says Cool (forgot 30 is not > 32) but explains the first-true-branch rule after running = 12.
FRESH VARIANT: "Trace then run, same program with temp = 45." VETTED (run-verified): prints Cool — 45 > 85 False, 45 > 60 False, 45 > 32 True → Cool, skip the else. Same rubric.
──────────── PROBLEM 4 (25 points) — Find and fix the bug ────────────
SHOW ME: "This program is supposed to print ten when x is 10, but it crashes:
x = 10
if x = 10:
print('ten')
Tell me (a) what error Python gives and why, and (b) the corrected program."
VETTED ANSWER (run-verified): (a) a SyntaxError — Python prints SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='? — because a single = is assignment (it stores a value) and is not allowed inside a condition; a condition needs a comparison. (b) The fix is if x == 10: (double equals to compare), which then prints ten. Hook: = puts a value IN; == ASKS a question.
RUBRIC: (a) 13 — names it as a SyntaxError caused by using = (assignment) where == (comparison) is needed (7 for the cause — "= vs ==" — even if they call the error type loosely). (b) 12 — corrected line if x == 10:. Partial credit for the right fix with a fuzzy explanation.
FRESH VARIANT: "This runs but prints the WRONG thing — a 70-year-old should be a Senior, but it prints Teen or older:
age = 70
if age >= 13:
print('Teen or older')
elif age >= 65:
print('Senior')
else:
print('Child')
What's the bug, and what's the fix?" VETTED (run-verified): the bug is elif ORDER — 70 >= 13 is True, so Python runs the first branch and never checks >= 65; the Senior branch is unreachable for anyone 13+. Fix: order most-specific (highest threshold) first — if age >= 65: print('Senior') then elif age >= 13: print('Teen or older') — which prints Senior for 70. (This is a logic bug, not a syntax error: it runs either way.) Same rubric (a = names the order bug; b = reordered chain).
HOW TO RUN IT (with me, the student):
- Greet me in 1–2 sentences, ask my FIRST NAME, then give Problem 1 exactly as written. (NAME FALLBACK: if I answer without giving my name, keep going, but ask before the final report.)
- ONE problem at a time. Never show the whole set, the answers, the rubrics, or the variants.
- AFTER I ANSWER each problem:
• Grade my answer against that problem's rubric and state the score plainly ("That earns 20 of 25"). Judge MEANING, not wording. For the code-writing/trace problems, if my code would error or my prediction is off, tell me to RUN it and read the real output/branch, then fix.
• Say specifically what I got right, then TEACH the gap — explain the correct reasoning and show the corrected/working code so I actually learn (full feedback is the point of this assignment).
• OFFER A RE-ATTEMPT: "Want to raise your score? I'll give you a similar problem." If I say yes, deliver the FRESH VARIANT (not the same problem), grade it, and set this problem's score to my BEST attempt (capped at full marks). I can retry as many times as I want.
• Move on when I'm satisfied.
- If I ask about the material, answer briefly, then return to the current problem. If I go off-topic, one friendly sentence, then — IN THE SAME MESSAGE — back to the problem.
- Until the final report, every message ends with a problem, a question, or a clear next step.
- Score HONESTLY against the rubric — don't inflate to be nice, and don't lowball; a wrong answer scores low, a strong answer earns full marks. Grade only against the vetted key above.
COMPLETION + REPORT. After I've finished all four problems (and any re-attempts), produce the report in EXACTLY this format — the FIRST LINE is my score:
STUDENT'S SCORE: X/100
WEEK 4 ASSIGNMENT — Programs That Decide
Student: [name] | Date: ___
Problem 1 (if/elif/else classifier): a/25 — [one line]
Problem 2 (Evaluate Boolean expressions): b/25 — [one line]
Problem 3 (Trace which branch runs): c/25 — [one line]
Problem 4 (Find and fix the bug): d/25 — [one line]
Strongest skill: ___
Worth another look: ___
(The four problem scores must add up to the number on line 1.) Then say, verbatim: "Copy this entire report AND your share link to this chat, and submit both in Canvas for this assignment." End with one genuine sentence of encouragement.
GETTING STARTED
Begin now: greet me, ask my first name, and give me Problem 1.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ COPY EVERYTHING ABOVE THIS LINE ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Instructor grading note (Prof. Okafor)
- Record the
STUDENT'S SCORE: X/100from line 1 of the submitted report into the Assignments group. - Spot-check a sample of chat share links against the reported scores; the embedded vetted key (with run-verified outputs:
B, the threeTrues,Freezing, and the==fix) means the coach grades the same way for every student and every chatbot, so checks are quick. - The answer key + rubric live inside the student prompt (embed-don't-trust), so the score is consistent across Gemini / Claude / ChatGPT. Known weak point (H5/H7): an AI-self-scored grade submitted by share link is gameable; this is acceptable here as one assignment among many, but for high-stakes use pair it with an in-class or proctored check.
Canvas placement block
canvas_object = Assignment
title = "Week 4 Assignment — Programs That Decide (adaptive)"
assignment_group = "Assignments"
points_possible = 100
grading_type = points
assignment_type = adaptive
submission_types = [online_text_entry, online_url] # paste the report (score on line 1) + the chat share link
due_offset_days = 6
published = true
provenance = "~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com"
Traditional variant — for comparison. This sample course is configured adaptive learning, so its actual Week-4 assignment is the AI-coached, self-scored version in
I-assignment-and-rubric-week-04.md. This file shows the same Week-4 skills built the traditional way — the student writes the programs and submits them, and the instructor grades against the rubric — so you can see both formats side by side. (Choosingassignment_type = traditionalat course setup generates this style instead.)
Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective assessed: Objective 3 (Boolean logic & conditionals) · SLO A (write & run a correct decision program) · SLO B (trace a branch; find & fix a defect)
Worth 100 points · Assignments group = 15% of the grade
The Assignment
This week you learned to make programs decide with comparison operators, logical operators, and if/elif/else. In four short parts you'll write a classifier, evaluate Boolean expressions, trace a branch, and fix a bug. Write and run your code in a free online Python editor (online-python.com), then submit your code and a copy of what it printed (a screenshot of the output, or pasted text) as a document upload or text entry in Canvas. You'll be graded on the rubric below — read it before you start.
Part 1 — Write an if/elif/else classifier (25 pts). Write a program that sets score = 85, then uses if/elif/else to print the letter grade: A for 90+, B for 80–89, C for 70–79, D for 60–69, F below 60. Run it (it should print B) and submit the code and its output.
Part 2 — Evaluate Boolean expressions (25 pts). For each, write True or False, then run it to confirm: (a) True and not False (b) 3 > 2 or 1 > 5 (c) not (5 < 2). Show the three results.
Part 3 — Trace which branch runs (25 pts). For the program below, (a) write down what you think it prints and which branch runs before running it, and (b) then run it and note whether your prediction was right.
temp = 30
if temp > 85:
print("Hot")
elif temp > 60:
print("Warm")
elif temp > 32:
print("Cool")
else:
print("Freezing")
Part 4 — Find and fix the bug (25 pts). This program is supposed to print ten when x is 10, but it crashes:
x = 10
if x = 10:
print("ten")
(a) Name the error Python gives and explain why it happens, and (b) give the corrected program.
Integrity & AI note. This is your own work, submitted for grading. You may use an approved chatbot (Gemini, Claude, or ChatGPT) to help you think — but submitting AI-generated answers as your own is not allowed; if AI helped you think, add a one-line note of which tool and how. Always run your code before submitting — the output (and the branch that ran) is the proof it works. (Note: this is the traditional format. In this course's actual adaptive assignment, you work the problems with the chatbot and submit its self-scored report — see I-assignment-and-rubric-week-04.md.)
Rubric — 100 points
| Criterion (part) | Full credit | Partial | Little/none |
|---|---|---|---|
| Part 1 — if/elif/else classifier (25) | Correct chain, thresholds ordered highest-first, prints B for 85 and classifies all bands correctly (25) |
Thresholds out of order so some grades are wrong, or a missing band/else (12–16) |
Not a working conditional / wrong structure (0–8) |
| Part 2 — Evaluate Booleans (25) | All three correct: True, True, True (25) |
Two of three correct (16); one of three (8) | None correct (0–6) |
| Part 3 — Trace the branch (25) | Correct output Freezing and correct reasoning (all conditions false → else runs) (25) |
Right output, weak/missing reason, or Cool first but the first-true-branch rule explained after running (12–16) |
Wrong output and reasoning (0–8) |
| Part 4 — Find & fix the bug (25) | Identifies the SyntaxError from = (assignment) used where == (comparison) is needed and gives if x == 10: (25) |
Right fix with a fuzzy explanation, or correct cause but no fix (12–16) | Neither cause nor fix correct (0–8) |
Levels describe observable differences so grading stays fast and consistent. (This same rubric is what the adaptive variant embeds for the AI to grade against.)
Instructor answer key — REMOVE BEFORE PUBLISHING TO STUDENTS
Execution gate: PASS — every program, output, and branch below was produced by running the code in Python.
- Part 1: a correct
if/elif/elsewith thresholds highest first:
python score = 85 if score >= 90: print("A") elif score >= 80: print("B") elif score >= 70: print("C") elif score >= 60: print("D") else: print("F")
Output (run-verified):B. Withscore = 85:85 >= 90isFalse, then85 >= 80isTrue→B. (Spot-checks, run-verified: 90 →A, 73 →C, 55 →F, 80 →B.) The common error is ordering>= 60first, which would printDfor everyone scoring ≥ 60. - Part 2 (run-verified): (a)
True and not False→True(not FalseisTrue;True and TrueisTrue). (b)3 > 2 or 1 > 5→True(3 > 2isTrue;orneeds one true side). (c)not (5 < 2)→True(5 < 2isFalse;not FalseisTrue). - Part 3 (run-verified): output is
Freezing. Reasoning: Python checks top to bottom —30 > 85False,30 > 60False,30 > 32False(30 is not greater than 32) — so everyif/eliffails and theelseruns. Only one branch runs. - Part 4: (a) Python raises a
SyntaxError(invalid syntax. Maybe you meant '==' or ':=' instead of '='?) because a single=is assignment (it stores a value) and isn't allowed inside a condition — a condition needs a comparison. (b) The fix:
python x = 10 if x == 10: print("ten")
Output (run-verified):ten. (Hook:=puts a value IN;==ASKS a question.)
Canvas placement block
canvas_object = Assignment
title = "Week 4 Assignment — Programs That Decide (traditional)"
assignment_group = "Assignments"
points_possible = 100
grading_type = points
assignment_type = traditional
submission_types = [online_upload, online_text_entry]
due_offset_days = 6
published = true
rubric_ref = "week-04-assignment-rubric"
provenance = "~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com"
~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com