Skip to the content.

Sprint 2 Reflection

Reflection

3.1 Homework

name = 'Nikith'
print(name)

age = '16'
print(age)

favorite_number = '2.79'
print(favorite_number)

favorite_food = 'pizza' #snake_case
FavoriteHobby = 'videogames' #PascalCase
favoriteColor = 'red' #camelCase

print(favorite_food)
print(FavoriteHobby)
print(favoriteColor)

me = {                                     #Dictionary
    'name': 'Nikith',
    'age': '16',
    'favorite_number': '2.79',
}

print(me['name']) #Outputs
print(me['age'])
print(me['favorite_number'])

about_me = ['Nikith', 'red', '2.79'] #list for name, fav color, and fav number
print(about_me)


let myName = "Nikith Muralikrishnan";

let myAge = 16;

let pi = 3.14159;

console.log(myName);
console.log(myAge);
console.log(pi);



favorite_food = 'pizza' //snake_case
FavoriteHobby = 'videogames' //PascalCase
favoriteColor = 'red' //camelCase

console.log(favorite_food);
console.log(FavoriteHobby);
console.log(favoriteColor);



let about_me = ["Nikith", "16", "2.79"]; //array (list of elements)

console.log(about_me);

let me = { //dictionary
    name: "Nikith",
    age: 16,
    favorite_number: 2.79,
};

console.log(me);

3.2 Homework

import json 

# List of books
books = [
    {
        "bookId": "B001",
        "title": "1984",
        "author": "George Orwell",
        "publishedYear": 1949,
        "isAvailable": True,
        "genres": ["Dystopian", "Political Fiction"],
        "isbn": "978-0451524935",
        "description": "A novel that depicts a totalitarian society under constant surveillance."
    },
    {
        "bookId": "B002",
        "title": "To Kill a Mockingbird",
        "author": "Harper Lee",
        "publishedYear": 1960,
        "isAvailable": True,
        "genres": ["Fiction", "Classic"],
        "isbn": "978-0061120084",
        "description": "A coming-of-age story that deals with serious issues of race and injustice."
    },
    {
        "bookId": "B003",
        "title": "The Catcher in the Rye",
        "author": "J.D. Salinger",
        "publishedYear": 1951,
        "isAvailable": True,
        "genres": ["Fiction", "Young Adult"],
        "isbn": "978-0316769488",
        "description": "A story about teenage angst and alienation."
    },
    {
        "bookId": "B004",
        "title": "The Great Gatsby",
        "author": "F. Scott Fitzgerald",
        "publishedYear": 1925,
        "isAvailable": True,
        "genres": ["Fiction", "Classic"],
        "isbn": "978-0743273565",
        "description": "A novel set in the Roaring Twenties that tells the story of Jay Gatsby's unrequited love for Daisy Buchanan."
    },
    {
        "bookId": "B005",
        "title": "Brave New World",
        "author": "Aldous Huxley",
        "publishedYear": 1932,
        "isAvailable": True,
        "genres": ["Dystopian", "Science Fiction"],
        "isbn": "978-0060850524",
        "description": "A dystopian novel that explores a future society driven by technological advancement."
    }
]

# Convert list of books to JSON string with pretty formatting
json_string = json.dumps(books, indent=2)

# Print the JSON string
print(json_string)
const jsonData = `[
    {
        "bookId": "B001",
        "title": "1984",
        "author": "George Orwell",
        "publishedYear": 1949,
        "isAvailable": true,
        "genres": ["Dystopian", "Political Fiction"],
        "isbn": "978-0451524935",
        "description": "A novel that depicts a totalitarian society under constant surveillance."
    },
    {
        "bookId": "B002",
        "title": "To Kill a Mockingbird",
        "author": "Harper Lee",
        "publishedYear": 1960,
        "isAvailable": true,
        "genres": ["Fiction", "Classic"],
        "isbn": "978-0061120084",
        "description": "A coming-of-age story that deals with serious issues of race and injustice."
    },
    {
        "bookId": "B003",
        "title": "The Catcher in the Rye",
        "author": "J.D. Salinger",
        "publishedYear": 1951,
        "isAvailable": true,
        "genres": ["Fiction", "Young Adult"],
        "isbn": "978-0316769488",
        "description": "A story about teenage angst and alienation."
    },
    {
        "bookId": "B004",
        "title": "The Great Gatsby",
        "author": "F. Scott Fitzgerald",
        "publishedYear": 1925,
        "isAvailable": true,
        "genres": ["Fiction", "Classic"],
        "isbn": "978-0743273565",
        "description": "A novel set in the Roaring Twenties that tells the story of Jay Gatsby's unrequited love for Daisy Buchanan."
    },
    {
        "bookId": "B005",
        "title": "Brave New World",
        "author": "Aldous Huxley",
        "publishedYear": 1932,
        "isAvailable": true,
        "genres": ["Dystopian", "Science Fiction"],
        "isbn": "978-0060850524",
        "description": "A dystopian novel that explores a future society driven by technological advancement."
    }
]`;

// Convert JSON string to JavaScript object
const books = JSON.parse(jsonData);

// Print the JavaScript object
console.log(books);
import json

