Introduction to C++ Programming and Data Structures 4th Edition Liang Solutions Manual instant download
Introduction to C++ Programming and Data Structures 4th Edition Liang Solutions Manual instant download
https://testbankfan.com/product/introduction-to-c-programming-
and-data-structures-4th-edition-liang-solutions-manual/
https://testbankfan.com/product/introduction-to-programming-
with-c-3rd-edition-liang-test-bank/
https://testbankfan.com/product/c-programming-program-design-
including-data-structures-7th-edition-malik-solutions-manual/
https://testbankfan.com/product/c-programming-program-design-
including-data-structures-8th-edition-malik-solutions-manual/
https://testbankfan.com/product/engineering-mechanics-of-solids-2nd-
edition-popov-solutions-manual/
Financial and Managerial Accounting 8th Edition Wild Test
Bank
https://testbankfan.com/product/financial-and-managerial-
accounting-8th-edition-wild-test-bank/
https://testbankfan.com/product/business-and-administrative-
communication-11th-edition-locker-test-bank/
https://testbankfan.com/product/engineering-fundamentals-and-problem-
solving-7th-edition-eide-solutions-manual/
https://testbankfan.com/product/canadian-tax-principles-2017-2018-1st-
edition-byrd-solutions-manual/
Essentials of Pharmacology for Health Professions 7th
Edition Woodrow Test Bank
https://testbankfan.com/product/essentials-of-pharmacology-for-health-
professions-7th-edition-woodrow-test-bank/
Student Name: __________________
Class and Section __________________
Total Points (20 pts) __________________
Due: August 29, 2016 before the class
Problem Description:
A school has 100 lockers and 100 students. All lockers are closed on the first day of
school. As the students enter, the first student, denoted S1, opens every locker. Then the
second student, S2, begins with the second locker, denoted L2, and closes every other
locker. Student S3 begins with the third locker and changes every third locker (closes it if
it was open, and opens it if it was closed). Student S4 begins with locker L4 and changes
every fourth locker. Student S5 starts with L5 and changes every fifth locker, and so on,
until student S100 changes L100.
After all the students have passed through the building and changed the lockers, which
lockers are open? Write a program to find your answer.
(Hint: Use an array of 100 Boolean elements, each of which indicates whether a locker is
open (true) or closed (false). Initially, all lockers are closed.)
Analysis:
(Describe the problem including input and output in your own words.)
Design:
(Describe the major steps for solving the problem.)
1
Coding: (Copy and Paste Source Code here. Format your code using Courier 10pts)
1. Print this Word file and Submit to me before the class on the due day
2. Compile, Run, and Submit to LiveLab as Exercise7_15 (you must submit the program
regardless whether it complete or incomplete, correct or incorrect)
Solution:
#include <iostream>
using namespace std;
int main()
{
// Declare a constant value for the number of lockers
const int NUMBER_OF_LOCKER = 100;
return 0;
}
3
Random documents with unrelated
content Scribd suggests to you:
“Yes, I’ve been inquiring about all the legends and stories of this
place. This used to be heavily wooded, all over the point, and they
used to come down and shoot bears, right where this camp is. Dear
me, when you get into New England you are where things have
happened!”
“Yes, and in the West, too,” reminded loyal Virginia. “We have wild
Injun stories there, too, if we haven’t any Captain Kidd.”
“That is what my verses are about, Captain Kidd, If I finish them I
may hand them in, though the prize will be for some regular
Merrymeeting song, in praise of Merrymeeting, you know, something
that will go with yells and celebrations. At least that is what I should
think would take the prize, what I would give it for if I were on the
committee of councillors. But when I get something into my head I
have to finish it, or try to.”
“I’ll help you, Lilian—I’ll make up all the first lines of the couplets
and you make the second lines, or whatever lines have to have the
rhyme.”
“Aren’t you generous, Virgie!”
“Who’s going to claim the prize if the song you all wrote together
wins it?” asked Virginia.
“We haven’t thought that up yet,” replied Betty.
Not long after this conversation the songs were called for and a
meeting appointed at the club house to try out the songs previous to
the awards by the committee. The songs were to be sung before the
assembled campers, preferably by the composer, if not, by the
young councillor in charge of the proceedings. Another councillor
was at the piano. This method was explained at the beginning.
“There was an unusually large number of songs handed in this
year, which is very gratifying to the committee, but will make the
choice more difficult. As far as possible the author of the verses, or
the klondike, if part or all of the girls have learned them, will sing
them here tonight. First we shall have the Laugh-a-lot songs.”
Most of these were short efforts, but raised a great deal of
applause for the composers, though the term author is more
appropriate, since the songs were set to popular or familiar tunes.
One small author sat on a councillor’s lap and was so overcome
when her pretty little song was sung that she turned her face away;
and at the vociferous applause which followed, she quite hid her
head on the protecting shoulder.
One of the Intermediates in Piggly-Wiggly sang all alone, in a
gentle voice, two pretty verses about river, bay, island and clouds.
Helen, Eloise and the rest of the girls in that senior cabin gave praise
to Merrymeeting in a rousing chorus set to Yankee Doodle. Lilian,
Cathalina and Betty did the singing for Squirrels’ Inn. Lilian had
decided not to offer her Captain Kidd verses, declaring that there
were too many active things to do at camp to bother about a
“masterpiece”. Then, too, it would not turn out to be a real
Merrymeeting song.
After the singing of the list, a few which were easily recognized as
the best were asked for again, and the committee promised as quick
a decision as possible. As it turned out, several songs were adopted
as Merrymeeting songs, and several prizes were given, one to
Squirrels’ Inn included.
June, Jo and Dot came around to ask Lilian what had become of
the Captain Kidd song.
“Why, where did you ever hear that I was writing one?” she
asked.
“I heard you and Hilary talking about it one time,” replied June.
“It isn’t much,”
“We want to hear it any way.”
“I’ll send it to the Moon and if they accept it you shall hear it read
there.”
“All right. Did you hear any more facts about Captain Kidd?”
Lilian laughed. “I don’t know that I have any ‘facts’ about him, but
I find that there is a story about the real Captain Kidd and the
Kennebec. It is said that he used to attack boats that came to this
trading center, kill off everybody but one, whom he left to help him
carry the goods to his hiding place, and then kill him too. Nice old
pirate! And they say that the name ‘Merrymeeting’ applied not only
to the five rivers beside the Kennebec that come into Merrymeeting
Bay, but to the meeting of the tribes here.”
“Then the boys’ stories were true, or at least some of them!” said
June with satisfaction.
“How can you be glad that such terrible things happened,” teased
Lilian.
“O, I wouldn’t have had ’em happen,” explained June carefully,
“but if they did happen I want to know about it, and it would be
great if we could find some treasure. Miss Patty, do you know where
we could get something to dig with?”
“No, June, and remember, kiddies, that you can’t dig up the place,
—it isn’t yours. And if you ever go to the hunters’ cabin, Hilary and
some of the big girls must go with you.”
“O, dear, then we can’t have any fun, I suppose, and if we did
find anything it wouldn’t belong to us anyway!”
“Finders keepers,” suggested Dot.
“That wouldn’t be honest, I’m afraid,” said June.
“That ethical point can be decided if you ever come across any
treasure. I’m sure that you would be amply rewarded! Have fun
thinking about it anyhow.”
“S’pose we’d find some big red rubies,” suggested Jo.
“And di’monds,” added Dot.
“And pearls,” said June. “Haven’t we got the imaginations though?
Say, Lilian, please read us the verses!”
“O, all right, I had fun, too, writing out the story.”
“Hurry! Don’t let the youngsters see you Campbell. They went out
the lane a while ago with ‘Mother Nature’ and may be back at any
time. I think they went after flowers and will not go through the
woods to the shore, I’m pretty sure.”
“We’ll just go right down to the pine grove, and if they see us we
can’t do it, that’s all.”
Campbell had come up before supper with several parents and
some boys from Boothbay, and had just come in from canoeing with
Hilary. They were laughing, as they walked up from the shore and
beckoned to Cathalina, Betty and Eloise, who happened to appear.
While Campbell unfolded a little plan, they stood in a smiling group,
approving the scheme, which developed further under the ideas of
more conspirators. Campbell fished in his pocket for something
which they all examined with interest. Cathalina thought a moment,
and with one word, “wait”, sped away toward her cabin. There she
searched her trunk for a few minutes and flew back to her
companions.
“Just the thing! Don’t you want them, Cathalina?”
“No, I happened to bring them because they were in with the
rest.”
As if strolling, the party moved toward the pine grove, but when
they had reached its shelter their demeanor changed and they
scurried along the trail, through the trees and over the rocks that
lined the shore of Merrymeeting Bay.
“We’ll have to be quick,” said Campbell, “before my party has to
leave.”
“Where shall we put it?”
“Look; just the place!”
“I’m afraid they’ll think it’s fishy.”
“Let ’em; they’ll soon find out, anyhow.”
“O, Campbell, have more imagination.”
“They will like it in the end. Let me know how it comes out, girls.”
“Indeed we will.”
“Be sure to have them start out early tomorrow morning before
anybody else does.”
As they came back toward the club house, they saw June, Dot
and Jo sitting on the steps, talking earnestly and mysteriously, as
gestures and looks indicated.
“Hello, June,” called Campbell, holding out a hand. “And how are
Dot and Jo by this time?” June sprang to meet him, Dot took his
other hand and Jo stood smiling by.
“Where’ve you been, Mr. Stuart?” asked Dot. “We looked for you
after supper.”
“Just now we’ve come from the pine grove and around the rocks,”
replied Campbell, promptly and truthfully. “Big storm last night, girls,
must have beat upon the rocks something fierce! I wonder if it
opened up any of the caves where Captain Kidd’s treasure is!”
“Campbell!” exclaimed Hilary, laughing.
“We’ll go up tomorrow and see,” said Jo, entering into the spirit of
Campbell’s joking. “But we children are not allowed to play around
there alone. I don’t see why, because there’s nobody ever there but
camp folks.”
“Could the big girls take you? They could get up early for once,
couldn’t they?”
“Why, Mr. Stuart! You know we get up as early as the boys do,
and have a dip and everything, early bird hikes,—”
“Of course you do, Jo, excuse me!”
“We’ll prove it,” said Cathalina. “We will take you tomorrow
morning. Be ready and we’ll stop for you,—we’ll whistle Campbell’s
fraternity whistle.”
“All right! Goody!” The little girls jumped up and down as small
girls sometimes do.
“Hunting treasure!” exclaimed Campbell. “What could be more
thrilling?”
“Wear your sweaters, kiddies,” Hilary admonished, “it will be cool.”
“What time shall we get up?”
“About six o’clock?”
“O, that isn’t early enough. That would only give us an hour or so
before dip.”
“Mercy,” said Eloise, “how long do you want?”
“Could you come for us at five or five-thirty, before anybody is up,
you know?”
“I guess so,” said Hilary.
Bright and early the next morning, Cathalina and Hilary whistled
softly outside of Laugh-a-lot and were joined by three stealthily
moving figures which slipped out of the klondike, permission having
been asked the night before.
“Isn’t this fun?” said Betty. “What if we really should find
something?”
Little birds disturbed in their slumbers twittered a little from the
trees as the girls passed. Jo had a spade, which she had secured
soon after the conversation with Campbell. June had a trowel, and
Dot carried a stout stick, which she had sharpened.
“We had the awfullest time doing anything to get ready last night,
because the girls asked what we were doing.”
Arrived at the cabin, the little girls peered eagerly around and the
big girls pretended to do so. The hunter’s cabin itself was of no
particular interest, because of having been explored before. They did
not consider taking up the floor to dig or doing anything to injure
property that belonged to other people. “O, don’t I wish I owned this
place,” sighed Dot. “I’d dig and dig whenever I needed exercise!”
“There’s an awfully old looking pine tree, Dot,” said Jo, “and not
far from that ledge either.” To the older girls’ great amusement, Dot
brought forth a ruler, which they had not noticed before.
“They are actually going to measure according to that silly verse,”
whispered Cathalina.
As if to explain the performance to more critical judgment, June
said, “Now I don’t suppose that there is anything in that verse, but if
we are going to dig at all we may as well have some plan.”
“O, what’s this?” cried Jo, turning up something near the pine tree
from which they were about to measure. The three little girls
dropped on their knees as Jo pried up from the ground an old-
fashioned brooch set with a small garnet. It was well packed with
dirt and took some cleaning and blowing on Jo’s part to make it
apparent what jewel it contained. It was, however, remarkable,
considering how long the pin must have been there if dropped by
Captain Kidd, how little spoiled it was by wind and weather. The little
girls looked soberly at each other and began to examine the place.
The next find was made by Dot and was a little silver coin, too
worn for any marks of identification to be distinguished. This time
the older girls sat down on the ground to examine it. “See how
crusty it is with dirt!” exclaimed June excitedly. She was sitting at the
foot of one of the larger trees and lifted a little mat of pine needles
where the curving root showed a little hollow.
“O, look here, I feel something hard!” Slipping her hand down
further, she fished out a queer-looking metal case of some sort, all
battered and dingy, encrusted with dirt and rattling with its contents
as June held it up. “H’m,” said she, “I guess it looks old enough for
Captain Kidd’s time, or maybe the Indians put it there, or some
hunter. Beads or pearls, which?”
The girls had quite a time in getting off the cover, which was at
one end, but finally it flew off.
“Just beads.”
“Probably for Indians.”
“Take ’em out and see what’s underneath.”
“Empty the whole thing out into your lap!”
The last bit of advice was followed, and there came tumbling out
of the funny old long case a stringy little mass of beads and jewelry.
This they began to disentangle at once.
“Here’s a coral necklace.”
“Look at this little gold cross with a weeny ruby, but one arm is
broken off! Too bad.”
A silver buckle of old style, a plain gold pin, a pair of long jet
earrings, a delicate gold chain with a tiny heart on it, a small ring set
with a real turquoise and another set with a garnet and pearls
completed the list. June looked quizzically at Cathalina. “Seems to
me I’ve seen that gold chain and heart before. I bet you and
Campbell put this box here last night!”
“What makes you think so?” parried Cathalina.
“I just do. Didn’t you wear that chain at our first party?”
“How could I if it were here?”
“O, but it wasn’t here. You dear old Cathalina, you didn’t want us
to be disappointed, did you?” It was like June to take it so, instead
of feeling that the girls and Campbell wanted to make fun of the
little girls.
Dot and Jo were looking a bit rueful and Dot remarked dolefully,
“Of course we can’t keep ’em, then,” and turned the turquoise ring
about on her finger.
“Of course you can keep them if you like them. We thought that
you’d like to find something, and of course you can’t dig around
much to spoil the looks of things here.”
“Well,” said philosophical June, “of course we’d like to find some
real Captain Kidd stuff, but after all, Dot, it’s better to have these
pretty things than to dig around and not find a thing.”
“That’s so,” replied Dot, looking more cheerful. “Let’s divide them,
if Cathalina really meant them for us. Why don’t you want them,
Cathalina?”
“I never wear them. O, I did put on that necklace once lately. I
had forgotten it. Mother gave me quite a lot of old jewelry one day,
saying that no one ever wore the pieces and that I might keep them
or give them away, as I liked. I happened to have it with me and
thought of it when Campbell said ‘let’s fix up something for the girls
to find.’ The turquoise ring I had when I was about Dot’s age, and I
thought of that for her, of the garnet one for Jo, and of the little
chain for June. But divide them any way you like.”
“My, you’re good to us, Cathalina,” said Dot.
The children had quite a lively time while dividing the “treasure”.
They decided to keep it a secret about the digging, and asked the
older girls not to tell. “We didn’t put that coin there, though,” said
Hilary.
“That’s so!” exclaimed Dot. “We did find something, then!”
CHAPTER XX
AS TOLD BY BETTY
Lilian was trying on Eloise’s bathing suit of red and black, and
wrapping the cloak of the same colors about her, she folded her
arms and repeated, “Fifteen men on a dead man’s chest!”
“Yo! ho! ho! and a bottle of rum! Wait till I get on my fierce beard
and mustache and you’ll see what a pirate can look like!”
“What do you think of this?” asked Hilary, as she tried on a fiery
looking turban made of silk middy ties. “And look at the flag Patty
has made for us. Isn’t that a scary skull and cross-bones?”
“Yes indeed! Patty’s a peach,—O, ‘fifteen men on a dead man’s
chest. Yo, ho, ho!—and a bottle of rum!’”
“Aren’t you a case, Lilian North!” exclaimed Cathalina, who was
resting from her recent labors on the canoe, and lay on her cot
watching the girls.
“O, Captain Kidd, we’re glad, we’re glad you aren’t here now!”
hummed Lilian.
“Are you going to sing that?” asked Cathalina.
“O, no; if I have time I’ll make up something like, ‘I’m Captain
Kidd, the pirate bold, who sails the Kennebec,—’”
“My right arm helps ’em walk the plank,” added Hilary.
“And little do I reck!” finished Cathalina.
“Hurrah!” cried Lilian. “Poetry made while you wait by Squirrels’
Inn and company. Give me another verse and I’ll take my guitar,
neatly concealed by evergreen, and make up a tune on two or three
notes as we go.”
“A verse is a line, Lilian.”
“Very well, a stanza, then. O bold and true, my pirate crew,—”
“And if they’re not, what then?” asked Frances.
“Thanks, Frances, that will make the next line. Ah, Davy Jones will
get their bones,—mm.”
“Goodbye, ye merry men! Tra-la, another poem for our collection
of masterpieces! Say it all, Hilary,” continued Cathalina.
Hilary, “struck an attitude” and with some prompting, repeated
their latest effort:
“I’m Captain Kidd, the pirate bold,
Who sails the Kennebec;
My right arm helps ’em walk the plank
And little do I reck!
O, bold and true my pirate crew,
And if they’re not, what then?
’Tis Davy Jones will get their bones!
Goodbye, my merry men!”
Most of the day had been spent by the campers upon the canoes,
and in some cases upon their own costumes, when these were
necessary to carry out the idea. It had been planned to use that
witching time when the sky was still beautiful from the sunset and
yet the blue mist of evening with moon and stars was just appearing
in the east. It did not seem best to plan for lighting up the canoes.
While there was plenty of water, it is true, to put out any blaze that
might occur, the canoes might not be in the most favorable position
for an upset. The most beautiful light was offered by Nature herself.
The girls had worked hard. Not a canoe but was prettily dressed.
As each one was brought from its hidden retreat to be launched,
exclamations were heard on all sides. Admiration and surprise were
mingled. It was a matter of honor not to intrude upon the secrecy of
those engaged upon the work, but in some way the news about a
few had leaked out. However, only the sight of the canoes
themselves could give the full effect. The athletic director and the
other councillors knew the plans for the girls and arranged the order
of launching. With the heavier canoes, some of which had a light
framework wired and resting on top of the canoes, the girls had to
have some help. All those who were not needed to paddle or pose
stood upon the shore and dock as audience and judges.
In the graceful fleet which passed the “reviewing stand” there was
the canoe decked in ferns and evergreen, with a few paper birds
wired to poise in flight above; one in yellow and white, with yellow
roses and butterflies; another trimmed in white cotton, so put on as
to imitate snow and ice, a diamond dust covering all, two long-
bearded, white-garbed paddlers guiding the canoe, and a big white
polar bear, sitting in the center and carrying a banner marked “The
Northland.” The war canoe was given to some of the Juniors, who
wanted to represent the Old Woman who lived in a Shoe, and had to
have several children to overflow the big shoe of wired paper. One of
the councillors in white cap and kerchief took the part of the Old
Woman, and the children in quaint costumes, with ruffles of crepe
paper, roused much enthusiasm among the spectators.
This canoe won the prize for being the prettiest, and some of the
judges wanted to award it the prize for the most clever idea. But
that finally went to the three girls of Squirrels’ Inn, whose canoe was
decked to represent a pirate ship. A furled sail was put up in the
bow, to which the pirate flag was attached. Frances as Captain Kidd,
with Lilian and Hilary in costume, repeated in hoarse voices, as they
passed the judges, the couplet which Lilian had been chanting, with
“Yo, ho, ho!—and a bottle of rum!” Then all in deep voices sang the
new Captain Kidd stanzas to the tune of Yankee Doodle, rendered
slowly, while Lilian twanged an accompaniment on the guitar. Burnt
cork mustaches of fierce upward curve, made all this more
impressive.
As the light grew more dim, the girls in the canoe marked the
Northland, turned on several flashlights, which lit up effectively the
diamond dust, and those in the pirate ship turned on several large
ones, which they had covered with their red paper. A few other lights
flashed out in different canoes as they all circled prettily in the water
and came into port once more.
“There, that’s over,” said Hilary, as with the pirate flag over one
shoulder and Lilian’s guitar over the other, she entered the klondike.
“Patty will certainly have to get up our entertainment for stunt night.
We have only about a week to get ready now, and with the
Wiscasset hike, the canoe trip to Brunswick, and the White Mountain
trip, I can’t see where we get up anything, do you Frances?”
“No, I don’t. However, not all the girls will go on the White
Mountain trip, you know. Perhaps we can have some little easy part
to do that we can get quickly, or if we can think it up before we go,
we can have it in mind, you know.”
“There come Patty and the girls now; let’s ask them.”
“O, Miss Patty, how about our having stunt night next week?”
“I have been thinking about that, girls. Who has an idea?”
Nobody seemed to have one.
“They have had everything there is to have, I’m afraid,” said
Lilian.
“Well, let me relieve your minds, then,” said Patricia. “I had an
idea several days ago and have been trying to get it a little more
clearly outlined.” At this point Cathalina gave a meaning nod to Lilian
which Patty caught. “Yes, you think ‘the poor English teacher,’ don’t
you?”
“It reminded me of outlines,” Cathalina acknowledged.
“We must have a meeting tomorrow and I will tell you just what I
think we can do.”
At the morrow’s meeting the girls enthusiastically approved Miss
West’s idea, applauded the productions already in hand and thanked
her warmly for taking the responsibility. It was, to be sure, hers as
councillor to see that the girls had some sort of entertainment ready
for their turn at stunt night, but these girls, as good campers, were
always willing to do their share and had no desire to take advantage
of their young councillor. Some of the parts were given out and the
girls began to learn them. They considered it pure fun, for there was
required no serious preparation.
The canoe trip to Brunswick was next on the list of trips. The
canoes, stripped of their decorations, bore the jolly campers away,
around Marshmallow Point into Merrymeeting Bay, to the left, past
Brick Island of Captain Kidd fame, and on up the Androscoggin river,
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
testbankfan.com