Programming Basics: Getting Started With Java, C#, and Python 1st Edition Robert Ciesla PDF Download
Programming Basics: Getting Started With Java, C#, and Python 1st Edition Robert Ciesla PDF Download
https://ebookmeta.com/product/programming-basics-getting-started-
with-java-c-and-python-1st-edition-robert-ciesla/
https://ebookmeta.com/product/programming-the-raspberry-pi-
getting-started-with-python-third-edition-simon-monk/
https://ebookmeta.com/product/programming-arduino-getting-
started-with-sketches-third-edition-simon-monk/
https://ebookmeta.com/product/game-development-with-renpy-1st-
edition-robert-ciesla/
https://ebookmeta.com/product/up-in-flames-steamy-instalove-
firefighter-romance-cedar-falls-fire-rescue-1st-edition-kelsie-
calloway-2/
Thomas Jefferson and the Development of American Public
Education James B. Conant
https://ebookmeta.com/product/thomas-jefferson-and-the-
development-of-american-public-education-james-b-conant/
https://ebookmeta.com/product/safe-and-healthy-schools-practical-
prevention-strategies-2nd-2nd-edition-jeffrey-r-sprague/
https://ebookmeta.com/product/korean-routledge-library-editions-
korean-studies-ho-min-sohn/
https://ebookmeta.com/product/the-ones-we-burn-1st-edition-
rebecca-mix/
Bible Sisters A Year of Devotions with the Women of the
Bible 1st Edition Gennifer Benjamin Brooks
https://ebookmeta.com/product/bible-sisters-a-year-of-devotions-
with-the-women-of-the-bible-1st-edition-gennifer-benjamin-brooks/
Robert Ciesla
Programming Basics
Getting Started with Java, C#, and Python
1st ed.
Robert Ciesla
HELSINKI, Finland
This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in
any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.
The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
What do video games, social networks, and your activity bracelet have
in common? They run on software a group of (more or less)
programmers wrote somewhere far, far away. Gadgets and hardware
are only one, more visible side of the coin of our technology-driven
societies. In this chapter, we’ll discuss the very basics of programming.
We’ll also take a gander at the visible parts of digital systems: the
hardware.
3. Video Card
Video cards are responsible for displaying a system’s visuals, whether
they be plain text or dazzling 3D graphics in a modern video game.
These devices come in a variety of configurations and prices, ranging
from $30 word processor fiends to $1000 gaming monsters (see Figure
1-3). Computer monitors are typically connected directly to a video
card.
Figure 1-3 An Nvidia 7900GS video card from 2006
5. Motherboard
All of the aforementioned four hardware components (i.e., the CPU, the
video card, the hard disks, and RAM) come together at the motherboard
to create a working computer unit. The motherboard also has
connectors for keyboard, mice, and other control devices (see Figure 1-
5).
Figure 1-5 A modern PC motherboard. Image by Evan-Amos. CC BY-SA 3.0. Source:
upload.wikimedia.org/wikipedia/commons/0/0c/A790GXH-128M-
Motherboard.jpg
Input/Output
Input in the context of programming refers to us entering data for a
piece of software running on a computer to process. This comes in the
form of typed text, mouse commands, or various types of files. For
example, a word processing program (e.g., Microsoft Office) most often
takes its input mostly as alphanumerical data provided by keystrokes.
Output refers to data that has been processed by software. In a word
processor this usually refers to a file document saved with the program.
Such output can also be directed at printers or other devices. The
output from programmers (carbon dioxide and other things
notwithstanding) is typically a working application, whether it’s a
completed tutorial file or a bigger project.
Algorithm
A working program listing basically constitutes an algorithm, which
refers to a set of steps created to solve problems. Most software
consists of numerous sub-algorithms. In the case of, say, a video game,
there are algorithms for displaying graphics, saving and loading the
game state, and playing audio files to name just a few.
Flowchart
Programming projects and their algorithms are often visualized using
flowcharts, especially in a team environment. These are a great way to
demonstrate basic program flow in most instances.
Another Random Scribd Document
with Unrelated Content
fascinated him and was a better place for an artist than his
childhood town, but he never tired of going back to the old home or
lost interest in the pigs and cows and the market folk on the Rhine
road. Sometimes on these visits he would lie on the ramparts just as
he had done when a boy, and strangers journeying to and from The
Hague had no idea that the grave-eyed man dreaming there in the
shadow of the mill sails was the famous painter of Amsterdam.
Then, one day he died, and they laid him to rest in the harbor city
where for so many years he had lived and worked. The people of
Leyden asked to have him taken back there, and those who know
how he loved it wish it had been done; for it would be pleasant to
think of him sleeping in the shadow of the mill sails, and perhaps if
he could have been asked he would have wanted it, too.
Years passed, but instead of dimming the glory of Rembrandt’s
name they brightened it. After his death his works became priceless,
and the world still prizes them just as Amsterdam prized them two
hundred years ago. To own a canvas by this king of Dutch painters is
to be rich and envied, for it requires a great deal of money to buy
one of his paintings. Even the crude drawings of his boyhood are
now treasured by princes, and one of the most prized possessions of
a great museum in Holland is a pair of wooden shoes. They are
brown and clumsy and covered with marks, half of which have been
worn away by the staining finger of Time; but a fortune could not
buy them, because ever so long ago they were worn by little
Wilhelmina van Rijn to the Latin school of Leyden, and were
decorated by the hand of a mill boy, and who would not be proud to
own them? That mill boy became the immortal Flemish painter,
Rembrandt, whose work will be treasured as long as the world loves
beautiful things.
A Swiss Legend
(Geography)
The Alpine herdsmen say that in the marvelous long ago an
enchanted boat was seen gliding up and down the blue waters of
Lake Geneva. Neither oars nor sails were needed to speed it over
the waves, for it was drawn by singing swans and carried a fairy
crew. A radiant creature in a robe whiter than goat’s milk stood on
the prow, her gleaming hair rippling down over the hem of her
garment. She bore a golden basket of rare fruits and flowers, and
although she scattered the contents with lavish hand upon the
sprites at her feet, it was never empty. Sometimes the vessel
touched the shore, and then the soil around that spot produced as
never soil produced before or since, and if any peasant was so
fortunate as to catch a glimpse of the boat, he and his children
became rich beyond want and were blessed and happy to the end of
their days.
For hundreds of years the magic ship sailed the lake, and as it
touched the shore frequently and numbers of peasants saw it, there
was wonderful prosperity in Old Helvetia.
But a great misfortune befell the country and the glad, abundant
days became but a memory. A steamboat was brought to Geneva,
and it plowed, a screaming, snorting monster, across the waters.
The noise terrified the gentle swans, and with one wild cry they flew
away. Never again did the peasants catch a glimpse of the white-
robed fairy and the shining sprites. Never again did the music of the
snowy pilots gladden their ears.
The Luck Boat disappeared, and with it went prosperity from the
land of Geneva. But marvelous things like that are never forgotten.
Those who had seen the fairy craft in their youth told the story to
their sons and daughters, who passed it on to their children and
their children’s children, and although the mountain folk of today
have never beheld it, they know just how it looked. They have
pictured it so often in their minds, that their artists have pictured it
on paper, and so it has become the custom for the peasants around
Lake Geneva to send “Luck cards” to their friends on New Year’s
Day. These are gay, colored postals containing a likeness of the Luck
Boat, and to those of whom a peasant is fondest he sends as many
as he can afford, because to receive them is supposed to bring good
fortune, just as a glimpse of the swan-drawn vessel was said to do
in the marvelous long ago.
(Geography—Ethics—Manual Training)
In a chalet high up among the Austrian mountains, blue-eyed
Franz was very unhappy because his mother and brother Johan were
going to Vienna and he had to stay at home with his old grandfather.
He bit his lips to keep back the tears as he watched the packing of
the box that was to carry their clothing. Then his mother tried to
comfort him.
“Never mind, lad,” she said. “I’ll send you a present from Vienna,
and we’ll call it a ‘luck gift’ and hope it will bring good luck. If it does
you’ll be a luck boy.”
He smiled even if he did feel sad. He had often heard of luck
children, for among the Tyrolean peasants there were many stories
of those who had been led by fairies to have such wonderful good
fortune that ever afterward they were spoken of as the elf-aided, or
“Glücks Kinder,” and it was so delightful to think about being one of
them that he forgot his sorrow. Of course it would be very fine to
travel down to Vienna and go into the service of a rich noble there,
as his mother and brother were to do, but it would be still better to
be a “Glücks Kind,” and such things sometimes did happen. So he
did not feel sad any more, but whistled and sang and helped with
the packing.
Early next morning the post chaise rattled up to the door, and
Johan and the mother drove away. Franz watched them go down the
winding white road, calling after them in sweet Tyrolean words of
endearment until they were out of sight. Then he went back into the
hut and began to sandpaper some blocks that his grandfather
needed for his work. The old man was a maker of picture frames, all
carved and decorated with likenesses of mountain flowers, and
these, when sent to Innsbruck and Vienna, brought the money that
gave him his living. The figures were too fine and difficult for Franz
to carve, but he could lend a hand at fetching blocks and
sandpapering. He worked with a vim, for Tyrolean boys think it a
disgrace to shirk, but all the while his thoughts were on the luck gift.
“I wonder what it will be?” he said to his grandfather. They took
turns at guessing, until it was time to feed the goats and house the
chickens for the night.
A week later the man who had driven Johan and his mother away
came by on his return from Vienna, and Franz fairly flew out to get
his gift.
“It is something very big,” he called to the old frame maker as he
took a bulging bag. “See, it is stuffed full!” And he expected to find
something very wonderful.
But when he opened it, he thought it wasn’t wonderful at all.
There was a blue velvet jacket, trimmed with gold braid and
fastened with glittering buttons, such as Tyrolean boys wore in those
days, and in one of the pockets he found a shining knife.
“Well, of all things!” he exclaimed as he held them up for his
grandfather to see. “It’s a splendid jacket, and the knife is a beauty,
but I don’t see where the luck part comes in.”
But Hals Berner was old and wise, and a knowing smile played
over his wrinkled face as he spoke. “It won’t be the first time luck
has hidden in a knife,” he said, as he bent over his carving.
Franz did not know what he meant. He had always had a knife, for
being of a carver’s family he was taught to whittle when he was a
very little fellow, and he had become remarkably skillful for one of
his years. But no wonderful good fortune had come to him, and he
was very sure that although each of the presents was nice, neither
would bring luck, and he sent that word to Johan. But the brother
wrote back from the city, “It will surely turn out to be a luck gift,
Franz. Just wait and see.” And still the boy wondered.
Winter came and icy winds blew down from the peaks. There was
no word from Vienna now, for the valley was shut in by a glittering
wall, and travel over the snow-drifted passes was impossible. There
were other boys in the village, but each had his work indoors, and
there was little time to play, so Franz had no chance for games. He
helped his grandfather part of the day and sometimes whittled for
his own amusement. It was a lonely life there in the hut, with just
the old frame maker, who was often too busy to talk, so Franz was
glad to do something to keep him busy. Now he made rings and tops
and then just fantastic sticks or blocks.
One day, as he whittled, his grandfather said, “Why don’t you
make an animal, Franz?”
The boy looked up in surprise. “I don’t think I can,” he answered.
“Not unless you try,” came the reply. “But if you do that you may
surprise yourself.”
Franz hated to have any one think he was afraid to make an
attempt, so he exclaimed, “I wonder if I could make a sheep?”
“Begin and see,” the old man advised.
The boy went to work. At first it was discouraging. After many
minutes of whittling there was little to suggest what he had in mind.
But then, with an occasional turn of the knife by the frame maker,
and now and then a bit of advice, the boy began to see that a sheep
would grow out of the block, and when it did he felt like a hero who
has won a battle.
“It wasn’t a bit hard, was it, lad?” Hals Berner asked when it was
finished.
And Franz agreed that it was not.
That was the beginning, and every day thereafter Franz worked at
his whittling, and animal after animal grew under his knife. He was
so busy he did not have time to be lonely, and had quite forgotten
how sad he had felt over having to stay at home. It was such fun to
see the figures come out of the wood and feel that he had made
them. Of course they were crude, and not half so handsome as
those his grandfather could have made; but any one could tell what
they were, and that was worth a great deal.
By spring he had a whole menagerie, and when his mother came
home she found he had been a busy boy, and a happy one as well.
“All made with the luck knife,” Johan said as he looked over the
work.
“So grandfather says,” Franz answered. “It’s a splendid knife, but I
don’t see yet where the luck comes in.”
And again the knowing smile went over the old man’s face.
One day soon afterward his mother had word from the man who
had been her employer in Vienna that his little son was not well, and
he was sending him to regain his health in the mountain air. A week
later the child arrived with his nurse, and the first thing that
attracted his attention was Franz’s menagerie.
“Oh! oh!” he exclaimed, “dogs, cats, sheep, goats, lions,
elephants, and all made of wood! I want them.”
“He means that he wants to buy them,” his nurse explained. “Will
you sell them, Franz?”
For a minute the boy hesitated. That menagerie had meant many
months of whittling, and he loved every animal in it, and if Johan
hadn’t interrupted, probably he would have refused.
“Why, Franz,” the brother exclaimed, “it begins to look like a luck
knife after all.”
That put a thought into his mind that caused him to answer, “Yes,
take them. I can make some more.”
So, when the child went back to Vienna he took a wooden
menagerie from the Tyrolean mountains. Other Viennese children,
seeing it, wanted to possess one, and orders began to pour in to
Franz, far more than he could fill. Then other villagers took up the
work, until all over the valley people were making animals and toys.
The work grew to be a big industry, and toys from the Grödner
Thal were sent all over Germany, and even to the lands beyond. One
generation after another went on with the work, and although it is
two hundred years since Franz began it, the craft continues there to
this day. At Christmas time shops in every land are filled with toys
from the Tyrolean mountains, and although they do not know the
story, thousands of children have been happier because of a peasant
boy’s whittling.
So out of the bag sent back from Vienna there came in truth a
luck gift, and it wasn’t the fine jacket either, but the knife with which
Franz whittled his first sheep. The boy had found out that luck
doesn’t mean something sent by fairies, but the doing a thing so
well that it brings a rich reward, and although he lived to be a very
old man, he never got over being grateful that his mother made him
stay behind when she and Johan went to the city.
The little valley among the Austrian Alps is still called Grödner Thal
on the maps, but because of the animals and toys that have come
out of it, it is almost as well known by another name. If you are
good guessers you can surely tell what it is, especially if you know
that the peasants still speak of the lad who made the first menagerie
there as the Luck Boy of Toy Valley.