From dfce6a894dcf59dae8285f6c6641e9d213337914 Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 20:38:01 +0000 Subject: [PATCH 1/6] Setting up GitHub Classroom Feedback From 827a0b1a609dde62b7ca105196f9465ad4c495cc Mon Sep 17 00:00:00 2001 From: Kiara C Roberson Date: Wed, 3 Sep 2025 18:31:41 +0000 Subject: [PATCH 2/6] Add Assignment 1 folder with simple_code.py into my forked repository --- Simple_code.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Simple_code.py diff --git a/Simple_code.py b/Simple_code.py new file mode 100644 index 0000000..0b1e0e1 --- /dev/null +++ b/Simple_code.py @@ -0,0 +1,45 @@ +"""Rectangle Area Calculator. + +This script asks the user for the length and width of a rectangle, +calculates the area, and prints the result. +""" + +def calculate_area(length: float, width: float) -> float: + """Calculate the area of a rectangle. + + Args: + length (float): The length of the rectangle. + width (float): The width of the rectangle. + + Returns: + float: The calculated area. + """ + return length * width + + +def main(): + """Main function to run the area calculator.""" + print("Welcome to the Rectangle Area Calculator!") + + # Ask the user to enter the length and width + try: + length = float(input("Enter the length of the rectangle: ")) + width = float(input("Enter the width of the rectangle: ")) + except ValueError: + # Handle cases where the input is not a number + print("Oops! Please enter valid numbers for length and width.") + return + + # Call the function to calculate the area + area = calculate_area(length, width) + + # Display the results + print("\n--- Results ---") + print(f"Length: {length:.2f}") + print(f"Width: {width:.2f}") + print(f"Area of the rectangle: {area:.2f} square units") + + +# This ensures the main function runs only when the script is executed directly +if __name__ == "__main__": + main() From 26671af93a32e582d9ddd5f4ffddad53cfafe12a Mon Sep 17 00:00:00 2001 From: Kiara <85202556+Key-Roberson@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:24:39 -0700 Subject: [PATCH 3/6] Update README.md created a description about the simple code I created --- README.md | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9df9ede..210379d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,31 @@ -# Create a README.md +# Rectangle Area Calculator 🟦 -If you need help with `Markdown`, check out [The Markdown Cheatsheet](https://www.markdownguide.org/cheat-sheet/)! +This repository contains a simple Python script that calculates the area of a rectangle based on user input. It was created as part of ATMS 523 Assignment 1 to demonstrate basic Python functionality and GitHub workflows. -What should a good README.md look like? Check out these [guidelines](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes). +## πŸš€ How to Run -Did you add an open source software license? \ No newline at end of file +1. Clone the repository or download the `Simple_code.py` file. +2. Open a terminal and navigate to the folder containing the file. +3. Run the script using Python 3: + ```bash + python Simple_code.py +4. Enter the length and width when prompted. + +##🧠 What It Does +Prompts the user to enter the length and width of a rectangle. + +Calculates the area using a simple function. + +Displays the result with formatted output. + +Includes error handling for invalid input. + +πŸ›  Technologies Used +Python 3 + +Visual Studio Code (JupyterHub environment) + +Git & GitHub + +πŸ‘©β€πŸ’» Author +Created by Kiara Roberson for ATMS 523 Assignment 1 From 5f419f4cc4e33aac7426305723e0b2614d4b925b Mon Sep 17 00:00:00 2001 From: Kiara <85202556+Key-Roberson@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:28:10 -0700 Subject: [PATCH 4/6] Create LICENSE creating an open source license file --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d7de532 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Department of Climate, Meteorology & Atmospheric Sciences + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 79726293e105a888fed7193148ada750ee164eef Mon Sep 17 00:00:00 2001 From: Kiara <85202556+Key-Roberson@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:39:22 -0700 Subject: [PATCH 5/6] Update README.md --- README.md | 59 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 210379d..4a3bc25 100644 --- a/README.md +++ b/README.md @@ -4,28 +4,45 @@ This repository contains a simple Python script that calculates the area of a re ## πŸš€ How to Run -1. Clone the repository or download the `Simple_code.py` file. -2. Open a terminal and navigate to the folder containing the file. -3. Run the script using Python 3: - ```bash - python Simple_code.py -4. Enter the length and width when prompted. - -##🧠 What It Does -Prompts the user to enter the length and width of a rectangle. - -Calculates the area using a simple function. - -Displays the result with formatted output. - -Includes error handling for invalid input. - -πŸ›  Technologies Used +You do **not** need Visual Studio Code to run this script. Here's how to do it using just Python and a terminal: + +### 🧰 Step 1: Install Python +- Visit the [official Python website](https://www.python.org/downloads/) and download Python 3.x for your operating system. +- During installation, make sure to check the box that says **β€œAdd Python to PATH”** (Windows only). + +### πŸ“ Step 2: Download the Script +- Go to this GitHub repository. +- Click the green **β€œCode”** button and select **β€œDownload ZIP”**. +- Extract the ZIP file to a folder on your computer. + +### πŸ“‚ Step 3: Open a Terminal or Command Prompt +- **Windows**: Press `Win + R`, type `cmd`, and hit Enter. +- **macOS**: Open **Terminal** from Applications > Utilities. +- **Linux**: Use your system’s terminal. + +### πŸ“ Step 4: Navigate to the Folder +Use the `cd` command to move into the folder where the script is saved. For example: +``bash +cd Downloads/module-1-part-2-using-github-workflows-Key-Roberson-main + +### ▢️ Step 5: Run the Script +Type the following command: +python Simple_code.py + +### ✍️ Step 6: Follow the Prompts +Enter the length and width when asked. +The script will calculate and display the area of the rectangle. + +### 🧠 What It Does +- Prompts the user to enter the length and width of a rectangle. +- Calculates the area using a simple function. +- Displays the result with formatted output. +- Includes error handling for invalid input. + +### πŸ›  Technologies Used Python 3 - Visual Studio Code (JupyterHub environment) - Git & GitHub -πŸ‘©β€πŸ’» Author -Created by Kiara Roberson for ATMS 523 Assignment 1 +### πŸ‘©β€πŸ’» Author +Created by Kiara Roberson for ATMS 523 Assignment 1. From 9ffb3079a55b56cc506f55a833fc1472974f8f0b Mon Sep 17 00:00:00 2001 From: Kiara <85202556+Key-Roberson@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:41:32 -0700 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a3bc25..05749f0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Rectangle Area Calculator 🟦 -This repository contains a simple Python script that calculates the area of a rectangle based on user input. It was created as part of ATMS 523 Assignment 1 to demonstrate basic Python functionality and GitHub workflows. +This repository contains a simple Python script that calculates the area of a rectangle based on user input. It was created in Visual Studio as part of ATMS 523 Assignment 1 to demonstrate basic Python functionality and GitHub workflows. ## πŸš€ How to Run