mclaren_spyder = {
    "name": "McLaren Spyder",
    "performance": {
        "engine": "4.0-liter twin-turbo V8",
        "horsepower": 720,
        "acceleration": "0 to 100 km/h in 2.9 seconds",
        "top_speed": "325 km/h"
    },
    "features": {
        "driving_assistance": "advanced stability control",
        "exterior": "sleek aerodynamic design",
        "interior": "luxurious leather and carbon fiber"
    },
    "pricing": {
        "original_price": "$208,000",
        "production_run": "limited",
        "rarity": "highly exclusive"
    }
}


json_string_1 = json.dumps(mclaren_spyder)
print("Example 1:\n", json_string_1)

json_string_2 = json.dumps(mclaren_spyder, indent=2)
print("\nExample 2:\n", json_string_2)

json_string_3 = json.dumps(mclaren_spyder, indent=4, separators=(',', ': '))
print("\nExample 3:\n", json_string_3)

3.4 Homework

def count_character_types(input_string):
    total_letters = 0
    total_numbers = 0
    total_spaces = 0

    for char in input_string:
        if char.isalpha():
            total_letters += 1
        elif char.isdigit():
            total_numbers += 1
        elif char.isspace():
            total_spaces += 1

    return total_letters, total_numbers, total_spaces


if __name__ == "__main__":
    user_input = input("Enter a string: ")
    letters, numbers, spaces = count_character_types(user_input)

    print(f"Total letters: {letters}")
    print(f"Total numbers: {numbers}")
    print(f"Total spaces: {spaces}")

length = len("Muralikrishnan")
print(length)

concat_string = "Nikith " "Muralikrishnan"
print(concat_string)

substring = concat_string[1:11]
print(substring)
function countCharacterTypes(inputString) {
    let totalLetters = 0;
    let totalNumbers = 0;
    let totalSpaces = 0;

    for (let char of inputString) {
        if (char.match(/[a-zA-Z]/)) {
            totalLetters++;
        } else if (char.match(/[0-9]/)) {
            totalNumbers++;
        } else if (char === ' ') {
            totalSpaces++;
        }
    }

    console.log(`Total letters: ${totalLetters}`);
    console.log(`Total numbers: ${totalNumbers}`);
    console.log(`Total spaces: ${totalSpaces}`);
}


const userInput = prompt("Hello my name");
countCharacterTypes(userInput);

let last_name = "Muralikrishnan"; 
let length = last_name.length;

console.log(length);  //Output: 14


let first_name = "Nikith";
let full_name = first_name + " " + last_name;

console.log(full_name); //Output: Nikith Muralikrishnan


let substring = full_name.substring(1, 8);

console.log(substring); //Output: ikith M

3.6 Homework

weather_condition = "rainy"

def take_umbrella():
    print("Don't forget your umbrella!")

if weather_condition == "rainy":
    take_umbrella()  # if rainy, take umbrella
    

statement1 = "Hello, world!"
statement2 = "Hello, world!"

def check_statements():
    print("The statements are equal!")

if statement1 == statement2:
    check_statements()  # Check to see if statements are equal

age = int(input("16")) #Enter your age (I am 16)


if 3 <= age <= 12:
    print("Child")
elif 13 <= age <= 17:
    print("Teenager")
else:
    print("Adult")

3.7 Homework

# nested conditional
score = 85  # student's score

if score < 60:
    print("Failing")
elif 60 <= score < 75:
    print("Passing")
else:
    print("Excellent")

    # Additional nested conditions for excellent performance
    if score >= 90:
        print("You are in the Honor Roll!")
    elif score >= 85:
        print("Great job, keep up the good work!")
    else:
        print("Good performance, but there's room for improvement.")

For Sprint 2, my team taught 3.1 and 3.5 and to prepare myself for CB and PBL, I participated during the other groups’ presentations and tried my best to answer questions when asked. This was very helpful as I had very minimal knowledge on coding before enrolling for CSP so these lessons increased my knowledge on this subject and helped me prepare for the AP exam. I also made sure to complete the homework with proficiency and added some comments to explain my work. I prepared myself to teach logical operators for 3.5 by reading over the lesson and also looked it up on W3 schools to further develop my understanding on the subject.

When I taught 3.5 on booleans and logical operators, I used the analogy of temperature, being too hot or too cold to help students visualize how to use the various operators. Because temperature is something that is easy to visualize, it can allow students to better understand how to use the correct operator. Other students, like Kanhay, were very engaged during our presentation and raised their hands. They also gave helpful feedback on the contents of our presentation.

One topic that I think that was very vital and I learned a lot about is strings and variables in python and javascript. I learnt this from lessons 3.1 and 3.4 from Aadi, Aaditya Katre, Kanhay, and Aditya Telepaddy. It was very interesting to learn about the various ways to define a variable or a string. I also think it was very important as it helped me in all the other lessons when I imported JSON, and created if-else statements and nested conditionals. That group also made the lesson very engaging and interesting by creating a quiz about variables and strings that I enjoyed answering. It was very rewarding to get a correct answer on the quiz and this aspect made it fun to participate.

The sprint and big ideas were distinctly ours as we implemented optional quizzes to help students understand logical and relational operators. Another way we made it unique was by making our website purple and pleasing to look at. Something that displays my growth on these assignments is the homework assignments that I completed and the popcorn hacks to test my knowledge on all the lessons taught. Overall, I learned a lot from sprint 2 and all the lessons were engaging, allowing me to learn about python and javascript.