College board MC

  • I scored a 48/66

Notes and corrections from MC

  • boolean: can only store true and false variable
  • The IETF develops and oversees standards such as hypertext transfer protocol (HTTP), Internet protocol (IP), and simple mail transfer protocol (SMTP)
  • The number of photos taken at a particular geographic location can be determined from the geographic data stored with each photo. The number of photos taken in the last year can be determined from the data and time data stored with each photo. The name of the person who took a photo is not captured in the photo data.
  • Incrementally adding code segments to correct, working programs can help programmers identify new errors that are introduced.
  • Connecting new devices to the Internet is enabled by assignment of an IP address.
  • Removing details from the model may help it run quickly, but is unlikely to provide more accurate results.
  • Metadata for an e-book would typically be used to provide descriptive information about the book. Previous versions of the e-book would likely be considered data, not metadata.

N@TM project

My contributions

  • I made the frontend design for the design of our website using CANVA
  • I was team lead so I assigned everyone what to do and checked up on eeryone during our meetings every other day
  • I made the inventory API for our grocery store by following the jokes API
  • I helped set up the project and deply it on AWS (which was very challenging for us)
  • I also worked on the user login page
products_data = [] 
product_list = [
    "Apples",
    "Bananas",
    "Oranges",
    "Plums",
    "Grapefruit",
    "Salmon",
    "Crackers",
    "Cookies",
    "Cheetos",
    "Chicken",
    "Pear",
    "Salad",
    "Tomato",
    "Brown Bread",
    "White Bread",
    "Tortilla",
    "Muffin",
    "Lettuce",
    "Spinach",
    "Okra",
    "Onions",
    "Cabbage",
    "Potatoes",
    "Mushroom"
]

category_list = [
    "Fruit", 
    "Fruit",
    "Fruit",
    "fruit",
    "Fruit",
    "Meat", 
    "Snack", 
    "Snack",
    "Snack",
    "Meat",
    "Fruit",
    "Vegtable",
    "Vegtable",
    "Vegtable",
    "Wheat",
    "Wheat",
    "Wheat",
    "Vegtable",
    "Vegtable",
    "Vegtable",
    "Vegtable",
    "Vegtable",
    "Vegtable",
    "Vegtable",

]

def initProducts():
    product_id = 1
    for product, category in zip(product_list, category_list):
        products_data.append({"id": product_id, "product": product, "category": category})
        product_id += 1

    
#Get function: returns all data
def getProducts(): 
    return(products_data)


#Get function: retuns product by id
def getProductsByCategory(category):
    matching_products = []
    for product_data in products_data:
        if product_data["category"] == category:
            matching_products.append(product_data)
    return matching_products


if __name__ == "__main__": 
    initProducts()  # initialize jokes
    getProducts() # return product data after initialization
  • product_list and category_list: These two lists define the products and their corresponding categories. Each item in product_list corresponds to an item in category_list at the same index. The products and categories are paired together for initialization.

  • initProducts(): This function initializes the products_data list with product information. It goes through the product_list and category_list, assigns a unique ID to each product, and creates a dictionary for each product with fields for “id,” “product,” and “category.” The product data is then appended to the products_data list.

  • getProducts(): This function returns all the product data in the products_data list. It simply returns the entire list containing the product information.

  • getProductsByCategory(category): This function takes a category as input and returns a list of products that belong to the specified category. It iterates through the products_data list, checks if the “category” field of each product matches the input category, and adds matching products to the matching_products list, which is then returned.

# Dictionary to store username and password pairs
user_credentials = {
    "sharonkodali": "pears",
    "tarasehdave": "apples",
    "alishahussain": "trees"
    ""
}

user_data = []

# define data and
def initUsers():
    user_id=0
    for user in user_credentials:
        password = user_credentials.get(user)
        user_data.append({'id':user_id,'user':user,'password':password})
        user_id+=1
        
def getUsers():
    return(user_data)

def getUser(id):
    return(user_data[id])

# Function to check if the entered credentials are valid
def login(username, password):
    if username in user_credentials and user_credentials[username] == password:
        return True
    else:
        return False

# Main login loop
while True:
    print("Please log in:")
    username = input("Username: ")
    password = input("Password: ")

    if login(username, password):
        print("Login successful. Welcome, " + username + "!")
        break
    else:
        print("Invalid credentials. Please try again.")
  • user_credentials: This is a dictionary that stores username-password pairs. Each username is associated with a corresponding password.

  • user_data: This is an empty list that will be used to store user information, including an ID, username, and password.

  • initUsers(): This function initializes the user_data list with user information. It iterates through the user_credentials dictionary, extracts the username and password for each user, assigns a unique ID to each user, and creates a dictionary with fields for “id,” “user” (username), and “password.” The user data is then appended to the user_data list.

  • getUsers(): This function returns the entire user_data list, containing user information.

  • getUser(id): This function takes an ID as input and returns the user information (a dictionary) associated with that ID from the user_data list.

  • login(username, password): This function takes a username and password as input and checks if the provided credentials match the entries in the user_credentials dictionary. If a match is found, it returns True, indicating a successful login. Otherwise, it returns False.

Trimester 1 reflection

What I learned:

  • learned a lot of basics about Python this trimester and I learned a lot of valuable grop work skills such as communicating and assigning differernt sections to different people based on their strenghts and their weaknesses
  • I also learned this importance of keeping a weely notebook and review ticket in order to look back to it and remember what I learned and look back on things if I forgot
  • I learned how backend and front end work together and I learned how to build APIS and what an api is

Oppurtunities for growth:

  • next trimester I want to be more focused with my team teaching, making sure my group is more organized and bing on top of it with hw

Errors I faced

  • I had a hard time deploying our website on to AWS
  • I did not have that much bakground in coding and I could not find an API that matched the purpose of our website so I had to make my own and I went line by line on the jokes API and tried to follow t exactly
  • sometimes I would still get errors and I spent hours trying to fix them which made me really frustrated
  • I also had a hard time with certain people in my group getting them to cooperate and understanding what we were doing, i had to do a lot of work for them.
  • I had to wå†ch a lot of videos but now I feel caught up