โ“ Calculating Total Credits at Drexel! ๐ŸŽ“

# You must make sure to run all cells in sequence using shift + enter or you might encounter errors
from pykubegrader.initialize import initialize_assignment

responses = initialize_assignment("1_practice-quiz", "week_1", "practicequiz", assignment_points = 18.0, assignment_tag = 'week1-practicequiz')

# Initialize Otter
import otter
grader = otter.Notebook("1_practice-quiz.ipynb")

โ“ Calculating Total Credits at Drexel! ๐ŸŽ“#

At Drexel Universityโ€™s College of Engineering, students need to complete multiple co-op cycles and classes. Letโ€™s calculate how many credits a student has completed so far!

  • Drexel ID: abx123

  • The student has taken 10 classes, each worth 3 credits.

  • The student has also earned 12 additional credits from a co-op experience.

Using Python, write a program to calculate:

  1. The total credits completed by the student.

  2. The remaining credits needed to graduate, assuming the graduation requirement is 180 credits.

Detailed Instructions:#

  1. Define Your Drexel ID:

    • Create a variable drexel_id and assign it the value of your drexel_id โ€“ this is the first part of your email. For example, if your email is abc123@drexel.edu, your drexel_id would be abc123. Note that the drexel_id should be a string, you can use single or double quotes to define it. For example, drexel_id = 'abc123' or drexel_id = "abc123" are both valid.

  2. Define the Number of Classes and Co-op Credits:

    • Create a variable classes and assign it the value 10.

    • Create a variable class_credits and assign it the value 3.

    • Create a variable coop_credits and assign it the value 12.

    • Create a variable graduation_requirement and assign it the value 180.

  3. Calculate the Total Credits:

    • Use multiplication to calculate the total credits from classes. Save it to the variable total_class_credits.

    • Use addition to include the co-op credits. Save the total credits to the variable total_credits.

  4. Calculate Remaining Credits:

    • Subtract the total credits from the graduation requirement.

  5. Print the Results:

    • Use f-strings to display the Drexel ID, total credits, and remaining credits. We have provided this code for you so you do not have to write it.

# Drexel student's ID
drexel_id = ...

# Variables

# Number of classes taken
...

# credits per class
...

# Number of coop credits
...

# Graduation requirement
...

# Calculate total credits
...

# Calculate remaining credits
...

# DO NOT MODIFY BELOW THIS LINE
# Print the results
print(f"Student ID: {drexel_id}")
print(f"Total Credits Completed: {total_credits}")
print(f"Remaining Credits to Graduate: {remaining_credits}")
grader.check("practice-quiz-1-Grade")

๐ŸŽ‰ Well Done!#

Congratulations on completing the Drexel Credits Calculation! You are one step closer to graduation! ๐ŸŽ“

Submitting Assignment#

Please run the following block of code using shift + enter to submit your assignment, you should see your score.

from pykubegrader.submit.submit_assignment import submit_assignment

submit_assignment("week1-practicequiz", "1_practice-quiz")