Full Link Download Solution Manual
Full Link Download Solution Manual
Full Link Download Solution Manual
Approach To Developing Apps for the Apple iPhone and iPad 1st
Edition Arshia Khan 1285187059 9781285187051
Full link download
Solution Manual https://testbankpack.com/p/solution-manual-for-objective-c-
and-ios-programming-a-simplified-approach-to-developing-apps-for-the-apple-
iphone-and-ipad-1st-edition-arshia-khan-1285187059-9781285187051/
and-ipad-1st-edition-arshia-khan-1285187059-9781285187051/
TRUE/FALSE
1. Data can take many forms, including numbers, individual alphabetic characters, strings of alphabetic
characters, and numbers with specific decimal precision.
2. NSLog provides an extended set of functionality for outputting information such as the option to
format data.
6. The Objective-C int data type is used to store a whole number that does not have a decimal point.
9. In the expression:
int *prtValue = &value;
the & symbol before the variable named value gives its address location.
10. The Objective-C id data type is typically used to point to an object of an unknown data type.
11. The struct functionality in Objective-C allows a programmer to define a new data type with
enumerations.
15. An advantage of using constants in a program is that, if the value of the constant needs to be changed,
the programmer only needs to change it in one location rather than searching the entire program and
modifying every instance.
16. Expressions that contain operands and operators are called arithmetic expressions.
ANS: T PTS: 1 REF: 26
17. If the Objective-C operator div is used with integers and there is a nonzero remainder, it will round
up or down to the nearest integer.
18. You can use either pre or post increment notation for increment operations since the results are always
the same.
19. The Objective-C pre increment operator will first evaluate the expression and then perform the
increment after the expression is evaluated.
20. The Objective-C subtract and assign operator, -=, first subtracts a value from a variable and then
assigns this new value to the variable.
MULTIPLE CHOICE
1. To store data, a program requires placeholders. A placeholder holds data that changes as the
program runs.
a. constant c. string
b. variable d. concatenated
ANS: B PTS: 1 REF: 16
2. Data types help the Objective-C language allocate memory for storage.
a. compiler c. memory manager
b. interpreter d. programmer
ANS: A PTS: 1 REF: 16
4. is identified by Apple as an error log mechanism used to output data to the console.
a. Scanf c. NSLog
b. NSError d. NSOutput
ANS: C PTS: 1 REF: 16
5. The NSLog function uses specifiers which are tokens that start with the symbol %, followed by a
character that specifies a data type.
a. data-type c. foundation
b. format d. parameter
ANS: B PTS: 1 REF: 16
6. NSLog takes one or more parameters in the form of a string with format specifiers. The string with the
format specifier starts with the symbol.
a. % c. &
b. @ d. #
ANS: B PTS: 1 REF: 16
9. When using the scanf method in code that requires the user to enter data that will be stored as a
double, you should use the format specifier .
a. %n c. %f
b. %ld d. %lf
ANS: D PTS: 1 REF: 18
10. The data type is used to store a whole number that does not have a decimal point.
a. char c. float
b. int d. double
ANS: B PTS: 1 REF: 18
14. Various combinations of basic data types can be used to create more complex data types. What are
these data types called?
a. complex c. derived
b. combined d. double
ANS: C PTS: 1 REF: 21
17. a pointer means extracting the value the pointer is pointing to.
a. Dereferencing c. Releasing
b. Extracting d. Deriving
ANS: A PTS: 1 REF: 21
int num = 5;
int * ptrValue;
ptrValue = #
where the memory address holding num is 0x7fff6506989c, the output from the statement
NSLog(@”%d”,*ptrValue) is _.
a. 5 c. num
b. 0x7fff6506989c d. 5 0x7ff6506989c
ANS: A PTS: 1 REF: 22
20. The type is a generic data type that stores data of any type.
a. id c. pointer
b. struct d. gen
ANS: A PTS: 1 REF: 23
21. The type is a combination of several data types that creates a new custom data type. It is a
remnant of the original C language, before object oriented programming was introduced.
a. id c. pointer
b. struct d. gen
ANS: B PTS: 1 REF: 23
which of the following statements would set the value of the property num of the newly created
variable to 5?
a. ball.num = 5; c. struct.ball = 5;
b. b.num = 5; d. struct.b = 5;
ANS: B PTS: 1 REF: 23
23. notation is used to populate and retrieve the values of variables in a structure.
a. Char c. Dot
b. Struct d. #
ANS: C PTS: 1 REF: 24
24. In Objective-C, the term means a defined range of values for a variable.
a. itemization c. list
b. enumeration d. inventory
ANS: B PTS: 1 REF: 24
25. In the following section of code, the programmer did not specify the value that should be associated
with each month.
typedef enum {
Jan,
Feb,
March,
April,
May,
} Month;
a. 0 c. %undefined
b. 1 d. %error
ANS: A PTS: 1 REF: 25
26. The in Objective-C is a special tool that helps you create custom statements.
a. debugger c. importer
b. compiler d. preprocessor
ANS: D PTS: 1 REF: 26
27. The Objective-C statement is used to define constants and associate them with unique names.
a. #const c. #define
b. #preprocess d. #customize
ANS: C PTS: 1 REF: 26
28. Objective-C arithmetic operators can be divided into basic and assignment operators.
a. compound c. modulus
b. complex d. enumerated
ANS: A PTS: 1 REF: 26
30. Given that the integer num1 = 24 and the integer num2 = 15, the value of the variable div in the
expression:
div = num1 / num2
is _.
a. 0 c. 1
b. .625 d. 1.6
ANS: C PTS: 1 REF: 27
33. To produce the output, 7 % 2, in Objective-C, you could use the statement:
NSLog(@”7 2”).
a. % c. ”%”
b. ’%’ d. %%
ANS: D PTS: 1 REF: 29
38. If num1 = 2 and num2 = 3, the value of num1 after evaluating the expression
num1 += num2
will be .
a. 2 c. 5
b. 3 d. 7
ANS: C PTS: 1 REF: 32
39. A shorthand method for writing the expression num1 = num1 * num2 is .
a. num1 *= num2 c. num1 ++* num2
b. num1 *++ num2 d. num1 == num2
ANS: A PTS: 1 REF: 33
Louisiana 16 4 9 2
Maine 12 12
Maryland 16 12 4
Massachusetts 28 1 3 24
Michigan 26 15 4 5
Minnesota 14 7 1 6
Mississippi 18 1 17
Missouri 32 7 10 5 8 1
Nebraska 10 8 2
Nevada 6 6
New
Hampshire 8 5 3
New Jersey 18 9 6 1 2
New York 72 28 31 12 1
North
Carolina 22 3 18 1
Ohio 46 23 23
Oregon 6 6
Pennsylvania 60 47 11 1 1
Rhode Island 8 8
South
Carolina 18 1 17
Tennessee 24 7 16 1
Texas 26 13 11 2
Vermont 8 8
Virginia 24 2 21 1
West Virginia 12 12
Wisconsin 22 11 6 5
Territories.
Arizona 2 2
Dakota 2 2
Idaho 2 2
Montana 2 1 1
New Mexico 2 2
Utah 2 2
Washington 2 2
Wyoming 2 2
Dist. of
Columbia 2 1 1
Total 820 349 275 85 61 28 13 4
Third Ballot.
States. No. J. G.
Delegates. Blaine. Arthur. Edmunds. Logan. Sherman Hawley. Lincoln. Sherman
[75]Alabama 20 2 17 1
Arkansas 14 11 3
California 16 16
Colorado 6 6
Connecticut 12 12
Delaware 6 5 1
Florida 8 1 7
Georgia 24 24
Illinois 44 3 1 40
Indiana 30 18 10 2
Iowa 26 26
Kansas 18 15 2 1
Kentucky 26 6 16 2 1 1 [75
Louisiana 16 4 9 2
Maine 12 12
Maryland 16 12 4
Massachusetts 28 1 3 24
Michigan 26 18 3 3 1
Minnesota 14 7 2 5
Mississippi 18 1 16 1
Missouri 32 12 11 4 4 1
Nebraska 10 10
Nevada 6 6
New
Hampshire 8 5 3
New Jersey 18 11 1 6
New York 72 28 32 12
North
Carolina 22 4 18
Ohio 46 25 21
Oregon 6 6
Pennsylvania 60 50 8 1 1 1
Rhode Island 8 8
South
Carolina 18 2 16
Tennessee 24 7 17
Texas 26 14 11 1
Vermont 8 8
Virginia 24 4 20
West Virginia 12 12
Wisconsin 22 11 10
Territories.
Arizona 2 2
Dakota 2 2
Idaho 2 2
Montana 2 1 1
New Mexico 2 2
Utah 2 2
Washington 2 2
Wyoming 2 2
Dist. of
Columbia 2 1 1
Total 820 375 274 69 53 25 13 8
Fourth Ballot.
States.
No. Delegates. Arthur. Blaine. Edmunds. Logan. Sherman. Hawley. Lincoln.
[76]Alabama 20 12 8
Arkansas 14 3 11
California 16 16
Colorado 6 6
Connecticut 12 12
Delaware 6 1 5
Florida 8 5 3
Georgia 24 24
Illinois 44 3 34 6
Indiana 30 30
Iowa 26 2 24
Kansas 18 18
Kentucky 26 15 9 1 1[77]
Louisiana 16 7 9
Maine 12 12
Maryland 16 1 15
Massachusetts 28 7 3 18
Michigan 26 26
Minnesota 14 14
Mississippi 18 16 2
Missouri 32 32
Nebraska 10 10
Nevada 6 6
New Hampshire 8 2 5 3
New Jersey 18 0 17 1
New York 72 30 26 9 2 1
North Carolina 22 12 8 1
Ohio 46 0 46
Oregon 6 0 6
Pennsylvania 60 8 51 1
Rhode Island 8 1 7
South Carolina 18 15 2 1
Tennessee 24 12 11
Texas 26 8 15
Vermont 8 0 0 8
Virginia 24 20 4
West Virginia 12 0 12
Wisconsin 22 0 22
Territories.
Arizona 2 0 2
Dakota 2 0 2
Idaho 2 0 2
Montana 2 0 2
New Mexico 2 2 0
Utah 2 0 2
Washington 2 0 2
Wyoming 2 2 0
Dist. of Columbia 2 1 1
Total 820 207 541 41 7 15 2
States. Yeas Nays
Alabama 15 5
Arkansas 14
California 16
Colorado 4 2
Connecticut 2 10
Delaware 6
Florida 2 6
Georgia 12 12
Illinois 22 22
Indiana 30
Iowa 6 20
Kansas 3 15
Kentucky 20 6
Louisiana 16
Maine 2 10
Maryland 16
Massachusetts 21 7
Michigan 12 12
Minnesota 14
Mississippi 18
Missouri 18 24
Nebraska 5 5
Nevada 6
New Hampshire 8
New Jersey 14 4
New York 72
North Carolina 10 12
Ohio 25 21
Oregon 6
Pennsylvania 21 39
Rhode Island 8
South Carolina 3 14
Tennessee 17 7
Texas 12 10
Vermont 8
Virginia 6 18
West Virginia 9 3
Wisconsin 5 17
The Secretary announced the result of the vote as follows: Total number of votes cast, 795; yeas, 332;
nays, 463.
The report of the Committee on Permanent Organization was then made; the name of W. H. Vilas, of
Wisconsin, being presented as President, with a list of vice-presidents (one from each state) and several
secretaries and assistants, and that the secretaries and clerks of the temporary organization be
continued under the permanent organization.
The Contest over the Platform.
There was a two-days contest in the Committee on Resolutions over the adoption of the revenue
features of the Platform. It advocated the collection of revenue for public uses exclusively, the italicized
word being the subject of the controversy. It was retained by a vote of 20 to 18. To avoid extended debate
in the Convention an agreement was made that Gen. Butler should make a minority report, and that
three speeches should be made, these by Butler, Converse and Watterson. Col. Morrison, of Illinois,
made the majority report, which was adopted with but 97½ negative votes out of a total of 820.
The Ballots.
Before balloting an effort was made to abolish the two-third rule, but this met with such decided
disfavor that it was withdrawn before the roll of States was completed.
There were two ballots taken on the Presidential candidates, and they were as follows:
First. Second.
Total number of votes 820 820
Necessary to a choice 547 547
Grover Cleveland, of New York 392 684
Thomas F. Bayard, of Delaware 168 81½
Allen G. Thurman, of Ohio 88 4
Samuel J. Randall, of Penn 78 4
Joseph E. McDonald of Indiana 56 1
John G. Carlisle, of Kentucky 27
Roswell P. Flower, of New York 4
George Hoadly, of Ohio 3
Samuel J. Tilden, of New York 1
Thomas A. Hendricks, of Indiana 1 45½
Mr. Hendricks, of Indiana, who was defeated eight years ago on the Tilden ticket, was nominated for
Vice-President by acclamation.
The Kelly and Butler elements of the Convention, at all of the important stages, manifested their
hostility to Cleveland, but there was no open bolt, and the Convention completed its work after sitting
four days.
[In the Book of Platform is given the Democratic Platform in full, and its tariff plank will be found in
comparison with the Republican in the same book.]
THE CAMPAIGN OF 1884.
In what were regarded as the pivotal States the campaign of 1884, was attended with the utmost
interest and excitement. Blaine, the most brilliant political leader of modern times, was acceptable to all
of the more active and earnest elements of the Republican party, and the ability with which he had
championed the protective system and a more aggressive foreign policy, attracted very many Irishmen
who had formerly been Democrats. The young and more intelligent leaders of this element promptly
espoused the cause of the Republicans, and their action caused a serious division in the Democratic
ranks. Wherever Irish-Americans were sufficiently numerous to form societies of their own, such as the
“Irish-American League,” the “Land League,” the “Clan na Gael,” etc., there supporters of Blaine were
found, and these were by a singular coincidence most numerous in the doubtful States of New York, New
Jersey, Connecticut, Ohio and Indiana. Cleveland’s nomination by the Democrats had angered the
Tammany wing of the party in New York, and not until very close to the election was a reconciliation
effected. Tilden had from the first favored Cleveland, and with Daniel Manning as his manager in New
York, no effort was spared to heal Democratic divisions and to promote them in the Republican ranks.
Thus the Independent or Civil Service wing of the Republican party, which in Boston and New York
cities, and in the cities of Connecticut, confessed attachment to free trade, was easily rallied under the
Democratic banner. In convention in New York city this element denounced Blaine on what it
pronounced a paramount moral issue, and for a time such brilliant orators as Rev. Henry Ward Beecher,
George W. Curtis and Carl Schurz, “rang the changes” upon the moral questions presented by the
canvass. They were halted by scandals about Cleveland, and the Maria Halpin story, almost too indecent
for historical reference, became a prominent feature of the campaign with the acquiescence, if not under
the direction of the Republican managers. Many of our best thinkers deplored the shape thus given to
the canvass, but the responsibility for it is clearly traceable to the plan of campaign instituted by the
Independents, or “Mugwumps,” as they were called—“Mugwump” implying a small leader.
Only Ohio, West Virginia and Iowa remained as October States, and in the height of the canvass all
eyes were turned upon Ohio. In all of the Western States both of the great parties had been distracted by
prohibitory and high license issues, and Ohio,—because of temperance agitations, which still remained
as disturbing elements—had drifted into the Democratic column. If it were again lost to the Republicans,
their national campaign would practically have ended then and there, so far as reasonable hopes could
be entertained for the election of Blaine. This fact led to an extraordinary effort to influence favorable
action there, and both Blaine and Logan made tours of the State, and speeches at the more important
points. Mr. Blaine first went to New York city, thence through New Jersey, speaking at night at all
important points on the Pennsylvania Railroad, and was the following day received by the Union League
of Philadelphia. In the evening he reviewed a procession of 20,000 uniformed men. He then returned to
New York, not yet having uttered a partisan sentence, but in passing westward through its towns, he
occasionally referred to their progress under the system of protection. Reaching Ohio, he spoke more
and more plainly of the issues of the canvass as his journey proceeded, and wherever he went his
speeches commanded national comment and attention. His plain object was, for the time at least, to
smother local issues by the graver national ones, and he did this with an ability which has never been
matched in the history of American oratory. The result was a victory for the Republicans in October;
they carried Ohio by about 15,000, and greatly reduced the Democratic majority in West Virginia.
From this time forward the battle on the part of the Republicans was hopeful; on the part of the
Democrats desperate but not despairing. Senator Barnum, the Chairman of the Democratic National
Committee, was a skilled and trained politician, and he sedulously cultivated Independent and
Prohibition defection in New York, Connecticut, New Jersey, Wisconsin and Indiana. Whether the
scandals growing out of the result be true or false, every political observer could see that the elements
named were under at least the partial direction of the Democratic National Committee, for their support
was inconsiderable in States where they were not needed in crippling the chances of the Republicans.
The Republican National Committee, headed by Mr. B. F. Jones, of Pennsylvania, an earnest and able,
but an untrained leader, did not seek to check these plain efforts at defection. This Committee thought,
and at the time seemed to be justified in the belief that the defection of Irish-Americans in the same
States would more than counterbalance all of the Independent and Prohibitory defection. The
Republicans were likewise aided by General Butler, who ran as the Greenback or “People’s” candidate, as
he called himself. It would have done it easily, but for an accident, possibly a trick, on the Thursday
preceding the November election. Mr. Blaine was at the Fifth Avenue Hotel in New York, and among the
many delegations which visited him was one of three hundred ministers who wished to show their
confidence in his moral and intellectual fitness for the Chief Magistracy. The oldest of the ministers
present was Mr. Burchard, and he was assigned to deliver the address. In closing it he referred to what
he thought ought to be a common opposition to “Rum, Romanism and Rebellion,”—an alliteration which
not only awakened the wrath of the Democracy, but which quickly estranged many of the Irish-American
supporters of Blaine and Logan. Mr. Blaine on the two following days tried to counteract the effects of an
imprudence for which he was in no way responsible, but the alliteration was instantly and everywhere
employed to revive religious issues and hatreds, and to such an extent that circulars were distributed at
the doors of Catholic churches, implying that Blaine himself had used the offensive words. A more
unexpected blow was never known in our political history; it was quite as sudden and more damaging
than the Morey forgery at the close of the Garfield campaign. It determined the result, and was the most
prominent of half a dozen mishaps, which if they had not happened, must have inevitably led to the
election of Blaine.
As it was, the result was so close in New York, Connecticut, New Jersey, Indiana and West Virginia,
that it required several days to determine it, and it was not known as to New York until the 19th of
November.
The popular vote for Presidential electors was cast on the 4th of November last, and the results are
tabulated below. Where differences were found to exist in the vote for Electors in any State the vote for
the highest on each ticket is given in all cases where the complete statement of the vote of the State has
been received. The results show a total vote of 10,046,073, of which the Cleveland ticket received
4,913,901, the Blaine ticket 4,847,659, the Butler ticket 133,880, and the St. John ticket 150,633,
showing a plurality of 66,242 for Cleveland. The total vote in 1880 was 9,218,251, and Garfield’s
plurality 9464. It should be noted, in considering the tabulated statement of this year’s vote, that the
Blaine Electoral tickets were supported by the Republicans and the People’s Party in Missouri and West
Virginia, and that Cleveland Electoral tickets were supported by the Democrats and the People’s Party in
Iowa, Michigan and Nebraska. The People’s Party claims to have cast about 41,300 votes for the fusion
ticket in Michigan and about 33,000 votes in Iowa. The vote of California is official from all but two
counties; the unofficial reports from these are included in the totals given in the table. South Carolina
returns 1237 “scattering” votes.
1884.
STATES. Electoral Vote.
Blaine, Rep. Cleveland, Dem. Butler, People’s St. John, Pro. Blaine. Cleveland.
Alabama 59,444 92,973 762 610 10
Arkansas 50,895 72,927 1,847 7
California 102,397 89,264 2,017 2,920 8
Colorado 36,277 27,627 1,957 759 3
Connecticut 65,898 67,182 1,685 2,494 6
Delaware 12,778 17,054 6 55 3
Florida 28,031 31,769 74 4
Georgia 47,603 94,567 125 184 12
Illinois 340,497 312,314 10,910 12,074 22
Indiana 238,480 244,992 8,293 3,013 15
Iowa 197,082 177,286 1,472 13
Kansas 154,406 90,132 16,346 4,495 9
Kentucky 118,674 152,757 1,655 3,106 13
Louisiana 46,347 62,546 120 338 8
Maine 72,209 52,140 3,953 2,160 6
Maryland 85,699 96,932 531 2,794 8
Massachusetts 146,724 122,481 24,433 10,026 14
Michigan 192,669 189,361 763 18,403 13
Minnesota 111,685 70,065 3,583 4,684 7
Mississippi 42,774 78,547 9
Missouri 202,029 235,988 2,153 16
Nebraska 76,877 54,354 2,858 5
Nevada 7,193 5,577 3
New Hampshire 43,249 39,192 552 1,575 4
New Jersey 123,436 127,798 3,496 6,159 9
New York 562,005 563,154 17,064 25,003 36
North Carolina 125,068 142,905 448 11
Ohio 400,082 368,280 5,179 11,069 23
Oregon 26,852 24,593 723 488 3
Pennsylvania 474,268 393,747 16,992 15,306 30
Rhode Island 19,030 12,394 422 928 4
South Carolina 21,733 69,890 9
Tennessee 124,078 133,258 957 1,131 12
Texas 88,353 223,208 3,321 3,511 13
Vermont 38,411 17,342 785 1,612 4
Virginia 139,356 145,497 143 12
West Virginia 63,913 67,331 805 927 6
Wisconsin 161,157 146,477 4,598 7,656 11
Total 4,847,659 4,913,901 133,880 150,663 182 219
Plurality 66,242
There was no hitch in the count of the vote in any of the Electoral Colleges, held at the capitols of the
various States. On the 9th of February, 1885, the two Houses of Congress assembled to witness the
counting of the vote. Mr. Edmunds, President of the Senate, upon its completion, announced that “it
appears” from the count that Mr. Cleveland has been elected President, etc. This form was used upon his
judgment as the only one which he could lawfully use, the Electoral law not having as yet determined the
power or prescribed the form for declaring the result of Presidential elections.
Cleveland’s Administration.
Foraker, R. 359,538
Hoadley, D. 341,380
Leonard, Pro. 28,054
Northrop, G. 2,760
The Irish-Americans who had left the Democratic party to vote for
Blaine, adhered to the Republican standard, and really increased
their numbers—more than a third more voting for Foraker than for
Blaine, while the Mugwump element practically disappeared. The
Prohibition vote had almost doubled, but as all third or fourth
parties as a rule attract their vote from the parties in which the most
discontent prevails, the excess came not from the Republican but the
Democratic ranks.
Pennsylvania’s result, following in November, was similar in all
material points to that of Ohio. Col. M. S. Quay, an acknowledged
political leader and a man of national reputation, thought it wise that
his party should oppose in the most radical and direct way, the
Democratic State and National Administration, and with this
purpose became a candidate for State Treasurer. The Democrats
nominated Conrad B. Day of Philadelphia. The result was as follows:
Quay, R. 324,694
Day, D. 281,178
Spangler, Pro. 15,047
Whitney, G. 2,783
Col. Quay’s majority greatly exceeded all expectation, and was
universally accepted as a condemnation of the two Democratic
administrations.
New York, of all the November States, very properly excited the
most attention. The Democrats renominated Gov. Hill upon a
platform tantamount to a condemnation of civil service reform—a
platform dictated by Tammany Hall, which was already quarrelling
with the National administration. The Mugwump leaders and
journals immediately condemned both the Democratic ticket and
platform, and joined with the Republicans in support of Davenport.
The result was:
Governor.
Hill, D. 501,418
Davenport, R. 489,727
Bascom, Pro 30,866
Jones, G. 2,127
Lieutenant-Governor.
Jones, D. 495,450
Carr, R. 492,288
Demorest, Pro. 31,298
Gage, G. 2,087