Assignment #1 Task #3

Please note, this blog entry is from a previous course. You might want to check out the current one.

Add the following 4 operation buttons:

  • sin : calculates the sine of the top operand on the stack.
  • cos : calculates the cosine of the top operand on the stack.
  • sqrt : calculates the square root of the top operand on the stack.
  • π: calculates (well, conjures up) the value of π. Examples: 3 π * should put three times the value of π into the display on your calculator, so should 3 Enter π *, so should π 3 *. Perhaps unexpectedly, π Enter 3 * + would result in 4 times π being shown. You should understand why this is the case. NOTE: This required task is to add π as an operation (an operation which takes no arguments off of the operand stack), not a new way of entering an operand into the display.

Add four additional buttons called “sin”, “cos”, “sqrt” and “pi” by copying one of the existing operator buttons and adjust the performOperation function in CalculatorBrain.m:
Continue reading “Assignment #1 Task #3”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #1 Task #2

Please note, this blog entry is from a previous course. You might want to check out the current one.

Your calculator already works with floating point numbers (e.g. if you touch the buttons 3 Enter 4 / it will properly show the resulting value of 0.75), however, there is no way for the user to enter a floating point number. Remedy this. Allow only legal floating point numbers to be entered (e.g. “192.168.0.1” is not a legal floating point number). Don’t worry too much about precision in this assignment.

Add an additional button on the left hand side of the zero button, by copying one of the number buttons. Add a new property userIsInTheMiddleOfEnteringAFloat to CalculatorViewController.m, synthesize it and adjust the digitPressed andenterPressed functions:
Continue reading “Assignment #1 Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #1 Task #1

Please note, this blog entry is from a previous course. You might want to check out the current one.

The first assignment is an extension of the calculator built in lecture #2.

Follow the walk-through instructions (separate document) to build and run the calculator in the iPhone Simulator. Do not proceed to the next steps unless your calculator functions as expected and builds without warnings or errors.

Basically this is solved by code at the end of lecture #2. However, limited time during the lecture prevented the instructor from finishing everything, thus we have to add subtraction and division as operands to CalculatorBrain.m:
Continue reading “Assignment #1 Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Lecture #2: My First iOS App

Please note, this blog entry is from a previous course. You might want to check out the current one.

The second lecture “2. My First iOS App”, hold on September 29th, 2011, is an one-hour demo about MVC and Objective-C. For maximum experience, it is recommend to enter the given code in parallel to watching the course – and if necessary use the pause function of your viewer extensively. In addition, the slides for this lecture provide a very detailed walkthrough of the demo.

You learn how to create a new project, to navigate in Xcode, to use storyboards, labels and buttons, outlets and actions, strings and arrays, logging and debugging, and how to access the documentation inside Xcode.
Continue reading “Lecture #2: My First iOS App”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail