Professional Documents
Culture Documents
Objective-C and Ios Programming A Simplified Approach To Developing Apps For The Apple Iphone and Ipad 1St Edition Arshia Khan Solutions Manual
Objective-C and Ios Programming A Simplified Approach To Developing Apps For The Apple Iphone and Ipad 1St Edition Arshia Khan Solutions Manual
https://testbankfan.com/download/objective-c-and-ios-programming-a-simplified-appr
oach-to-developing-apps-for-the-apple-iphone-and-ipad-1st-edition-arshia-khan-soluti
ons-manual/
Chapter 2
Data Types and Arithmetic Expressions
A Guide to this Instructor’s Manual:
We have designed this Instructor’s Manual to supplement and enhance your teaching
experience through classroom activities and a cohesive chapter summary.
Overview
Chapter 2 covers variables and constants, data types, and arithmetic expressions.
Chapter Objectives
• Work with variables and constants
• Use the NSLog method to output data
• Use the Scanf method to read user input
• Learn about basic and derived data types
• Learn how to define a new data type with enumerations
• Use the preprocessor to create custom statements
• Create arithmetic expressions
Lecture Notes
• Although NSLog is an error log mechanism, we chose to use it here due to its
ability to support the format specifiers that cannot be supported by printf()—
an alternate mechanism for outputting data.
• Scanf is a tricky concept and does not work well with strings. When using %c to
print a char, you may want to use %s instead as the %c will take the first char in
the buffer and if the program is running for a second time there may be some
garbage in the buffer from the previous run.
• In the enumerated data type, if a value is not assigned then the compiler will
assign a value starting at 0 for the first enumerated type.
© 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for
classroom use.
Short Quiz:
Q1: How can you input and output data?
Answer: Use scanf to input and NSLog to output
© 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for
classroom use.
• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth in
paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.