Lab Instructor
AbdalRaheem Al Smadi
afalsmadi@uaeu.ac.ae
Office: E1, Floor 3, Room 3040
Office Hours: Announced on Blackboard
Course Detail
Studio-style labs convert CSBP119 theory into applied fluency through structured practice, debugging routines, and guided assessments.
AbdalRaheem Al Smadi
afalsmadi@uaeu.ac.ae
Office: E1, Floor 3, Room 3040
Office Hours: Announced on Blackboard
Labs and coordinator details are published on E-Services and Blackboard announcements.
Lab assignments and projects help students master structured programming concepts: problem-solving, simple and structured data types, input/output, selection, repetition, and methods.
| Week | Topic(s) | CLOs | Methods |
|---|---|---|---|
| Week 1 | Lab0: Introduction and installation | CLO1 | Problem Based Learning |
| Week 2 | Lab1: Pseudocode & flowcharts (Ch.2) | CLO1 | Problem Based Learning |
| Week 3 | Lab2: Simple programs, debugging (Ch.2) | CLO1 | Problem Based Learning |
| Week 4 | Lab3: Algorithm tracing (Ch.2) | CLO1, CLO2 | Problem Based Learning |
| Week 5 | Lab4: Decision structures (Ch.3) | CLO1, CLO3 | Problem Based Learning |
| Week 6 | Lab5: Repetition structures (Ch.4) | CLO1, CLO3 | Problem Based Learning |
| Week 7 | Lab Quiz 1 / Lab6: Repetition practice | CLO3 | Problem Based Learning |
| Week 8 | Lab7: Math module | CLO1, CLO3 | Problem Based Learning |
| Week 10 | Lab8: Predefined and user-defined methods | CLO1, CLO3 | Problem Based Learning |
| Week 11 | Lab Quiz 2 / Lab10: One-dimensional lists | CLO1, CLO3 | Problem Based Learning |
| Week 12 | Lab11: Two-dimensional lists & tuples | CLO4, CLO5 | Problem Based Learning |
| Week 13 | Lab12: Strings | CLO4, CLO5 | Problem Based Learning |
| Week 14 | Lab9: File I/O | CLO1, CLO4 | Problem Based Learning |
Labs align one-to-one with the topical outline.
| Lab | Focus | Linked Week |
|---|---|---|
| Lab0 | Orientation & installation | Week 1 |
| Lab1 | Pseudocode & flowcharts | Week 2 |
| Lab2 | Basic programs & debugging | Week 3 |
| Lab3 | Tracing algorithms | Week 4 |
| Lab4 | Decision structures | Week 5 |
| Lab5 | Repetition structures | Week 6 |
| Lab6 | Repetition quiz & reinforcement | Week 7 |
| Lab7 | Math module practice | Week 8 |
| Lab8 | Methods practice | Week 10 |
| Lab9 | File I/O | Week 14 |
| Lab10 | One-dimensional lists | Week 11 |
| Lab11 | Two-dimensional lists & tuples | Week 12 |
| Lab12 | Strings | Week 13 |
Set up the tools and build confidence navigating the lab environment.
Collect configuration details and print a launch checklist.
ide = input("IDE installed (y/n): ").strip().lower()
python = input("Python installed (y/n): ").strip().lower()
git = input("Git installed (y/n): ").strip().lower()
print("Environment Checklist")
print("IDE ready:", ide == "y")
print("Python ready:", python == "y")
print("Git ready:", git == "y")
Simulate version prompts without calling system commands.
py_version = "3.12.0"
pycharm_version = "2024.1"
print("Python version:", py_version)
print("PyCharm version:", pycharm_version)
Translate problem statements into structured pseudocode and simple console I/O.
Use pseudocode to greet a user and collect their major.
name = input("Enter your name: ")
major = input("Enter your major: ")
print("Welcome", name)
print("Major:", major)
Prompt for steps and convert to kilometers.
steps = int(input("Steps walked today: "))
meters = steps * 0.8
kilometers = meters / 1000
print("Distance:", round(kilometers, 2), "km")
Write small programs and correct syntax/logical mistakes.
Fix the provided snippet and print the sum of two integers.
first = int(input("First number: "))
second = int(input("Second number: "))
result = first + second
print("Sum =", result)
Read Celsius and convert to Fahrenheit with correct math.
celsius = float(input("Temperature °C: "))
fahrenheit = celsius * 9 / 5 + 32
print("Fahrenheit:", round(fahrenheit, 1))
Trace intermediate values and match pseudocode to output.
Track monthly savings and display status each month.
target = 500
balance = 0
month = 1
while balance < target:
deposit = int(input("Month " + str(month) + " deposit: "))
balance += deposit
print("Balance after month", month, "=", balance)
month += 1
Simulate a simple counter loop and show the trace.
counter = 0
limit = int(input("Loop until: "))
while counter <= limit:
print("Counter:", counter)
counter += 1
Apply if/elif/else logic to real-world checkpoints.
Grant or deny lab entry based on badge type.
badge = input("Badge type (student/faculty/staff): ").strip().lower()
if badge == "faculty":
print("Access granted to all labs")
elif badge == "staff":
print("Access granted to support labs")
else:
print("Access granted to student labs only")
Check if a student qualifies for lab leadership.
gpa = float(input("Current GPA: "))
hours = int(input("Completed credits: "))
if gpa >= 3.0 and hours >= 30:
print("Eligible for lab leadership role")
else:
print("Keep building your portfolio")
Practice while and for loops to automate tasks.
Allow up to three password tries.
attempts = 0
secret = "uaeu"
while attempts < 3:
guess = input("Password: ")
if guess == secret:
print("Welcome!")
break
attempts += 1
if attempts == 3:
print("Account locked")
Print the first ten multiples of a number.
number = int(input("Number: "))
count = 1
while count <= 10:
print(number, "x", count, "=", number * count)
count += 1
Reinforce loop comfort with sentinel-controlled labs.
Read integers until -1 and compute the average.
total = 0
count = 0
value = int(input("Enter a number (-1 to stop): "))
while value != -1:
total += value
count += 1
value = int(input("Enter a number (-1 to stop): "))
if count > 0:
print("Average:", total / count)
else:
print("No values entered")
Countdown from a user-specified number.
start = int(input("Countdown start: "))
while start >= 0:
print(start)
start -= 1
Combine math helpers and built-in functions.
Compute how many boxes are needed for supplies.
import math
items = int(input("Items to pack: "))
box_size = int(input("Items per box: "))
boxes = math.ceil(items / box_size)
print("Boxes required:", boxes)
Use math.sqrt to compute triangle hypotenuse.
import math
a = float(input("Side a: "))
b = float(input("Side b: "))
hyp = math.sqrt(a * a + b * b)
print("Hypotenuse =", round(hyp, 2))
Encapsulate logic in reusable functions.
Define a function that returns a greeting string.
def greet(name):
message = "Hello " + name
return message
user = input("Name: ")
print(greet(user))
Use a helper function to clamp scores between 0 and 100.
def clamp_score(score):
if score < 0:
return 0
if score > 100:
return 100
return score
raw = int(input("Score: "))
print("Normalized:", clamp_score(raw))
Practice reading and writing text files with clear messaging.
Display lines from schedule.txt if present.
try:
with open("schedule.txt", "r", encoding="utf-8") as file:
for line in file:
cleaned = line.strip()
if cleaned:
print(cleaned)
except FileNotFoundError:
print("schedule.txt not found")
Write a single-line note to lab_notes.txt.
note = input("Lab note: ").strip()
try:
with open("lab_notes.txt", "a", encoding="utf-8") as file:
file.write(note + "\n")
print("Note saved.")
except OSError as error:
print("Could not save note:", error)
Manipulate simple collections of values.
Build a list from user entries and calculate the total.
scores = []
count = int(input("How many scores? "))
index = 0
while index < count:
score = float(input("Score: "))
scores.append(score)
index += 1
total = 0
for value in scores:
total += value
print("Total:", total)
Find the largest number in a list.
numbers = [12, 5, 19, 3]
largest = numbers[0]
for value in numbers:
if value > largest:
largest = value
print("Largest:", largest)
Represent grids and coordinate data using nested structures.
Iterate through a 2D list and print row/seat assignments.
seats = [
["S1", "S2"],
["S3", "S4"]
]
row_index = 0
while row_index < len(seats):
seat_index = 0
while seat_index < len(seats[row_index]):
print("Row", row_index, "Seat", seats[row_index][seat_index])
seat_index += 1
row_index += 1
Store points as tuples and print them.
points = [(2, 3), (4, 1), (0, 0)]
for point in points:
print("Point:", point[0], point[1])
Perform string parsing and reporting.
Count words in a sentence using split().
sentence = input("Enter a sentence: ").strip()
words = sentence.split()
print("Word count:", len(words))
Flip lowercase/uppercase characters manually.
text = input("Text: ")
converted = ""
index = 0
while index < len(text):
char = text[index]
if char.islower():
converted += char.upper()
else:
converted += char.lower()
index += 1
print(converted)