Week 1 Day 2 β Prompts & Code
π¬ Lab 1: Prompt Makeover
For each prompt below, compare the vague version to the improved version and study what changed.
Prompt A β Calculator
BAD PROMPT
Make a calculator
BAD OUTPUT (typical)
Here's a simple calculator in Python:
def add(a, b): return a + b
def subtract(a, b): return a - b
# etc.
IMPROVED PROMPT
Write a single-page web calculator using HTML, CSS, and JavaScript. It should look like a classic desktop calculator with buttons for 0β9, +, β, Γ, Γ·, =, and Clear. Style it with a dark background and large readable buttons. No external libraries.
IMPROVED OUTPUT (typical)
Here's a complete HTML file with an inline CSS grid layout, click handlers for each button, and a display area that updates live. Clear resets to "0", operators chain correctlyβ¦
WHAT CHANGED
+ Specified output format (single-page HTML)
+ Listed exact features needed (0β9, ops, Clear)
+ Described visual requirements (dark bg, large buttons)
+ Added constraint (no external libraries)
β Removed ambiguity about language and interface
Stretch Goal β 3-Iteration Table
| Iteration | Prompt Change | Result Improvement |
| 1 | Added "HTML/CSS/JS, no libraries" | Got a working file instead of snippets |
| 2 | Added "grid layout, Win95 aesthetic" | Styled buttons, beveled borders, gray palette |
| 3 | Added "keyboard support, chained ops" | Keydown events added, operator logic fixed |
Prompt B β Resume
BAD PROMPT
Help me with my resume
BAD OUTPUT (typical)
Sure! Here are some tips for a strong resume:
β’ Use action verbs like "led," "built," and "managed"
β’ Keep it to one page
β’ Tailor it to each job description
β’ Include measurable achievements
Would you like help with a specific section?
IMPROVED PROMPT
I'm a cloud engineer and full-stack developer with 8+ years of experience across independent consulting, agency work, and venture-backed startups. I founded Samwise Development (consultancy, 2022βpresent), contracted at Google IO via Left Field Labs, co-founded Distributron (reached YCombinator interview) and Treetz (indie game studio, team of 6), built Safety+ for Coca-Cola, and started my career at 1SEO Digital Agency and PSU's DARPA-funded Applied Research Lab. Stack: React, Vue, TypeScript, Python, PHP/Laravel, Tailwind, AWS, Azure, GCP, Cloudflare, Docker, Kubernetes, Linux, CI/CD. Certs: CompTIA A+, LPI Linux Essentials. Write a one-page resume optimized for senior contract and consulting roles, emphasizing technical breadth, entrepreneurial track record, and measurable impact. Use bullet points.
IMPROVED OUTPUT (example)
Penn Cameron Porterfield β Cloud Engineer & Full Stack Developer
fundlush@proton.me Β· pcporterfield.pages.dev Β· github.com/melonmelonz
Samwise Development β Founder & Consultant (2022βPresent)
β’ Full-stack and cloud infrastructure delivery for clients across industries
Google IO β Contract Full Stack Developer (2021β2022)
β’ Production pages via Left Field Labs; Preact + Jinja/Python + Tailwind
Distributron β Co-founder & Developer (2020β2021)
β’ Alcohol delivery startup; reached YCombinator interview. Vue, JAMstack
Treetz β Co-founder, Indie Game Dev (2019β2020)
β’ Unity mobile game; led team of 6 from concept to production
Skills: React Β· Vue Β· TypeScript Β· Python Β· PHP/Laravel Β· Tailwind
AWS Β· Azure Β· GCP Β· Cloudflare Β· Docker Β· Kubernetes Β· CI/CD
CompTIA A+ Β· LPI Linux Essentials
WGU B.S. Network & Cloud Engineering (In Progress) Β· Penn State 2009β2013
WHAT CHANGED
+ Provided real background (years, companies, stack)
+ Named the target role type (senior contract/consulting)
+ Specified tone and format (bullet points, one page)
+ Called out specific emphasis (breadth, entrepreneurial track record, impact)
β Removed the open-ended ask that produced generic tips
Prompt C β Quiz
BAD PROMPT
Give me a quiz
BAD OUTPUT (typical)
Sure! Here's a general knowledge quiz:
1. What is the capital of France?
2. Who wrote Romeo and Juliet?
3. What is 7 Γ 8?
IMPROVED PROMPT
Create a 5-question multiple-choice quiz about cloud computing fundamentals for someone with 6 months of experience. Include one question about S3, one about IAM, and one about the difference between IaaS and PaaS. Format each question with (A) (B) (C) (D) choices and put the answer key at the bottom.
WHAT CHANGED
+ Defined audience (6 months cloud experience)
+ Specified topic domain and exact subtopics
+ Requested a format (multiple choice, AβD)
+ Asked for answer key placement
π» Lab 2: Reading Code
You don't need to know how to write code to read it. Let's practice.
Step 1 β Look at this program
name = input("What is your name? ")
color = input("What is your favorite color? ")
print(f"Hello, {name}! {color} is a great color.")
Before reading the explanation β what do you think this program does? Write your guess.
Step 2 β Line by line
- Line 1: Asks the user to type their name. The answer is stored in a box called
name.
- Line 2: Asks for a favorite color. Stored in
color.
- Line 3: Combines both answers into a sentence and displays it.
The f"..." syntax means "fill in the blanks" β the {name} and {color} get replaced with whatever the user typed.
Step 3 β Q&A with AI
Paste that code into ChatGPT and ask:
Explain this Python code to me line by line, like I've never programmed before.
Then ask a follow-up:
What would happen if I removed the f before the quote on line 3?
Test the prediction. AI should say the {name} and {color} would print literally instead of being replaced.
Step 4 β Modify it
Ask AI to add a third question:
Add a third input that asks for the user's favorite food, then include it in the final printed sentence.
Copy the output, run it, verify it works. You just modified a program using plain English.
π€ Peer Activity: Prompt Partners
Task Cards
Pair up. Each person picks one task and writes two prompts: a vague one and a specific one. Then swap and run each other's prompts. Compare results.
- π Write a recipe for a birthday cake
- βοΈ Write an email to a professor asking for an extension
- π Explain a concept from your field to a 10-year-old
- π Summarize a news article in exactly 3 sentences
π‘ Discussion question: Which partner's improved prompt made the bigger difference? Why?
Debrief β Diana's Answer
Diana tried: "Write an email to a professor asking for an extension."
The AI gave a generic template. Then she improved it:
Write a polite email to my computer science professor asking for a 3-day extension on my programming assignment. My grandmother passed away last week and I've been traveling. I want to sound respectful and professional but also genuine, not over-apologetic.
Result: A specific, warm, appropriately toned email that Diana said she "would actually send."
Key insight: The more context you give, the more useful the output. AI doesn't know your situation β you have to tell it.
π§ Code Reading + Modification Lab
Read each program, figure out what it does, then use AI to modify it.
Exercise 1 β Tip Calculator
bill = float(input("Enter bill amount: $"))
tip_pct = float(input("Tip percentage (e.g. 20): "))
tip = bill * (tip_pct / 100)
total = bill + tip
print(f"Tip: ${tip:.2f} | Total: ${total:.2f}")
Read it: What does :.2f do? (Hint: look at the output format.)
Modify it: Ask AI to split the total evenly between 2, 3, or 4 people. The program should ask "How many people?" and show each person's share.
Exercise 2 β Temperature Converter
temp_f = float(input("Enter temperature in Fahrenheit: "))
temp_c = (temp_f - 32) * 5 / 9
print(f"{temp_f}Β°F = {temp_c:.1f}Β°C")
Read it: What formula is being used? Does it match what you learned in school?
Modify it: Ask AI to also convert to Kelvin (K = C + 273.15) and display all three values.
Exercise 3 β Compliment Generator
import random
compliments = [
"You're crushing it today.",
"Your curiosity is contagious.",
"You make hard things look easy.",
"The world is better with you in it.",
"You ask the best questions."
]
name = input("What's your name? ")
print(f"{name}, {random.choice(compliments)}")
Read it: What does random.choice() do? What would happen if the list had only one item?
Modify it: Ask AI to add 5 more compliments to the list and make it ask "Want another one? (yes/no)" after the first compliment, looping until the user says no.