0% found this document useful (0 votes)
3 views

CS_Part_2_Module16Asssignment (1)

The document outlines a Computer Science assignment that includes links to CodeHS lessons and a reflection on team roles in a Capstone Project. It details the contributions of each team member, the collaboration tools used, and provides a Python code for a Library System project. Additionally, it prompts the user to describe how they met various criteria for a micro-credential in Idea Design and Refinement.

Uploaded by

ibnmahammoud1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

CS_Part_2_Module16Asssignment (1)

The document outlines a Computer Science assignment that includes links to CodeHS lessons and a reflection on team roles in a Capstone Project. It details the contributions of each team member, the collaboration tools used, and provides a Python code for a Library System project. Additionally, it prompts the user to describe how they met various criteria for a micro-credential in Idea Design and Refinement.

Uploaded by

ibnmahammoud1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

CTE

Computer Science, Part 2


Module 16 Assignment

Note: Make sure your links are live links and will go to the URL when clicked.
To do this, after pasting the URL, add a space. The URL will automatically
become a live hyperlink.

Code HS Lessons
CodeHS Lesson 11.9: Modules (2 points)
URL:
https://codehs.com/student/1298751/section/287011/assignments
CodeHS Lesson 11.10: Classes and Objects Quiz (2 points)
URL:
https://codehs.com/student/1298751/section/287013/assignments

Capstone Team Reflection


What part did each team member play in completing the Capstone Project?
Write two or three sentences to explain what each team member did
throughout the project.

Client: Joe provided the requirements he expected for the code. He also
is the reason we made it.

Project Manager: Daniel made the whole process organized. He gave us


clear roles and keep everything tidy.

Programmer: Abdirahman completed all of the code. He was the lead


programmer.

Beta Tester: Zack tested the code to make sure Abdirahman completed
everything well. He would also give Abdirahman feedback during the
process.

What collaboration tools did your Capstone Project Team use during the
project? How well did these tools work?
CTE
Computer Science, Part 2
Module 16 Assignment

We used discord to talk and zoom to work on it together.


CTE
Computer Science, Part 2
Module 16 Assignment

Capstone Project
Note: If you completed your project in Visual Studio Code, you will need to zip
your folder into a zip file and upload that one zip file to the Module 16
Assignment. If you completed the project in CodeHS you should share the
program to get the link to submit here. If you completed the project in
CodeSandbox you will need to copy the link to the program and submit it
here.
URL: https://codehs.com/sandbox/id/capstone-project-SS1DGO
Copy and paste your project Python code below.

class LibrarySystem:
library_books = []

def __init__(self):
self.genres = set()

def add_book(self, book_name, genre):


"""Adds a book with a genre to the library."""
book = (book_name, genre)
self.library_books.append(book)
self.genres.add(genre)
print(f"'{book_name}' has been added to the library under the
genre '{genre}'.")

def search_book(self, book_name):


"""Searches for a book in the library."""
for idx, book in enumerate(self.library_books):
CTE
Computer Science, Part 2
Module 16 Assignment

if book[0].lower() == book_name.lower():
print(f"'{book_name}' is in the library at position {idx + 1}.")
return
print(f"'{book_name}' is not in the library.")

def display_books(self):
"""Displays all books in the library."""
if not self.library_books:
print("The library is empty!")
else:
print("\nBooks in the Library:")
for book, genre in self.library_books:
print(f"- {book} ({genre})")

def recommend_books(self, genre):


"""Recommends books from a specific genre."""
recommendations = [book[0] for book in self.library_books if
book[1].lower() == genre.lower()]
if recommendations:
print(f"\nBooks in the genre '{genre}':")
for book in recommendations:
print(f"- {book}")
CTE
Computer Science, Part 2
Module 16 Assignment

else:
print(f"No books found in the genre '{genre}'.")

def remove_book(self, book_name):


"""Removes a book from the library."""
for book in self.library_books:
if book[0].lower() == book_name.lower():
self.library_books.remove(book)
print(f"'{book_name}' has been removed from the library.")
return
print(f"'{book_name}' was not found in the library.")

def sort_books(self):
"""Sorts the library alphabetically by book name."""
self.library_books.sort(key=lambda book: book[0])
print("The library has been sorted alphabetically!")

def main():
library = LibrarySystem()
while True:
print("\nLibrary Menu:")
CTE
Computer Science, Part 2
Module 16 Assignment

print("1. Add a Book")


print("2. Search for a Book")
print("3. Display All Books")
print("4. Recommend Books by Genre")
print("5. Sort the Library")
print("6. Remove a Book")
print("7. Exit")
choice = input("Enter your choice (1-7): ")

if choice == "1":
book_name = input("Enter the name of the book to add: ")
genre = input("Enter the genre of the book: ")
library.add_book(book_name, genre)
elif choice == "2":
book_name = input("Enter the name of the book to search for: ")
library.search_book(book_name)
elif choice == "3":
library.display_books()
elif choice == "4":
genre = input("Enter the genre to get recommendations: ")
library.recommend_books(genre)
CTE
Computer Science, Part 2
Module 16 Assignment

elif choice == "5":


library.sort_books()
elif choice == "6":
book_name = input("Enter the name of the book to remove: ")
library.remove_book(book_name)
elif choice == "7":
print("Exiting the program. Goodbye!")
break
else:
print("Invalid choice. Please try again.")

if __name__ == "__main__":
main()
CTE
Computer Science, Part 2
Module 16 Assignment

Creativity: Idea Design and Refinement


Describe how you have met the Clarify criteria for the Idea
Design and Refinement micro-credential.

Describe how you have met the Design criteria for the Idea
Design and Refinement micro-credential.

Describe how you have met the Adapt criteria for the Idea
Design and Refinement micro-credential.

Describe how you have met the Refine criteria for the Idea
Design and Refinement micro-credential.

You might also like