javascript-projects

Task 2: BMI Calculator

Description

The BMI Calculator is a web application that allows users to calculate their Body Mass Index (BMI) based on their weight and height. This project introduces students to handling forms, user input, and performing mathematical calculations with JavaScript. Additionally, it emphasizes the use of CSS for styling and enhancing the user interface.

Screenshots of the Project

BMI Calculator

Objectives

Technologies Used

Getting Started

Follow these instructions to set up the project on your local machine.

Prerequisites

Installation

Fork this repository by clicking on the fork button on the top of this page. This will create a copy of this repository in your account. Then follow these steps:

  1. Clone the repository to your local machine:
    git clone https://github.com/yourusername/javascript-projects.git
    
  2. Navigate to the project directory:
    cd bmi-calculator
    

Project Structure

The project files and directories are organized as follows:

bmi-calculator/
│
├── index.html       # The main HTML file
├── style.css        # The CSS file for styling
└── src.js           # The JavaScript file for functionality

Usage

  1. Open index.html in your web browser.
  2. Enter your weight and height in the provided input fields.
  3. Click the “Calculate BMI” button to see your BMI displayed.

Code Explanation

HTML

CSS

JavaScript

Detailed Steps

HTML (index.html)

CSS (style.css)

JavaScript (src.js)

Submitting the Project

After setting up the project on your local machine and writing the necessary code, follow these steps to submit your project:

  1. Create a new folder/directory on your local machine in the javascript-projects/bmi-calculator directory. Name it your-name.

For example, if you are using Visual Studio Code, you can create a new folder by clicking on the New Folder icon in the Explorer sidebar and naming it bmi-calculator.

Your folder structure should look like this:

javascript-projects/
│
├── bmi-calculator/
│   ├── your-name/
│   │   ├── index.html
│   │   ├── style.css
│   │   └── src.js
│
└── ...
  1. Write the necessary code for the project by following the instructions provided in the project description.
  2. Once you have completed the project, push your code to the remote repository on GitHub.

    3.1 Create a new branch:

     git checkout -b your-branch-name
    

    3.2 Stage your changes:

     git add .
    

    3.3 Commit the changes:

     git commit -m "Add project files"
    

    3.4 Push the changes to the remote repository:

     git push origin your-branch-name
    
  3. Create a pull request on the original repository.
  4. Add a title and description to your pull request.
  5. Submit the pull request.
  6. Congratulations! You have successfully submitted your project.

Resources

License

This project is licensed under the MIT License - see the LICENSE file for details.