Skip to content

JohnWYWallace/BMI-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

John's Demo Banner

BMI Calculator

End Goal

This project demonstrates the use of Optionals and shows the use of the MVC design pattern. Compares objects created from classes with instances of Structs.

What was created

The end goal of this project is a Body Mass Index Calculator based upon the user’s height and weight. After the user inputs their height and weight, the user will tap on calculate and a screen will pop up with a small health advice message as well as a custom color indicating whether they are in good health or not. Green being good health, red being overweight, and blue being underweight.

What I learned from this project

  • How to create multi-screen apps with animated navigation.
  • Optional binding, chaining, and the nil coalescing operator.
  • Creating classes and the difference between classes and structs.
  • Pass by value vs. pass by reference.
  • Formatting strings.
  • Color literals.

Running the App

First case is if the user has a good BMI according to the CDC's standards

The user will put in there height and weight, then press 'Calculate'

CleanShot 2022-11-04 at 08 39 02@2x CleanShot 2022-11-04 at 08 39 22@2x

Second case if if the user is under weight. Which will display a blue background

CleanShot 2022-11-04 at 08 41 16@2x CleanShot 2022-11-04 at 08 41 27@2x

The third and final case is when the user is overweight in which the screen will be red

CleanShot 2022-11-04 at 08 44 20@2x CleanShot 2022-11-04 at 08 44 30@2x

About

This is a simple BMI calculator make in Swift.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages