Chapter 3 : It’s All About the Data

This forum contains all the assignments and questions readers may have for each chapter.

Moderator: gary.bennett

Chapter 3 : It’s All About the Data

Postby gary.bennett » Sat Aug 14, 2010 3:29 pm

It’s All About the Data
    Numbering Systems Used in Programming
    Bits
    Bytes
    Hexadecimal
    Unicode
    Data Types
    Using Variable and Data Types with Alice
    Data Types and Objective-C
    Identifying Problems

Weekly Q&A for Objective-C for Absolute Beginners Book

Purpose: Answer questions about Objective-C and OOP from book or other related info.
This Webinar is held every week on Wednesday, from:
6:30 PM - 7:30 PM PST
Register Now at:
https://www2.gotomeeting.com/register/763610930
Once registered you will receive an email confirming your registration with information you need to join the Webinar.
System Requirements
PC-based attendees
Required: Windows® 7, Vista, XP or 2003 Server
Macintosh®-based attendees
Required: Mac OS® X 10.4.11 (Tiger®) or newer
Attachments
Ch03 RandomNumber.zip
Chapter 3 Source Code
(63.29 KiB) Downloaded 336 times
User avatar
gary.bennett
 
Posts: 564
Joined: Thu Feb 26, 2009 3:12 pm

Re: Chapter 3 : It’s All About the Data

Postby RichS » Fri May 17, 2013 8:53 pm

Hi Gary,

Thanks for the book. I'm working through the chapters and I'm trying to figure the exercises at the end of the chapters. At the beginning of the book it mentioned that the answers for these problems were on this forum but I can't seem to find them. I found the source codes to the problems illustrated in the book but not for the additional problems at the end.

Any help would be greatly appreciated.

Thanks,
Rich
RichS
 
Posts: 0
Joined: Sat May 11, 2013 11:05 pm

Re: Chapter 3 : It’s All About the Data

Postby Drago » Mon Nov 04, 2013 5:08 pm

Chapter 3 Exercises

1) Write an Objective-C console app (Command-Line Tool) that multiples two integers together and displays the result to the console.
(one of many solutions)
Code: Select all
        int firstNumber = 2;
        int secondNumber = 3;
        int result = 0;
       
        result = firstNumber * secondNumber;
        NSLog(@"%d", result);
        NSLog(@"The program has terminated successfully");


2) Write an Objective-C console app that squares a float. Display the resulting float in the console.
(one of many solutions)
Code: Select all
        float num = 1.2;
        float totalsquare = 0;
       
        totalsquare = num * num;
        NSLog(@"%f", totalsquare);
        NSLog(@"The program has terminated successfully");


3)Write an Objective-C console app that subtracts two floats, with the result being stored as an integer. Note that rounding does not occur.
(one of many solutions)
Code: Select all
        float num1 = 1.1;
        float num2 = 2.2;
        int totalsubstract = num1 - num2;
       
        NSLog(@"%d", totalsubstract);
        NSLog(@"The program has terminated successfully");
"It's more fun to be a pirate than to join the navy."
Steve Jobs.
User avatar
Drago
 
Posts: 0
Joined: Thu Jun 20, 2013 3:41 pm


Return to Book -> Objective-C for Absolute Beginners: (2nd Edition) iPhone and Mac Programming Made Easy

cron