Homework
These are the six homework assignments from CSE 8A/6R Fall 2025, exactly as students received them. Homework is handwritten, manually graded, and can be resubmitted. Code-writing questions also include a process journal.
These documents link to cse8a.site, an older address for this course that is no longer in use. The calendar and syllabus now live on this site: Calendar and Syllabus.
Assignments
| Homework | Topics | File |
|---|---|---|
| Homework 1 | Variables, data types, arithmetic operations, functions | |
| Homework 2 | Conditional statements, lists, strings | |
| Homework 3 | For loops, while loops | PDF ยท Sample solution |
| Homework 4 | Dictionaries, references and objects, how functions work, variable scope | |
| Homework 5 | Nested for loops, 2D lists, debugging | |
| Homework 6 | Testing, program comprehension |
Supporting materials
- Sample process journal and instructions (PDF), the sample we gave students at the start of the term
- Memory Diagram Standard for Students (PDF), used in Homework 4
- Homework 6 starter code,
grade_calculator.py(shown below)
Homework 3 is the only assignment with a published solution.
Homework 6 starter code
grade_calculator.py
# Final Letter Grade Calculator for CSE 8A/6R Fall 2025
def calculate_base_grade(homework_points, exam_points):
"""
Determine base letter grade based on homework and exam points.
Args:
homework_points: Total homework points (max 18)
exam_points: Total exam points (max 6)
Returns:
str: Base letter grade ('A', 'B', 'C', or 'F')
Grading criteria:
- A: At least 15 homework points AND 6 exam points
- B: At least 12 homework points AND 4 exam points
- C: At least 9 homework points AND 2 exam points
- F: Does not meet requirements for C
"""
base_grade = None
if homework_points >= 15 and exam_points >= 6:
base_grade = 'A'
elif homework_points >= 12 and exam_points >= 4:
base_grade = 'B'
elif homework_points >= 9 and exam_points >= 2:
base_grade = 'C'
else:
base_grade = 'F'
return base_grade
def calculate_social_modifier(social_points):
"""
Determine social learning modifier based on total social points.
Args:
social_points: Total social learning points (max 30)
Returns:
str: Modifier ('+', '', '-', or 'lower')
Modifier criteria:
- '+': At least 24 total social points
- '': 18 to 23 total social points
- '-': 12 to 17 total social points
- 'lower': Fewer than 12 total social points
"""
if social_points >= 24:
return '+'
elif 18 <= social_points <= 23:
return '' # No modifier
elif 12 <= social_points <= 17:
return '-'
def calculate_final_grade(homework_points, exam_points, social_points):
"""
Calculate the final letter grade including social learning modifier.
Args:
homework_points: Total homework points (max 18)
exam_points: Total exam points (max 6)
social_points: Total social learning points (max 30)
Returns:
str: Final letter grade with modifier
"""
base_grade = calculate_base_grade(homework_points, exam_points)
social_modifier = calculate_social_modifier(social_points)
final_grade = base_grade + social_modifier
return final_grade
# Prompt user for input for their total homework, exam, and social learning points
homework_points = int(input("Enter total homework points (max 18): "))
exam_points = int(input("Enter total exam points (max 6): "))
social_points = int(input("Enter total social learning points (max 30): "))
# Calculate and display the final letter grade
final_grade = calculate_final_grade(homework_points, exam_points, social_points)
print(f"Your final letter grade is: {final_grade}")