iOS Dev – Assignment #1

We provide you with a template for a calculator that already adds numbers (at least 1 and 2).
Take a close look at the implementation of this template and write the necessary code to have a fully working calculator.

Let’s have a look at the number buttons:

iOS Dev - Assignment #1 - Number Actions
iOS Dev – Assignment #1 – Number Actions

Continue reading “iOS Dev – Assignment #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs106a – Assignment #1 – Task #4

As an exercise in solving algorithmic problems, program Karel to place a single beeper at the center of 1st Street. For example, if Karel starts in the world

cs106 – assignment #1 – task #4 – start

it should end with Karel standing on a beeper in the following position:
cs106 – assignment #1 – task #4 – end

Continue reading “cs106a – Assignment #1 – Task #4”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs106a – Assignment #1 – Task #3

In this exercise, your job is to get Karel to create a checkerboard pattern of beepers inside an empty rectangular world, as illustrated in the following before-and-after diagram:

cs106 – assignment #1 – task #3 – 8×8

This problem has a nice decomposition structure along with some interesting algorithmic issues. As you think about how you will solve the problem, you should make sure that your solution works with checkerboards that are different in size from the standard 8×8 checkerboard shown in the example. Odd-sized checkerboards are tricky, and you should make sure that your program generates the following pattern in a 5×3 world:
cs106 – assignment #1 – task #3 – 5×3

Another special case you need to consider is that of a world which is only one column wide or one row high. The starter folder contains several sample worlds that test these special cases, and you should make sure that your program works for each of them.

Continue reading “cs106a – Assignment #1 – Task #3”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs106a – Assignment #1 – Task #2

Karel has been hired to repair the damage done to the Quad in the 1989 earthquake. In particular, Karel is to repair a set of arches where some of the stones (represented by beepers, of course) are missing from the columns supporting the arches, as follows:

cs106 – assignment #1 – task #2 – start

Continue reading “cs106a – Assignment #1 – Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #1 Extra Task #3

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

Add a +/- operation which changes the sign of the number in the display. Be careful with this one. If the user is in the middle of entering a number, you probably want to change the sign of that number and let them continue entering it, not force an enterPressed like other operations do. But if they are not in the middle of entering a number, then it would work just like any other single-operand operation (e.g. sqrt).

Add the “+/-” button in the storyboard by copying an operation button.

If the user is in the middle of entering a number, we just change the display and the history in operationPressed inside CalculatorViewController.m:
Continue reading “Assignment #1 Extra Task #3”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail