Menu

MCQs

Multiple Choice Questions (MCQs)

Test your understanding of the project and related concepts with these questions:

  1. What is React primarily used for?
    A. Building the backend of web applications.
    B. Creating styles for websites.
    C. Building interactive user interfaces for web applications.
    D. Managing databases for web apps.
    Answer: C. Building interactive user interfaces for web applications. (React is a JavaScript library focused on building UIs, especially for single-page apps.)  
  2. Which React Hook did we use to manage form input and result state in this project?
    A. useEffect
    B. useState
    C. useContext
    D. useRef
    Answer: B. useState (useState lets us create and update state variables in functional components.)  
  3. What is the formula for Body Mass Index (BMI)?
    A. BMI = weight (kg) * height (m)
    B. BMI = weight (kg) / height (m)
    C. BMI = weight (kg) / [height (m)]²
    D. BMI = height (cm) / weight (kg)
    Answer: C. BMI = weight (kg) / [height (m)]² (This is the standard formula used globally for calculating BMI.)  
  4. In our React app, how do we trigger the BMI calculation when the user clicks the button?
    A. By using an HTML onclick attribute.
    B. By calling the calculateBMI function in the JSX directly.
    C. By using a React event handler onClick={calculateBMI} on the button.
    D. The calculation runs automatically when inputs change, without any event.
    Answer: C. By using a React event handler onClick={calculateBMI} on the button. (React uses camelCase event handlers like onClick to trigger functions.)  
  5. Which deployment step is NOT necessary when using Netlify with a GitHub repo?
    A. Pushing your code to a GitHub repository.
    B. Setting up a build command and publish directory on Netlify.
    C. Manually uploading your source code files via FTP.
    D. Connecting your GitHub account to Netlify.
    Answer: C. Manually uploading your source code files via FTP. (Netlify handles deployment automatically through GitHub integration—no FTP needed.)

Building BMI Calculator Using ReactJS

Author





Get in Touch For Details