Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

The second project for iOS pre-course using variables.

Notifications You must be signed in to change notification settings

ryanwatt/UsingVariables

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
18 Commits
 
 
 
 
 
 

Repository files navigation

UsingVariables

The second project for iOS pre-course using variables.

Resources:

Step 1: Get the project started on your computer and on GitHub

  • Either create a project locally and push to GitHub
  • Or fork this project and clone it to your computer

Note:

  • For more detailed instructions of 'Step 1' see the first project
  • 'Step 1' is something we will do hundreds of times in class. You need to be able to do it quickly and without running into issues so it doesn't slow class down.

Step 2: Add a BMI calculator

  • Remember that we're working in the AppDelegate file in the "didFinishLaunchingWithOptions" fuction
  • Declare two variables (height and weight with the type CGFloat)
  • Store values in each of them (height = 71.0 and weight = 185.0)
  • Declare a new varriable (bodyMassIndex with the type CGFloat)
  • And set it to (weight / (height * height)) * 703
  • Log the weight to the console

Completion:

  • It should print that the BMI is 25.799444
  • Feel free to play with the height and weight and see what gets printed

About

The second project for iOS pre-course using variables.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 58.0%
  • Swift 42.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.