Skip to the content.

Team Test 1.1-1.4 • 15 min read

Description

This is the contents of our team test 1.1-1.4 video recording

Benefits of Working in a Team:

Having a team can make the creation of a project faster and more efficient. With each task given to a group member, the project can be done with more detail due to each section being worked on specifically by one person while also being done at a faster rate. Collaboration is also important because groups can easily be off-task and not do the work they’re supposed to do if there is a lack of collaboration. But when done right, a collaborating group can facilitate their project and manage each member’s task, leading to an easier and more successful project. Diversities of our team: One of the diversities our team has is in its software; half of our scrum team work on Macs while the other half works on Windows computers. This can help reduce the chances of everyone having the same problem on one platform.

Program Types

  • Programs with Output

    Programs with output give a one-way display to the user (ex: displaying text)

print("Hello World!")
Hello, World!
  • Program with Input and Output

    Programs with both input and ouput take into account a user’s response and answers back with an ouput (ex: python quizzes/surveys)

# Program with Input and Output
# Input
name = input("Enter your name: ")

# Processing
greeting = "Hello, " + name + "!"

# Output
print(greeting)
Hello, Miguel!
  • Program with a List

    A program that uses a list data structure to store a group of elements.

# Program with a List
# Create a list of something
shopping_list = []

# Function to add something to the list
def add_to_list(item):
    shopping_list.append(item)
    print(f"Added '{item}' to the shopping list.")

# Function to remove something from the list
def remove_from_list(item):
    if item in shopping_list:
        shopping_list.remove(item)
        print(f"Removed '{item}' from the shopping list.")

# Example usage:
add_to_list("Apples")
add_to_list("Bananas")
remove_from_list("Apples")
Added 'Apples' to the shopping list.
Added 'Bananas' to the shopping list.
Removed 'Apples' from the shopping list.
  • Program with a Dictionary

    A dictionary allows you to store and retrieve key-value pairs.

# Create a dictionary
student_scores = {
    "Alice": 95,
    "Bob": 89,
}

# Retrieve the values that are assigned
alice_score = student_scores["Alice"]
bob_score = student_scores["Bob"]

# Print the scores
print("Alice's score:", alice_score)
print("Bob's score:", bob_score)
Alice's score: 95
Bob's score: 89
  • Program with an Iteration

    A “program with iteration” is a computer program that uses loops to repeatedly execute a block of code or iterate over a sequence of data, such as a list, until a certain condition is met. Iteration is a fundamental programming concept that allows you to perform repetitive tasks efficiently.

# Program with Iteration
# Calculate the sum of numbers in a list using a for loop

# Define a list of numbers
numbers = [2, 2, 3, 4, 5]

# Initialize a variable to store the sum
sum_of_numbers = 0

# Iterate over the list and calculate the sum
for number in numbers:
    sum_of_numbers += number

# Print the sum
print("The sum of numbers is:", sum_of_numbers)

The sum of numbers is: 16
  • Program with a Function to perform mathematical and/or a statistical calculations

    This program can make calculations using an input of two numbers.

## Program with a Function for Mathematical Calculations
# Simple calculator

# Adding
def add(x, y):
    return x + y

# Subtracting
def subtract(x, y):
    return x - y

# Multiplication
def multiply(x, y):
    return x * y

# Division
def divide(x, y):
    if y == 0:
        return "Can't divide by zero"
    return x / y

# Display operations
print("Select operation:")
print("1. Add")
print("2. Subtract")
print("3. Multiply")
print("4. Divide")

# Choose whether to add, subtract, multiply, divide
choice = input("Enter choice (1/2/3/4): ")

# Choose your numbers
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))

# Perform the selected operation
if choice == '1':
    result = add(num1, num2)
    print("Result:", result)
elif choice == '2':
    result = subtract(num1, num2)
    print("Result:", result)
elif choice == '3':
    result = multiply(num1, num2)
    print("Result:", result)
elif choice == '4':
    result = divide(num1, num2)
    print("Result:", result)
else:
    print("Invalid input")

Select operation:
1. Add
2. Subtract
3. Multiply
4. Divide


Result: 2.0
  • Program with a selection/condition

    In computer science, a “program with a selection/condition” refers to a computer program or a section of code that includes decision-making logic based on certain conditions or criteria. These conditions are typically expressed using conditional statements (e.g., if statements) that allow the program to take different actions or follow different paths of execution based on the evaluation of these conditions.

# Python program with a selection/condition
GPA = float(input("Enter your GPA: "))

if GPA >= 3.8:
    print("You are eligible to join NHS.")
else:
    print("You are not eligible to join NHS.")
You are eligible to join NHS.
  • Finish with a Program with a Purpose

    The term “Program with Purpose” in computer science refers to writing software or computer programs with a clear and well-defined goal or objective in mind. It emphasizes the importance of designing and implementing software with a specific intent or purpose, rather than creating code arbitrarily or without a clear understanding of its intended use.

# Function to calculate the factorial of a number
def factorial(n):
    if n == 0:
        return 1
    else:
        result = 1
        for i in range(1, n + 1):
            result *= i
        return result

# Input: Prompt the user to enter a number
num = int(input("Enter a number: "))

# Calculate the factorial
result = factorial(num)

# Output: Display the factorial of the number
print(f"The factorial of {num} is {result}")

The factorial of 2 is 2