Reference no: EM133917531
Introduction to Information Technology
Assignment - Python Fundamentals
This assignment will test your knowledge and skills in tackling a challenge by implementing the problem-solving process to produce a suitable logical solution via a piece of code in Python. As such, the assignment requires you to integrate and synthesise what you have learnt so far in this unit (content from weeks 2 to 6), in order to design and create a proper working solution.
How you will be marked: Case study 1 and 2
You must complete all seven steps for case studies 1 and 2. Write clearly and keep evidence (sketches, notes, screenshots). The code is only one part of the grade-your process also matters. Get expert-level assignment help in any subject.
1 From the Boolean circuits given, obtain the corresponding Boolean expression (one for each circuit a) and b). Be sure showing EACH step marked as a) to j) in both circuits. 20
2 Create a code in Python that simulates the behavior of each circuit. That is, your code should accept inputs A, B, and C, and print out the corresponding outputs X and Y. 30
3 Write the truth tables for each circuit and test that your circuits behave as expected. 25
Sample Case Study Answer - Mini Library Catalog.
Step 1 - Understand the problem
In your own words: what will the program do for book titles, metadata, and reports? Who is the user? What is "done"?
Step 2 - Inputs & outputs
Inputs: book title(s) (string), year (int, e.g., 1400-2025), genre (string).
Outputs: (a) all books A-Z; (b) by-genre lists + counts; (c) oldest/newest year.
Step 3 - Algorithm
Collect titles until DONE , ignore blanks; deduplicate; sort.
For each unique title, get year (validate) and genre; build catalog: genre → list of (title, year, genre).
Print reports; compute oldest/newest from all years.
Step 4 - Flowchart & Pseudo code (flowchart not shown)
# Pseudocode sketch BEGIN
titles ← [] REPEAT
t ← input("title or DONE")
IF t == "DONE" THEN EXIT LOOP
IF t not empty THEN append t to titles
UNTIL false
titles ← sorted(unique(titles)) catalog ← {}
FOR each title IN titles year ← validated int
genre ← string or "Unknown" book ← (title, year, genre) catalog[genre].append(book)
PRINT reports (A-Z, by-genre, oldest/newest) END
Step 5 - Python code (skeleton only)
def collect_titles(): titles = []
while True:
t = input("Enter book title (or DONE): ").strip() if t.upper() == "DONE":
break
if t:
titles.append(t) return titles
def build_catalog(titles):
unique = sorted(set(titles)) catalog = {}
for title in unique: while True:
y = input(f"Year for '{title}': ").strip() if y.isdigit():
year = int(y); break
print("Enter a valid year (numbers only).")
genre = input(f"Genre for '{title}': ").strip() or "Unknown" catalog.setdefault(genre, []).append((title, year, genre))
return catalog
def print_reports(catalog):
all_books = [b for books in catalog.values() for b in books] print("\\n=== All Books (A-Z) ===")
for t, y, g in sorted(all_books, key=lambda x: x[0].lower()): print(f"{t} ({y}) - {g}")
print("\\n=== By Genre ===") for g in sorted(catalog):
print(f"{g} ({len(catalog[g])})")
for t, y, _ in sorted(catalog[g], key=lambda x: x[0].lower()): print(f" - {t} ({y})")
if all_books:
years = [y for _, y, _ in all_books]
print(f"\\nOldest year: {min(years)}") print(f"Newest year: {max(years)}")
def main():
titles = collect_titles()
catalog = build_catalog(titles) print_reports(catalog)
if name == " main ": main()
Step 6 - Test
Prepare "handwritten" expectations for 3 titles (inc. a duplicate). Verify A-Z order, per-genre counts, oldest/newest.
Step 7 - Refine with GenAI
Example prompt: "Suggest improvements to input validation and reporting format for my Python library catalog (code below). Keep the program structure and explain changes."
Case Study 1 - Campus Café Checkout
Scenario. Build a simple point-of-sale console to add items to a cart and print a receipt.
Learning goals
Use a dict for prices, a list as a cart, a set for unique categories
Practice while menus, for loops, floats, Booleans, and functions
Requirements
Menu (dict). Provide ≥6 items with prices and a category (e.g., drink/food).
Looping menu (while). 1) Show menu 2) Add item 3) View cart 4) Checkout 5) Exit.
Receipt. Show line items, subtotal, tax (10%), and total. Ask for student discount (5%).
Functions (≥4). Suggested: show_menu(), add_item(cart), view_cart(cart), checkout(cart).
Stretch (optional. will give you extra marks if needed)
Quantities (e.g., "2x muffin").
Show unique categories using a set.
Apply a simple meal deal if both food+drink present.
Case Study 2 - Smart Classroom Monitor
Scenario. Monitor a classroom: check-ins, equipment status, and temperature logs. Get expert-level assignment help in any subject.
Learning goals
Combine Booleans, ints/floats/strings, sets, lists, tuples, and dicts
Use if, for/while, and functions
Requirements
Room state (dict). Track: {"projector_on": bool, "capacity": int, "topic": str}
Attendance (set). Add/remove student names; show count vs capacity.
Temperature log (list of floats). Add readings; compute (min, max, avg) in a helper function returning a tuple.
Alerts (if). Over capacity → "ROOM FULL"; out-of-range temp (<16 or >28) → warning; topic set but projector off at exit → reminder.
Menu (while) & Functions (≥5). Suggested: toggle_projector, set_topic, add_student, remove_student, add_temp, stats, report.
Case Study 3 - A Boolean Circuit Equivalence
Scenario. Given a Boolean circuit, work out its Python equivalent code.
Learning goals
Translate a logic problem into its Python code equivalent.
Propose a suitable solution for the logic given using Python-based code.
Requirements
From the Boolean circuits given, obtain the corresponding Boolean expression (one for each circuit a) and b). Be sure showing EACH step marked as a) to j) in both circuits.
Create a code in Python that simulates the behavior of each circuit. That is, your code should accept inputs A, B, and C, and print out the corresponding outputs X and Y.
Write the truth tables for each circuit and test that your circuits behave as expected.
Check that both circuits are equivalent. To do this, use your truth tables in step 3 above.
Case Study 3 Boolean Circuits
Checklist (per case study)
PDF shows Steps 1-4, 6-7 clearly labelled (with photos where relevant).
.py file runs without external libraries and without crashing on typical inputs.
Variables named meaningfully; outputs are tidy; monetary values use :.2f where relevant.
Tip: Save versions frequently. Keep your process notes clean-your future self (and your marker) will thank you.