Tuesday, August 25, 2020

Lord Of The Flies - The Evil In Us All Essays -

Ruler of the Flies - The Evil in Us All ? ?The ensemble has a place with you obviously.' ?They could be the military .' ?or then again trackers'? ( Lord of the Flies pg. 21 ). That was Ralph's serious mix-up, giving Jack that power and the option to be trackers. That power prompted the fall of their human progress and the take over of Jack's savage clan. There is insidious inside everybody and everything, it is simply a question of whether you let it take control of you. That is the thing that The Lord of the Flies , a novel by William Golding, attempts to express. Through breaking down the character of Jack you can perceive how the brutality takes him over gradually as he grows intellectually, truly, and genuinely all through the novel.. Jack declined more than grew intellectually all through the book. ? ?I should be boss,' said Jack with straightforward egotism, ?since I'm part chorister and head kid. I could sing a C sharp'? ( pg. 21 ). Jack was an ordinary little youngster, perhaps a bossy one, however still a kid. ? ?They abhor you Ralph. They will do you. They're going to chase you tomorrow-Jack, the central says it will be risky, and to toss our lances like at a pig'? ( pg. 172 ). Jack was a kid who turned into a savage monster. The more force Jack increased over different young men the less he thought about development, and the more he declined intellectually. What power could make somebody chase an individual man like he was a creature? Just as changing intellectually Jack additionally changed genuinely. ?The animal was a gathering of young men, wearing abnormally erratic attire. Shorts, shirts, and various articles of clothing they conveyed in their grasp; yet every kid wore a square dark top with a silver identification on it. Their bodies, from throat to lower leg, were covered up by dark shrouds which bore a long silver cross on the left bosom and each neck was done off with a hambone ornament? ( pg. 18 ). That was Jacks appearance when he originally showed up on the island. In addition to the fact that he was dressed, be that as it may, extravagantly. ? ?They'll be painted! You know how it is.' They seen just as well well the freedom into brutality that the disguising paint brought.? ( pg. 157 ). Jack had changed into a painted bare savage. In one purpose of the book Ralph remarks about how he can not recollect what Jack resembles. How can one go from a modern English kid to being a messy painted brute? Jacks interests changed radically. He began by needing power, to be boss. At that point his enthusiasm moved to slaughtering a pig. When he had slaughtered a pig the entirety of his consideration gone to slaughtering. He went from needing to execute pigs to expecting to murder them. ?Jack was on top of the sow, cutting descending with his blade.- Then Jack found the throat and the hot blood rambled over his hands. The sow fallen under them and they were substantial and satisfied upon her.? ( pg. 123 ). That is only one case of how Jack's interests overwhelmed him. In the end Jack's enthusiasm went from murdering pigs to executing individuals. He starts the slaughtering of Simon, is associated with the demise of Piggy, and plans the passing of Ralph. What might drive a little fellow to submit such acts? When Golding composed the character of Jack he was speaking to humanity as a entirety. The manner in which Jack declined as an individual is demonstrating how individuals change when they are in a circumstance like that. Some may state that Jack was just human, and he may be. Be that as it may being human accompanies a ton of stuff, and you must have the option to control your feelings. That is the thing that drove Jack to do those horrendous things. He was unable to control the abhorrence, the malevolent that is in every one of us.

Saturday, August 22, 2020

Epic Heroes Essays - Ancient Greek Religion, Epic Cycle,

Epic Heroes Moreover, we have not even to chance the experience alone, for the legends ever have gone before us. The maze is completely known. We have just to follow the string of the saint way, and where we had thought to discover a cursed thing, we will discover a divine being. Furthermore, where we had thought to kill another, we will kill ourselves. Where we had thought to travel outward we will go to the focal point of our own reality. Also, where we had thought to be distant from everyone else, we will be with all the world. Joseph Campbell, The Power of Myth Saints have been well known all through the presence of people since that is what merits expounding on (Campbell 123). Legend fantasies help us to develop into better people by gaining from the preliminaries and triumphs of the saint. In old style Greek writing, the epic saint can be characterized as far as the differentiating characters of Achilles and Odysseus, the two most significant figures in Homer's extraordinary epic sonnets The Iliad and The Odyssey. The two legends speak to the two unique sorts of saints that we have, a saint with an otherworldly deed and a saint with a physical deed: There are two kinds of deed. One is the physical deed wherein the legend plays out a valiant demonstration in fight. The other is a sort of otherworldly deed, wherein the legend figures out how to encounter the supernormal scope of human profound life and afterward returns with a message. (Campbell 123) Achilles, the best warrior of the Greeks in the Trojan War, is really a demi-god as opposed to a human saint, having been dunked in enchanted waters by his mom and given the endowment of insusceptibility. He speaks to the physical deed. Odysseus, then again, is a completely human character, and his valor comprises more in his keenness, intensity and sly than his military capacity. He speaks to the profound deed. The difference between these two models of the epic saint couldn't be more grounded, for in spite of the fact that Achilles is divine and practically eternal in his battling ability, he stays silly and touchy as a part of his character, even at the time of his most prominent triumph he does not have the honorability and liberality expected of a genuinely extraordinary legend. The man of numerous ways Odysseus, notwithstanding, transcends his absolutely human constraints to accomplish an a lot more noteworthy fate, triumphing over the risks of war and meandering to return home to his better half and family. Achilles, the main terrible legend in writing, portrays the two sides of human instinct: Achilles embodies what is ideal and most noticeably awful in human instinct. He is at his best when he?offers sympathy and comfort that uncover his significant comprehension of the human condition. Anyway even under the least favorable conditions he carries on like a narrow minded kid and acts like a fierce mammoth. (Rosenberg 121) We watch the more terrible parts of Achilles' character not long after we first experience him in The Iliad, during his squabble with Agamemnon over the ownership of a mistress. Prior to the gathered Greek pioneers, Achilles gripes that he never gets a lot of the prizes, that the Achaeans don't give him adequate respect, and that he has become tired of battling the Trojans, since to me they have sat idle (Lattimore, 1967:63). At the point when Agamemnon chooses to show him a thing or two and take his mistress Briseis from him, Achilles exhibits an attack of temper and cautions all the Greeks that they will be sorry they would not take into account his wants: And then you will eat out the heart inside you in distress, that you did no respect to the best of the Achaeans (Lattimore, 1967:65). At that point he leaves to mope in his tent. Achilles unarguably is in reality the best of the Achaeans in battle, however since he is the child of a goddess and favored with immunity in fight, chi valry isn't the quality that makes him an extraordinary warrior. His partner among the Trojans, Hector, in truth, is an a lot nobler character- - wanting to his folks, spouse and kids, valiant in fight, and ready to forfeit everything for his kin. In examination with Hector, Achilles takes after something of a mom's kid; truth be told, we see him crying to his mom Thetis

Tuesday, August 4, 2020

Harry Harlow and Mary Ainsworth essay sample

Harry Harlow and Mary Ainsworth essay sample Theory of attachment according to H. Harlow and M. Ainsworth work According to the definition, attachment is a strong emotional bond that connects two people tight. This phenomenon is not reciprocal, so its not a rule that both people involved in it, would feel attached to each other. Usually it occurs between a child and parents, usually mother, because newborns spend most of their time with her. Ainsworth and Harlow are two psychologists that studied the theory of attachment and tried to understand its mechanisms. We can find many similar things in these psychologist’s work: first of all, they both assumed that imprinting is not the only reason that explains attachment, that was based on researches of animals and humans. Both scientists used the same methodology for their researches. Another similarity is both these researchers were supposed that attachment affects a lot human behavior and personality. We can see that both scientists demonstrated the high importance of attachments impact for the persons future behavior. Both Harlow and Ainswor th researched the connection between baby and mother as the main component of attachment. Scientists suggest that the tight connection and tactile feelings between baby and mother are quite important thing for them both. The main difference between two researchers work is they used different forms of study. Harlows studying included research of monkey’s behavior: he observed their behavior connected to feeding and to their surrogate mother, when Ainsworth was researching human newborns and their attachment to mothers. Mary demonstrated her 20-minutes experiment that was named the Strange Situation. During this experiment, mother and her newborn were exposed to the stranger, who later stays alone with a baby, and later the baby is left alone before reunion with the mother and stranger. Ainsworth supposed that babies are more interested in discovering the world in mothers presence than when they stay with a stranger, so in her work she proved that attachment is a form of security for children. We can see that Harlow worked only with the origin of theory, when Ainsworth expanded the studying of phenomenon and did more complex research. Harlows research was mostly based only on observing behavior durin g feeding, he didnt pay attention to any other forms of attachment that was done in Ainsworths work. In his work Harlow said that there are 4 types of attachments, when Ainsworth viewed only 3 forms. Another difference is both scientists based their work on different background principles. Harlow mostly used the behaviorist theory, when Ainslows study was based mostly on Freud theory and psychoanalysis principles. Both studies have a lot of similar and different moments, but we can say that both scientists, Ainsworth and Harlow made quite interesting and useful researches that are very important for the further studying of the attachment.

Saturday, May 23, 2020

Battle of the Thames in the War of 1812

The Battle of the Thames was fought October 5, 1813, during the War of 1812 (1812-1815). In the wake of the American victory at the Battle of Lake Erie, Major General William Henry Harrisons army recaptured Detroit before crossing into Canada. Outnumbered, British commander Major General Henry Proctor elected to withdraw east with his Native American allies. On October 5, he turned his army and made a stand near Moraviantown. In the resulting battle, his army was routed and the famed Native American leader Tecumseh was killed. The victory secured the United States northwest frontier for the remainder of the war. Background ​Following the fall of Detroit to Major General Isaac Brock in August 1812, American forces in the Northwest endeavored to recapture the settlement. This was badly hampered due to British naval forces controlling Lake Erie. As a result, Major General William Henry Harrisons Army of the Northwest was forced to remain on the defensive while the U.S. Navy constructed a squadron at Presque Isle, PA. As these efforts progressed, American forces suffered a severe defeat at Frenchtown (River Raisin) as well as endured a siege at Fort Meigs. In August 1813, the American squadron, commanded by Master Commandant Oliver Hazard Perry emerged from Presque Isle. Outnumbered and out-gunned, Commander Robert H. Barclay withdrew his squadron to the British base at Amherstburg to await the completion of HMS Detroit (19 guns). Taking control Lake Erie, Perry was able to cut off the British supply lines to Amherstburg. With the logistical situation worsening, Barclay sailed out to challenge Perry in September. On September 10, the two clashed at the Battle of Lake Erie. After a bitter fought engagement, Perry captured the entire British squadron and sent a dispatch to Harrison stating, We have met the enemy and they are ours. With control of the lake firmly in American hands, Harrison embarked the bulk of his infantry aboard Perrys ships and sailed to recapture Detroit. His mounted forces advanced along the lake shore (Map). The British Retreat At Amherstburg, the British ground commander, Major General Henry Proctor, began planning to withdraw east to Burlington Heights at the western end of Lake Ontario. As part of his preparations, he quickly abandoned Detroit and nearby Fort Malden. Though these moves were opposed by the leader of his Native American forces, the famed Shawnee chief Tecumseh, Proctor proceeded as he was badly outnumbered and his supplies were dwindling. Detested by the Americans as he had allowed the Native Americans to butcher prisoners and wounded after the Battle of Frenchtown, Proctor began retreating up the Thames River on September 27. As the march progressed, the morale of his forces fell and his officers became increasingly dissatisfied with his leadership. Fast Facts: Battle of the Thames Conflict: War of 1812 (1812-1815)Dates: October 5, 1813Armies Commanders:United StatesMajor General William Henry Harrison3,760 menGreat Britain and Native AmericansMajor General Henry ProctorTecumseh1,300 menCasualties:United States: 10-27 killed, and 17-57 woundedGreat Britain 12-18 killed, 22-35 wounded, and 566-579 capturedNative Americans: 16-33 killed Harrison Pursues A veteran of Fallen Timbers and the victor of Tippecanoe, Harrison landed his men and re-occupied Detroit and Sandwich. After leaving garrisons at both locations, Harrison marched out with around 3,700 men on October 2 and began pursuing Proctor. Pushing hard, the Americans began to catch up to the tired British and numerous stragglers were captured along the road. Reaching a location near Moraviantown, a Christian Native American settlement, on October 4, Proctor turned and prepared to meet Harrisons approaching army. Deploying his 1,300 men, he placed his regulars, largely elements of the 41st Regiment of Foot, and one cannon on the left along the Thames while Tecumsehs Native Americans were formed on the right with their flank anchored on a swamp. Shawnee leader Tecumseh. Public Domain Proctors line was interrupted by a small swamp between his men and Tecumsehs Native Americans. To extend his position, Tecumseh lengthened his line into the large swamp and pushed it forward. This would allow it to strike the flank of any attacking force. Approaching the next day, Harrisons command consisted of elements of the U.S. 27th Infantry Regiment as well as a large corps of Kentucky volunteers led by Major General Isaac Shelby. A veteran of the American Revolution, Shelby had commanded troops at the Battle of Kings Mountain in 1780. Shelbys command consisted of five brigades of infantry as well as Colonel Richard Mentor Johnsons 3rd Regiment of Mounted Riflemen (Map). Proctor Routed Nearing the enemy position, Harrison placed Johnsons mounted forces along the river with his infantry inland. Though he initially intended to launch an assault with his infantry, Harrison changed his plan when he saw that the 41st Foot had deployed as skirmishers. Forming his infantry to cover his left flank from Native American attacks, Harrison instructed Johnson to attack the main enemy line. Splitting his regiment into two battalions, Johnson planned to lead one against the Native Americans above the small swamp, while his younger brother, Lieutenant Colonel James Johnson, led the other against the British below. Moving forward, the younger Johnsons men charged down the river road with Colonel George Paulls 27th Infantry in support. Battle of the Thames, October 5, 1813. Library of Congress Striking the British line, they quickly overwhelmed the defenders. In less than ten minutes of fighting, the Kentuckians and Paulls regulars drove off the British and captured Proctors one cannon. Among those who fled was Proctor. To the north, the elder Johnson attacked the Native American line. Led by a forlorn hope of twenty men, the Kentuckians soon became engaged in bitter battle with Tecumsehs warriors. Ordering his men to dismount, Johnson remained in the saddle urging his men forward. In the course of the fighting he was wounded five times. As the fighting raged, Tecumseh was killed. With Johnsons horsemen bogged down, Shelby directed some of his infantry to advance to their aid. As the infantry came up, the Native American resistance began to collapse as word of Tecumsehs death spread. Fleeing into the woods, the retreating warriors were pursued by cavalry led by Major David Thompson. Seeking to exploit the victory, American forces pressed on and burned Moraviantown despite the fact that its Christian Munsee inhabitants had played no role in the fighting. Having won a clear victory and destroyed Proctors army, Harrison elected to return to Detroit as the enlistments of many of his men were expiring. Aftermath In the fighting at the Battle of the Thames Harrisons army suffered 10-27 killed, and 17-57 wounded. British losses totaled 12-18 killed, 22-35 wounded, and 566-579 captured, while their Native American allies lost 16-33 killed. Among the Native American dead were Tecumseh and the Wyandot chief Roundhead. The exact circumstances regarding Tecumsehs death are not known though stories quickly circulated that Richard Mentor Johnson killed the Native American leader. Though he never personally claimed credit, he used the myth during later political campaigns. Credit has also been given to Private William Whitley. The victory at the Battle of the Thames saw American forces effectively take control of the Northwest frontier for the remainder of the war. With Tecumsehs death, much of the Native American threat in the region was eliminated and Harrison was able to conclude truces with many of the tribes. Though a skilled and popular commander, Harrison resigned the following summer after disagreements with Secretary of War John Armstrong.

Monday, May 11, 2020

Ethical Decision Making And Religious Faith Essay

Ethical Decision Making and Religious Faith Troy Gill MSCR680_X41_Rapid Decision Making Regis University Abstract The goal is to examine through literature review if religious faith is deemed to affect the moral or ethical decision-making process of United States Military personnel in a overall sense. But it might also be applied towards everyday civilian study as well. For instance, the United States Marine Corps have been built on a foundation of strong moral values. These are the principled beliefs that shape recruits into men and women of character. Equipped with this skillset they can and can be called upon to make hard rapid decisions in unfavorable situations and increase the likelihood of making solid ethical decisions. Thus the primary question is: How does faith in God or specific religious faith affect the ethical decision making process. Is it a key factor or minimal factor? Can or does it affect persons differently? What components of decision-making might be swayed by particular religious faith? We will simplify this essay to some degree as it could ge both a intensive and hot button topic depending on how in depth we delve into the religious aspect, particularly certain religions. Literature Review Outlining, distinguishing, and deciding ethical problems have been spotlight for abundant examination in sophisticated societies. Sociologists have generated considerable research such as studies and publications from, Ferrell Gresham,; Hunt Show MoreRelatedThe Ethical Issues Of Religion1421 Words   |  6 Pagesexplanations and what may be considered as solutions to the challenges people face. However, the role of religion when it comes to solving serious medical problems is relative, depending on strength of the religious faith and other personal characteristics and values. Some individuals have a greater faith than others and would consider the option of waiting for a miracle to cure their loved ones more effective than undergoing a medical procedure. The similar scenario is highlighted in the Case Study: HealingRead MoreGod is Not Great by Christopher Hitchens1301 Words   |  6 Pagesfoundational role in society and civilization and incredible importance to everyday life and decision making. In many of these disputes religious belief, or a lack thereof, serves as an important driving force behind one or both sides of the argument. In the modern world, one of the bigger instances of this can be seen in the many debates between Atheistic and religious individuals about the implications of religious belief on morality. One of the most famous Atheists, Christopher Hitchens, asserts thatRead MoreMulticultural Communities and Multi-Faith Practices1103 Words   |  4 PagesIn the past decade, Ireland became an increasing multicultural community from different nationalities accompanying multi-faith practices.[1] Despite the acknowledgment of the fact that diversity of race, religion, language, and cultural background between people is crucial in the healthcare environment, it is more important to develop cultural competency in hospitals to ensure high-quality health care service exclusive of inequalities and responsive to the requirements of the diverse patients.[2][3]Read MoreThe, Science And Imagination, By Wendel Berry Essay1640 Words   |  7 PagesDualism in Ethical Eights The advancement in technology and science has triggered a new way of thinking among many people. What seems challenging is drawing the limits of this advancement in terms of what is ideal and imperative for humanity. Science seems to provide concrete evidence for its discoveries. However, the increased reliance on scientific discoveries and technology is diminishing the human morals. All these are amidst the emergence of dualities such as religious fundamentalism and scientificRead MoreEssay on Kierkegaards View on Faith1045 Words   |  5 PagesKierkegaards View on Faith Kierkegaard was a Danish philosopher in the mid 1800s. He is known to be the father of existentialism and was at least 70 years ahead of his time. Kierkegaard set out to attack Kant’s rational ethics and make attacks on the Christianity of our day. He poses the question, how do we understand faith? He states that faith equals the absurd. In â€Å"Fear and Trembling†, he uses the story of Abraham and his son Isaac to show an example of faith as the absurd. The story ofRead MorePsychology and Religion1229 Words   |  5 Pagesones own religious views on clients and to know how to correctly understand and treat people of different faiths. In the article Ethical Issues for the Integration or Religion and Spirituality in Therapy, Fisher highlights ethical challenges involving Spirituality in Therapy including; competence and avoiding secular-theistic bias. Fisher goes on to further explain the effects of Imposing Religious Values, the importance of Informed Consent and the challenges that arise regarding faith and multipleRead MorePastoral Counselling And The Ethnic Church Context1614 Words   |  7 Pages â€Å"Counselling attempts to provide encouragement and guidance for those who are facing losses, decisions or disappointments. As a Christian counsellor we seek to bring people in to relationship with Christ and help them to find forgiveness and relief.† In this paper we will aim to analyse the Journal article written by Thomas G. Plante on Integration Spirituality and Psychotherapy: Ethical issue and Principles to consider. In this paper we will try to evaluate the article, understand how itRead MoreThe Doctrine Of The Divine Command Theory1488 Words   |  6 PagesIs the churches moral teaching of value only to Catholics or to everyone, and either way, why? Christian morality is centered on assessing the ethical implications of us as people. Who we ought and be, and what actions we ought to take or avoid based on an understanding of the scripture and relevant human experiences. I do not subscribe to the divine command theory (DCT) of ethics, as I believe you can have ethics without God. The DCT proposes that what is morally right is what God has commandedRead MoreThe Ethical Dilemma Of Performance Enhancing Drugs1005 Words   |  5 PagesEthical dilemmas often face a challenge on deciding what the right action to take is, and therefore are quite complex. Nevertheless, there are situations in which majority of individuals feel there is a clear acceptable choice. Specifically, the use of performance enhancing drugs through the public eye, are often not sanctioned as acceptable. With â€Å"the number of professional athletes using steroids [†¦] estimated to be fewer than 1%† (Petersen Kristensen, 2009). Throughout this paper the scenarioRead MorePersonal Reflection On My Personal Philosophy1329 Words   |  6 Pagesinfluenced my personal ethical development. By reflecting on my life experiences, I will explore how my upbringing, and my faith influenced my morals and values. This paper will also explore ethical issues in counseling, and ethical codes used to resolve the issues. In addition, this paper I will reflect how this course has changed me in certain aspects regarding ethics and legal obligations in counseling. Section I 1) Family influences My parents have definitely influenced the decisions I make. My parents

Wednesday, May 6, 2020

Defining Honor Free Essays

If I were to ask half a dozen people at random to tell me what they meant by the word â€Å"honor,† I think that I would probably receive very different answers. One of the reasons for this is that it often means different things in the minds of different people. For instance, we say that it was a great honor for Jim Smith to be elected captain of the football team; and then, on the other hand, we talk about a code of honor, — or the laws of honor. We will write a custom essay sample on Defining Honor or any similar topic only for you Order Now What does Jim Smith’s being captain of the eleven have to do with the laws of honor? What we mean, in the case of Jim, is that his election as captain shows that the other boys have confidence in his play, and therefore this position gives him a local reputation as a comparatively good player and leader. Now many people in the world have only this idea of honor; and, when they speak of holding their honor sacred above all else, they mean keeping their reputation good in the eyes of men. For this reason, they value any office or reward that adds to their reputation; and the more their reputation grows and the more distinction they earn, the more honorable they feels themselves to be. This was the idea of honor existing among the ancient heathen people before the Christian era. You know that, after the fall of the great Roman Empire, there was a period of about a thousand years, when the light of civilization went out in Europe, and the darkness of ignorance and barbarism took its place. During these dark days, there was much going on that was not better and sometimes even worse from a moral point of view than in the days of the Roman Empire; but, when the minds of men began to wake up again, their standards really had advanced further than the old heathen standards of life. A seed Christian principle had been germinating for all these years and finally blossomed out in the Age of Chivalry. This, as you know, was an assertion first of all that the notion that â€Å"Might makes Right† is false, although it had been almost universally believed to be true, in practice, before the coming of Christ. The orders of knighthood which arose in various parts of Europe were composed of men who made it their business to bring order out of confusion, — to kill the wild beasts that interfered with flocks and herds and made farming difficult, — to overpower and abolish the highwaymen and robbers who made traveling unsafe, — and to protect women and children in respect and security. These men bound themselves by solemn vows to keep certain laws which were necessary for carrying out their work, and their obligation or sense of responsibility to keep these laws they called their â€Å"Honor. † Hence a new conception of honor came into being, and their code of honor was the law according to which their conduct was judged among themselves. This is, of course, a very different idea of honor from that which consists of thinking that distinction before men is better worth having than anything else, and which therefore puts reputation above character. Anybody who compares these two ideas of honor can see that the one is only a counterfeit imitation of the other, and that there is not necessary connection between them at all; for a man may have character without reputation, and he may have reputation without character, for reputation may be either true or false; and, when true, it is in many cases because of the character underlying it. But many fine reputations of all sorts are the result of clever self-advertising, and this practice is one of the most destructive and degrading to character and true manliness. This is so because, when we seek reputation for its own sake, we are yielding to the temptation of vanity; and vanity is a weakness and disease of the soul. Everybody has temptations to overcome, and it is everybody’s business to know and work against his weaknesses; but, when our chief ambition in life fosters our weakness, and we deceive ourselves by giving the name of â€Å"honor† to that which weakens us, we can hardly expect to grow stronger as the years go by. The old knights had the right idea of honor, and there have been a great variety of orders of chivalry in different countries, such as those mentioned in the Boy Scout Manual; and the main idea in all of them was to hold up a standard of public service which would raise men above the habits and customs of selfish brutes and merely worldly men. There is another great distinction between these two conceptions of honor: when we think of our reputation as our honor we require spectators, for our reputation is what we are in the minds of other men; but the honor of character, which is our sacred obligation to keep the law of our code and to do our duty in God’s sight, is just as binding upon us when we are all alone, and therefore it must control our most private acts and secret thoughts. A little newsboy boarded a crowded car the other night with a very large bundle of papers, and the conductor, with coarse good-nature, tried to favor him by declining to take his fare, although of course he could not do this without cheating the railway. The boy looked at him with indignation and could not believe that he was the conductor. He went all through the car hunting for the real conductor to whom he could pay his fair. This little boy was richer than if he had had millions in bank in place of this high-minded feeling of honorable independence and of determination to fulfil all his obligations; and, if he remains true to this principle in all the phases of his life, he will accomplish far more than if he amassed millions, or became President of the United States. He will add to the joy and dignity of many other lives as well as his own; for, sooner or later, every human being finds out that without this loyalty to honor life cannot be happy, is — indeed, not worth living. But we must be careful to remember that, although this is such an important and central truth, we cannot expect every one to know about it; and therefore we cannot expect them to act accordingly. In this, as in all other such matters, we must be on our guard against feeling superior to those who have not had our advantages. Next to keeping our own obligations of honor is the duty of protecting the honor of all those with whom we have contact; — and especially of the weak and ignorant. The weak must be protected by whatever means is necessary and appropriate, and the ignorant may be taught if we go about it quietly and in a friendly spirit, without â€Å"laying down the law. † Of course, it is the duty of patrol leaders to see that all their boys understand as thoroughly as possible the nature of the obligations which they have taken upon themselves. It is also the duty of scouts to hand along whatever helpful knowledge they have to other scouts within reach of their friendship. But this holds good not only for boy scouts and their officers but for all men; and it cannot be done unless, in the first place, we ourselves try to practice what we teach and then teach it with a humble appreciation of the beauty or use of the subject, and without any vanity or conceit. There is no merit, but only privilege, — so great that it is difficult to estimate, — in teaching and being taught to understand and live by the deep and tested truths of life; and the more we learn, from obeying them, the more humbly grateful we shall be. How to cite Defining Honor, Essay examples

Thursday, April 30, 2020

The Psychological Reactions Caused by Relaxation and Arousal free essay sample

This study’s main reason is to explore the psychological reactions by the idea of relaxation and arousal. A total of thirty eight students t part in this experiment. This study followed a within subject design in witch the independent variables were the music, witch was playing in the start, the touch stimuli and the music, witch was playing in the end of the experiment. However the dependent variables were the galvanic skin response (GSR), the heart rate and the respiratory rate. The psychological reactions were measured by the biopac student lab package. Â  Participants A total of thirty eight students participated in this experiment. The experimenter used opportunity sampling and the subject were first year psychology undergraduate students from the University of Bradford. The participants were asked if they want to participate and their selection was based on their health. Design This experiment followed a within subject design. This study was having two types of variables. We will write a custom essay sample on The Psychological Reactions Caused by Relaxation and Arousal or any similar topic specifically for you Do Not WasteYour Time HIRE WRITER Only 13.90 / page The heart rate, the galvanic skin response (GSR) and the respiratory rate were the dependent variables. However the independent variables were the touch stimuli and the music that was played when the experiment was start and the music was played after the touch stimuli. Materials The biopac student lab package was used to measure the heart rate, the galvanic skin response (GSR) and the respiratory rate. Both participants heard the same music played from a cassette player. In both groups the experimenter measured the baseline after putting the cables of biopac on participants fingers to measure all the above. In this study has already been used two questioners. The first one was verbal and was asking general questions about the participants health and their consent to continue this experiment. The second one was a multiple choice questionnaire with also some short answer questions. It was asking the participants to describe their emotions during the experiment. The purpose of the firs questioner was to check if the participants were able to take part in this experiment. The second was testing if the participants feelings was linked with the results that were collected ,from the biopac student lab, after the experiment. Procedure In this study eight groups took part. The participant were having a seat in a computer desk in front of the screen witch was showing the measurements in the biopac system. They also were attached to the machines. The experimenter was put some Vaseline in the parts of the GSR and heart rate electrodes that was connected to the finger tips. The GSR electrodes was connected to a finger tip and the heart rate electrodes to the opposite one and the respiratory rate band was placed around the upper chest area. The participants were asked to complete a verbal questionnaire about their health and also asked if they want to participate in this experiment. This questionnaire was given before the experiment started. When the experiment started and the participants were connected to the machines they were asked from the experimenter if they feel comfortable. Also the experimenter gave some basic instructions and a brief description of the experiment. In the lab were two participants witch was seating in front of two screens. Were also two experimenters, one for each participant and some observers two of which were giving the touch stimuli. A peace of classical music was the start of this experiment. This music was playing for two minutes. When the song stop playing the experimenter asked from two people of whom were observing to touch the subjects by going behind the participants and placing their hands in participants shoulders and moving them to their hands. Through this way they were giving the touch stimuli. After that the second peace of music start playing for two more minute

Saturday, March 21, 2020

Portfolio Management Noble Group Limited

Portfolio Management Noble Group Limited Noble Group Limited currently stands as the marketing leader in operating global supply chain of industrial, agricultural and energy commodity products. This claim can be justified by the fact that Noble Group Limited has managed to position itself as the global leader in supply chain management in approximately two decades a factor that can be attributed to their â€Å"hand on† to business.Advertising We will write a custom report sample on Portfolio Management: Noble Group Limited specifically for you for only $16.05 $11/page Learn More It is noteworthy that Noble Group Limited specializes in production and distribution of raw materials from low cost production and adequacy areas to deficiency areas across the globe. Throughout the delivery chain, the company ensures that value is added at every stage of the supply chain. Additionally, the Noble Group limited also operates shipping activities, coal mining, Investment and risk management, structured trade finance, and agricultural produce crushing plants and mills especially in South American region. The Group boats of a large network of subsidiary operations in close to 38 different countries spread across five continents. In terms of career opportunities Noble Group is an employer to approximately 11, 000 personnel of at least 68 nationalities in diverse divisions across the globe (Noble group 2010; p54). Key operations of the group are carried out in Americas, Europe, Middle East, Africa, and Asia. Unmatched specialization of the group include areas of Agriculture, logistics, Energy, metals and minerals For a period of two decades, Noble Group limited has certainly grown into a global venture in various specialized areas with demonstrable capabilities supply and delivery of valuable commodities to the real world (Bloomberg businessWeek , 2011). Thanks to the Groups, realization that operating a successful global chain lies in building and owning real infrastructure that incl ude the sophisticated warehouses, real ports, as well as physical mines (Noble Group, 2011). It is also plausible that the company owns majority of the origination points, independently produce and process the raw materials and above all enjoy an interrupted control over the supply pipeline from the beginning to the end.Advertising Looking for report on business economics? Let's see if we can help you! Get your first paper with 15% OFF Learn More In fact, the increasing success of the Group lies in their ability to control and operate most of their infrastructure independently taking to consideration that this move has seen the Group build its businesses in an environment with increased Unification of major commodity producers. The Group’s success strategy lies in developing a diversified network of â€Å"asset-medium† supply pipelines, operated by qualified professions who posses specialized expertise and experience in the respective industry (Noble Group Limited, 2011). In fact, as per the current understanding of the Group’s executives it is through the asset-medium strategy that the Group has managed to secure long-term supply of vital commodity group. In other words, the Group’s ability to own, control and manage the necessary physical infrastructure required for the delivery of high quality raw materials dependably is attributable to the asset-medium strategy (Nobble Group, 2009; p 23). This means that owning the supply chain infrastructure has enabled the company to obtain and retain top business success secrecies unlike their competitors and as such the Group stands a better chance of act and respond to issues swiftly owing to first hand information (Noble Group, 2011). The Group’s logistic services plays a critical role in consolidating activities thus fulfilling key pipeline strategy by ensuring that the company enjoys smooth and dependable flow of various commodities from origination to the processing plants, mills and most importantly to industrial clients in manufacturing destination across the globe (Noble Group Limited, 2011). Businesses Noble Group limited is one of the limited companies globally that owns and operates diversified range of raw materials and natural resources that include but not limited to minerals, metals and ore such as aluminum, Ferro Alloys, steel and iron; agricultural produce such as sugar, cotton, soya beans; lean energy; fossil fuel; ship management; risk management and trade finance. The Group boasts of its wide array of product and service segment as its main risk management strategy considering that all the segments operates in different environments under different professionals and as such experience different risks (Nobble Group, 2010; p 51).Advertising We will write a custom report sample on Portfolio Management: Noble Group Limited specifically for you for only $16.05 $11/page Learn More It is obvious tha t specialization in a single area of business is highly risky considering that a particular peril whether artificial or natural can lead into loses or closure of the entire business. Noble Group limited is cushioned from such risks considering that it has invested in more than a single segment-agribusiness, mineral, logistics, metal, and energy. Another critical area of success in Noble group involves constant innovation and invention with the objective of increasing efficiency and exceeding customer expectations thus profitable business for all players (Nobble Group, 2009; p 45). For instance employing innovative technologies in chattering and ship management complimented with best practices in trade finance has propelled organization growth considerably. Agriculture Segment Noble Group’s Agriculture segment include but not limited to cocoa, grain, cotton, coffee, sugar, sugar mills and fertilizer (businessWeek , 2011). Presently Noble Coffee stands as one of the leading tra ded coffee across the globe with respect to volume owing to the fact that the company trade in various types and grades of coffees grown in various parts of the world. The Group started with trading Robusta coffee in 2002 in Vietnam which followed by trading Arabica from the United States. Since then the company has established itself as a specialized trader in coffee by establishing sourcing destinations from various parts of the universe that include Brazil, Indonesia, Colombia, India, as these destinations provides direct access to the large pool of the global coffee production. Nobble Group (2011; p36), The company does not only source for coffee but also handles other value chain operations related to green coffee ranging from processing, marketing, warehousing, shipping, quality control, and financing. The group also takes advantage of the diversification of location and quality of coffee to come up with competitive pricing strategies for their various markets worldwide (Peavl er, 2009). Headquarter of cotton operation is in Singapore. However, subsidiary offices and representations are based in major consuming and source markets across the globe. The Group handles all its major source of cotton besides maintaining a relatively high quality control measures in each area (Siddiqui, 2006). The Group is sourcing vast volume of its cotton from West Africa, India, United States, Central Asia, and Brazil. Its major consumers on the other hand include North and Southeast Asia, China, and Turkey (Noble Group, 2011).Advertising Looking for report on business economics? Let's see if we can help you! Get your first paper with 15% OFF Learn More It is noteworthy that the Groups success in the cotton business and other segment is based on building effective relationship with the clients as any organization that seeks competitive advantage must understand its producing and consuming clients very well. The Group has headquartered its fertilizer business in Brazil where the company specializes in operating fertilizer-blending facility in Mato Grosso. However, the group has established its fertilizer warehouse in Paranagua. The Group has built a state of art facility in Mato Grosso with the storage capacity of 2000 metric tons of bended fertilizer and 4000 metric tons of raw materials (Noble Group, 2011). Additionally the facility is strategically located in the sense that it allows the company to deliver products directly to the farmers in remote areas without complexity. Noble Group has established its grains and oilseed operations in Europe, Asia and south America owing to the productivity in such areas. Noble Group’s grains and oilseed operations are centered in China as it currently operates three facilities in the region with its base in Shanghai (Brigham Daves, 2009). The Headquarter in Singapore also plays a significant role in marketing of grains, oilseeds and vegetables in the Asian market region. In Europe grain operations are based in Turkey which is presently the largest importer of oilseeds and grains; Russia which operates warehouses as well as export of grains and finally Italy which is responsible for trading grains in central Europe (Drake, 2005). In South America Noble boast of large network of warehouses and elevators in Uruguay, Brazil, Paraguay, and Argentina as they play a critical role in sourcing of produce directly from the farmers and afterward delivery to various facilities. Noble Group started its sugar business in 2001and presently it accounts for a vast portion of the agricultural segment revenue. The Group engages in wide range of activities in the sugar business tha t include but not limited to shipping, risk management, sourcing cane, logistics, trading, distribution and refining of raw sugar in different countries ranging from Brazil, South Africa, Russia, India, Central America, Thailand and Europe (Nobble Group, 2011; p40). Key consumer markets include Middle East, Egypt and Russia. The company also use sugar canes to produce ethanol however not in very large quantity as the process are still underway for large-scale production. Noble Group Limited started its Agribusiness in 1998 with Cocoa as one of its main produce (Noble Group, 2011). Currently the company has a number of established sources of Cocoa especially in Africa ranging from Cà ´te dIvoire, Ecuador, Ghana, Cameroon, Sierra Leone, Indonesia, Nigeria and Togo. Key consumers of the Cocoa produce include global manufacturers of chocolate and cocoa processors. Logistics segment The present increase in the Groups revenue levels is attributable to the growth of the Chattering Divisio n, compounded persistent demand within and from third parties customers in need of dry bulk vessels. To ensure that the Groups effectively utilize the upsurge demand in vessels the organization decided to reorganize its freight chattering activities, which led to setting up a single business desk responsible for handling all internal requirements(Brigham Daves, 2009; p276). Through the reorganization, the company managed to effectively share vital market data among the commodities divisions as well as the logistics operations. Increased revenue levels were also attributable to the rising freight prices experienced in large shipping sector (Nobble Group, 2011; p51). For instance, the growing tendency of emerging markets to source for commodities from distant resource regions results into longer miles per ton and consequently higher freight rates. The Energy segment Noble Group limited is a renowned supplier of various forms of energy ranging from lean energy, fossil fuel, coal, and petrochemicals (Noble Group, 2011). The group also trade in emission reduction certificates large know as â€Å"carbon credit† and presently its one of the largest suppliers of the CERs. The Group has also facilitated dependable supply of thermal and cooking coal as well as coke products to various global markets. Key coal production assets established in Australia and Indonesia, and vital source include South Africa, Russia, and China through a sophisticated supply chain management network which ensures that coal is delivered to the doorstep of the clients from mines and other industrial origins efficiently (Nobble Group, 2011; p44). Noble Group has also specialized in the production of clean fuel through its Clean Fuel Departments. This effective team receives adequate support from the storage and transportation divisions to ensure that they continually supply various market with a wide range of clean energy that include liquid natural gas, bio fuel and fuel oil. Trading ar eas for the clean energy include markets such as Europe, Latin America, United States, South America, and much important India and China (Noble Group Limited, 2011). The Group is receiving considerable amount of energy from this sector taking into consideration move by every country to reduce greenhouse emission with environmentally friendly fuel and the volatile oil prices, which keeps on skyrocketing day by day. Apart from the lean fuel and coal the group also trade in fossil fuel which include oil and petrochemicals. Financial Ratio Analysis of Noble Group Limited Financial ratios are often calculated from the data reported in the company’s statement of financial position and the income statement for a specified financial period (Brigham Daves, 2009; p276). For instance, in order to calculate the â€Å"gross profit margin† them an individual has to divide the â€Å"gross profit† by total sales or revenue from the respective trading period and expressed as a percentage. Financial ratios significant information for decision makers, investors and regulators in a number of ways. For instance, an investor may use financial ratios to decide whether to invest in the company or not same to a financial analyst who require financial rations to issue opinion of the company situation and likely trends in the future treading. The management also need ratios to compare their performance in relation to industry performance and their competitors too. In fact financial rations gains utility when they are compared to other standards and data. For instance, by simply knowing that your company gross profit margin is 25% of no help unless you compare it to another company’s gross profit margin, which stands at 18% as this means that, we are doing fine relative to our core competitor. Profitability ratio Ratio Formula 2010 US$’000 2009 US$’000 2008 US$’000 Gross profit margin Gross Profit * 100% Revenue 1,632,066 * 100% 56,6 96,058 =2.88% 1,105,046 * 100% 31,183,114=3.54% 1,347,598 * 100% 36,090,161=3.73% Return on equity (ROE) Net Income Owners equity 607,049 * 100% 4,431,189 =13.7% 555,130 * 100% 3,038,194 =18.3% 579,738 * 100% 1,860,868 =31.1% Profitability ratios are ratios used to show a firms overall performance and efficiency. Two important categories of profitability ratios are available for use by company to prove organizations efficiency and they include â€Å"margin and return†. According to Peavler (2009), Margins are used to indicate the extent to which an organization can utilize the sales dollars to provide profits for the organization. Return on the other hand represents organizations ability to provide adequate returns for the investors (Drake, 2005; p7). For instance, gross profit margin is ratio that indicates the percentage of the costs of sales relative to sales. A higher percentage of the Gross Profit Margin is always better for the company as it represents the ability of the company to control its costs of sales-inventory and production costs (Peavler, 2009). Return on equity is a significant ratio for the investors in the sense that it measures return from the money injected into the business by the owners. References Bloomberg businessWeek. (2011). Company Description. Retrieved from: http://investing.businessweek.com/research/stocks/snapshot/snapshot_article.asp?ticker=NOBL:SP Brigham, E. Daves, P. (2009). Intermediate Financial Management. California: Cengage Learning. Drake, P. (2005). Financial Ratio Analysis. Retrieved from: http://educ.jmu.edu/~drakepp/principles/module2/fin_rat.pdf Nobble Group limited. (2009). Noble Group Annual Report 2008. Retrieved from: thisisnoble.com/images/documents/noble_ar2008.pdf Nobble Group limited. (2010). Noble Group Annual Report 2009. Retrieved from: thisisnoble.com/images/documents/noble_ar2009.pdf Nobble Group limited. (2011). Noble Group Annual Report 2011. Retrieved from: thisisnoble.com/images/docu ments/noble_ar2010.pdf Noble Group Limited. (2011). Asset Strategy. Retrieved from: thisisnoble.com/index.php?option=com_contentview=articleid=637Itemid=471 Noble Group Limited. (2011). Products. Retrieved from: thisisnoble.com/index.php?option=com_contentview=articleid=45Itemid=58 Peavler, R. (2009). Use Profitability Ratios in Financial Ratio Analysis: Determining Profitability is Important to Company Investors. Retrieved from: http://bizfinance.about.com/od/financialratios/a/Profitability_Ratios.htm Siddiqui, S. (2006). Managerial Economics And Financial Analysis. Iowa: New Age International.

Thursday, March 5, 2020

When to Capitalize Words for Points of the Compass

When to Capitalize Words for Points of the Compass When to Capitalize Words for Points of the Compass When to Capitalize Words for Points of the Compass By Mark Nichol When should you write north, and when is North appropriate? How about southern, or Southern? This post outlines the recommendations for when to use uppercase letters for words referring to cardinal directions, and when to employ lowercase letters. Many geographical designations include north, south, east, or west, or combined forms such as northwest, as part of their names. When these are official locations labeled on maps, they are always styled with initial capitalization (unless, of course, the map styles some or all labels with all uppercase letters). Examples include â€Å"North America,† â€Å"South Africa,† â€Å"West Virginia,† and â€Å"East St. Louis.† However, references in narrative text (fiction or nonfiction) are not always straightforward. Here are some guidelines: The belligerents in the American Civil War are sometimes identified as â€Å"the North† and â€Å"the South,† but a reference to an occupant of the corresponding region would be treated as northerner or southerner, and general references to a location to one direction or another from a given location are properly lowercase (â€Å"I drove west for ten miles†; â€Å"Attitudes in the eastern part of the state are more traditional†). However, cultural references are treated as proper names, as in a comment alluding to the relative homogeneity of North America and Europe or the corresponding mind-set of Asia: â€Å"In the West, medical treatment tends to be allopathic†; â€Å"It is among the oldest of the Eastern philosophies.† Confusingly, some unofficial regional designations with longstanding distinctions, such as â€Å"Northern California† and â€Å"the South of France,† are capitalized, while such simple descriptions as â€Å"western New York State† and â€Å"southern Africa† (as opposed to the name of the nation of South Africa) are treated generically. As the name of the genre in various media that pertains to the settling of the United States beyond the Mississippi River, western is not capitalized. However, by convention, the first word in â€Å"Eastern Europe† is capitalized in a Cold War context. Meanwhile, a midwesterner is from the Midwest. Because of the unpredictability and inconsistency of treatment of such words, it’s best for writers to consult a geographically oriented resource; exhaustive (and exhausting) lists of examples are widely available online and in print. Want to improve your English in five minutes a day? Get a subscription and start receiving our writing tips and exercises daily! Keep learning! Browse the Style category, check our popular posts, or choose a related post below:Definitely use "the" or "a"A While vs AwhilePassed vs Past

Monday, February 17, 2020

Deduction vs. Induction Essay Example | Topics and Well Written Essays - 500 words

Deduction vs. Induction - Essay Example On the other hand, an inductive argument is an argument in which the premises are expected to support the conclusion such that if the premises were to be true (which is an assumption of the arguer), it is merely improbable that the conclusion could be false in that case. Therefore, instead of there being a necessary connection between premises and conclusion, as there is in the case of the deductive argument, the connection between premises and conclusion in the inductive argument is probabilistic. In the example given, it is possible for the conclusion to be false, even if all three of the premises are true. In other words, it is possible for an argument that lacks deductive validity to be inductively valid. For instance, perhaps Newton lost his taste for tea after being struck on the head with an apple, which, according to the story, he was drinking on that occasion. Although inductive inferences may be uncertain, they are probable. That is, it is very probable that Isaac Newton liked tea. However, it is not certain based solely from the evidence given in P1-P3. Moreover, unlike deductive arguments, inductive inferences give us more information than what is contained in the premises. Careful use of inductive arguments is necessary for any field of research outside of those that rely on basic truths and assumptions. In the argument given, both of the premises are true. Consequently, it is simply not possible for the conclusion to be false. If the deductive argument has all true premises, and a false conclusion, then an error has been made and the argument lacks deductive validity. Conversely, one cannot accept the truth of the premises without accepting the truth of the conclusion. The relationship between the premises and the inference is that the conclusion cannot be false if the premises are true. Even if the premises might not actually be true, the relationship between the premises and the conclusion does not change, and even if the evidence for the

Monday, February 3, 2020

Citibank,NA. Citigroup Essay Example | Topics and Well Written Essays - 1500 words

Citibank,NA. Citigroup - Essay Example The bank also offers various other services to individual consumers and small businesses enterprises, such as credit cards, deposit accounts and loans. This paper presents an analysis of the strengths, weaknesses, threats and opportunities of Citibank. It would be useful in gaining important insights into the current status of the company and its future performance. It would also help in identifying the potential customers and suppliers and understand the company’s business structure, its major products and the company’s operations (Ferrel and Hartline 124). Strengths Global strength Strong brand name Citibank is a subsidiary of the Citigroup, Inc. The company operates all over the world in 44 countries in four continents. Citibank has a strong brand name. Brand name of a company is considered as a precious asset. The brand name of the company captures various dimensions of the business. It encapsulates its mission, vision, corporate values and personality (â€Å"A str ong brand†). There are a number of benefits that a company enjoys form its brand name. Citibank exploits its corporate brand in order to improve its performance in the near future. Firstly, a strong brand name acts like the face of the business organization. High brand value portrays the short term aims of the corporation and reveals the position that the company targets to achieve in the international market. Corporate brand acts as an envelope or umbrella for the activities of the corporation. Citibank maintains a common company branding strategy all over the world, which helps the company to maintain a common expression (Roll, â€Å"Benefits of the Corporate Brand†). Good financial position The world has not yet recovered from the impacts of the 2008 financial crisis of the last decade and many financial institutions are facing the problem of instability. Due to robust financial infrastructure of the bank, Citibank has not been affected to a great extent during the f inancial crunch faced by the global market. The company enjoys a strong financial base, which is one of the major strongholds in the current period. Wide customer base The company operates all over the globe. It has its branches in the North American and Latin American countries, Asia, Europe, Middle East and the African countries. Due to such vast expanse of operations, Citibank enjoys a wide customer base. This reduces the risk factor for the organization. Infrastructure Retail banking operations in 44 countries Citibank makes strong retail banking operations in 44 countries in the world. It has a strong infrastructure that helps the company to operate successfully in the global platform. It helps the organization to serve the small scale businesses and the individual investors in these countries. It enables the company to reach a larger customer base and further strengthens its operations. Online services provides to millions of customers Citibank has a user friendly website that offers updated information regarding the products and services offered by the company. The website also allows customers to communicate with the bank with regard to their enquiries as well as accessing various services offered by the bank. The bank has different portals through which the customers

Sunday, January 26, 2020

Pollution Associated With Oil And Gas Production Environmental Sciences Essay

Pollution Associated With Oil And Gas Production Environmental Sciences Essay 1.1.1 Oil and gas production generally generates massive wealth for countries and contributes to the socio-economic development in the areas of foreign exchange earnings, provision of job opportunities, improved infrastructure, water supply, sewerage and waste treatment, health care and education, among others. Despite these economic and social benefits associated with the oil and gas industry, the exploitation of oil and gas reserves has not always been without some ecological side effects. Oil spills, damaged land, accidents and fires, and incidents of air and water pollution have all been recorded at various times and places. 1.1.2 The discussions that follow will seek to highlight the pollution associated with the various stages of the oil and gas production; and will discuss the wide range of approaches used by governments across the globe to regulate the attendant impact and pollution to the ecosystem. The discussion will also suggest an appropriate strategy to be adopted by the industry in order to achieve its overall goal of finding the right mix of regulatory, co-regulatory, incentives and voluntary mechanisms to meet the challenge of world energy demands, whilst minimising adverse impact on the environment by conforming to current good practice. The environmental impacts of the activities of the oil and gas industry exploration and exploitation, refining and products marketing have been of concern to government regulatory agencies, oil companies operators as well as the host communities. The potential for extensive and irreversible environmental and social damage from oil development projects is particularly acute in developing countries with inadequate regulatory frameworks or weak environmental and social legislation. The impacts of oil and gas operations generally occur in the form of human, socio-economic and cultural impacts, atmospheric impacts, aquatic and terrestrial impacts. Human, socio-economic and cultural impacts may include changes in land-use patterns, such as agriculture, fishing and hunting as direct consequence (for example, land-take and exclusion) or as a secondary consequence in the form of new access routes, leading to unplanned settlement and exploitation of natural resources. The impact could also result in changes in aesthetics because of unsightly or noisy facilities. It has been reported that in some places where oil is discovered, the economy develops rapidly, but it is an economy of misery.    Poorly built oil camps are carved out of the landscape and bring with them many social problems, such as forced displacement, alcoholism, sexually transmitted infections, and HIV/AIDs. Oil companies and governments regularly wash their hands of the communities mostly damaged by the oil development. In most instances, these communities are left on their own to try to determine how much and what kinds of harm the oil and gas industry has caused, and to search for ways to restore their communitys health. Protests by communities, often confrontational in nature, are the most eloquent testimonies of the resistance to the general pollution of the environment by the activities of oil companies. For example, in 1995, proposals by Shell to dispose of the Brent Spar oil storage facility provoked an extensive campaign of protests by activists from Greenpeace aimed at stopping Shell from dumping the Brent Spar in the North Sea. Spontaneous protests in support of Greenpeace and against Shell broke out across Europe, and eventually resulted in Shells eventual abandonment of plans to dump it deep in the Atlantic., Atmospheric pollution results from flaring, venting, and purging gases, fugitive gases from loading operations and tankage and losses from process equipment, combustion processes such as diesel engines and gas turbines. The main emission gases include carbon dioxide, carbon monoxide, methane, volatile organic carbons and nitrogen oxides. Gas flaring exposes workers, communities, and wildlife to pollution with various health effects. The flares pollute the clouds, causing a black rain that poisons water sources. The Niger Delta in Nigeria is a typical example of a region adversely affected by the impact of oil and gas exploration and production. Pervasive gas flaring is one of the key factors that have worsened the environment of the Niger Delta, attracting concern from the international community. It has been reported that Nigeria has the Worlds highest level of gas flaring and flares about 16 per cent of the worlds associated gas. Aquatic pollution result from production water, spills and leakages, cooling water, process, wash and drainage water, drilling fluids, and chemicals used for well treatment. Oil is often spilled during transport through pipelines, trucks, and ships. When oil spills, it pollutes groundwater and waterways, harms plants and animals, and causes damage that may last for years to resources for hunting, fishing, and farming. Even once the oil appears to have dissipated, it can still lurk beneath the surface of beaches and the sea bed, severely affecting marine organisms that burrow, such as crabs, for literally decades. These burrowing creatures are also food for other animals, so the cycle of poisoning continues for many years. In addition to the impact on marine life, oil spills have a direct impact on humans too long after the initial media frenzy has died down. For example, some Alaskan communities were affected by the Exxon Valdez disaster of 1989 as important commercial fishing and hunting grounds were contaminated for an extended period. Tourism was also affected. Oil and gas operations also have potential impacts on vegetation and soils resulting from deforestation, disturbance due to construction activities, indirect impact due to social change and contamination resulting from spillage and leakage or solid waste disposal. During the course of exploration oil, forests are cut down and homes are destroyed. Roads are built, and streams and rivers are blocked up. Seismic testing damages homes, wildlife, and the land.    Oil drilling can cause fires, explosions, and other accidents that endanger workers and the community. For example, in 1988, the offshore platform Piper Alpha, which was located in the British sector of the North Sea oil field and operated by Occidental Petroleum, was engulfed in a catastrophic fire and resulted in the loss of 167 lives, costing billions of dollars in property damage, and the shutting down of approximately 10% of total UK gas production. The dumping of toxic water is also a major cause of pollution. Laws about drilling in wealthy countries require the toxic water to be put back into the ground rather than dumped on the surface.   Oil companies often do nothing more than dig a hole and dump in crude oil, drilling wastes, toxic water, and other wastes leading to the contamination of groundwater and land. Pollution at the refining stage results from refineries releasing toxic waste into water, soil, and air and this leads to various health risks. This pollution also adds to global warming. The decommissioning phase of oil and gas production, if unchecked, can also present environmental problems by the disposal of oil platforms into deep waters. The end result could be hundreds of rusting platforms, obsolete subsea infrastructure and disused pipelines running all the way to land. It is important to point out here that the impact on the environment of oil and gas exploration and production operations depends on the stage of the process, the size and complexity of the project, the nature and sensitivity of the surrounding environment, the effectiveness of the planning, pollution prevention, and mitigation control techniques. While some of these impacts can be said to be the result of unpredictable acts of God, the occurrence of some of these potentially devastating impacts often result from accumulation of errors and questionable decisions, most of which are rooted in the organization, its structure, procedures, and culture. These organizational factors include flaws in the design guidelines and design practices, misguided priorities in the management of the trade-off between productivity and safety, mistakes in the management of the personnel on board, and errors of judgment in the process by which financial pressures are applied on the production sector resulting in deficiencies in inspection and maintenance operations. The Piper Alpha accident of 1988 is one of the cases that can hardly be attributed to an act of God: gross human error greatly contributed to this accident. Notwithstanding the fact that the coincidence of the final events that triggered the catastrophe was not in itself controllable, the failure resulted essentially from an accumulation of management errors. In November 1990, Lord Cullens report into the disaster severely criticised safety procedures on the rig owned by Occidental Oil. The immediate cause of the disaster was a failure in the permit to work system which caused a breakdown in communications between the day shift and the night shift. This led to the use of machinery which was undergoing maintenance and caused the escape of gas from an insecurely fastened temporary flange. Thereafter, there appeared to be a series of failures and errors of judgment which contributed to the overall scale of the disaster. In the case of the Exxon Valdez oil spill of 1998, the US National Transportation Safety Board ruled that drinking by the ships captain, a fatigued and overworked crew and inadequate traffic control by the Coast Guard all contributed to the enormous oil spill by the Exxon Valdez off the Alaskan coast in 1989. In another instance, the final Report by the Commission set up by US President Barack Obama to investigate the cause of the recent BP Deepwater Horizon oil rig explosion on 20 April 2010 in which 11 workers were killed and led to an estimated four million barrels of oil gushing into the Gulf of Mexico (the National Oil Spill Commission) concluded, among others, that the explosive loss of the Macondo well could have been prevented ; and that the immediate causes of the Macondo well blowout can be traced to a series of identifiable mistakes made by BP, Halliburton, and Transocean that reveal such systematic failures in risk management that they place in doubt the safety culture of the entire industry.

Saturday, January 18, 2020

Object Oriented Programming in Different Languages

OOP with Microsoft Visual Basic . NET and Microsoft Visual C# Step by Step by Robin A. Reynolds-Haertle Microsoft Press  © 2002 (393 pages) ISBN: 0735615683 This intuitive, self-paced learning title is designed to help you master the basics of object-oriented programming with Visual Basic. NET or Visual C#. Table of Contents OOP with Microsoft Visual Basic . NET and Microsoft Visual C# . NET Step by Step Introduction Chapter 1 – Writing Your First Object-Oriented Program Chapter 2 – Creating Class Instances with Constructors Chapter 3 – Creating Fields and PropertiesChapter 4 – Working with Methods Chapter 5 – Using Inheritance to Create Specialized Classes Chapter 6 – Designing Base Classes as Abstract Classes Chapter 7 – Responding to Changes with Events and Exceptions Chapter 8 – Putting It All Together with Components Chapter 9 – Providing Services Using Interfaces Chapter 10 – Using Classes Interchangeably T hrough Polymorphism Chapter 11 – Using Shared and Static Members Chapter 12 – Overloading Operators with Visual C# Chapter 13 – Saving Instance Data Chapter 14 – Reducing Complexity by DesignAppendix – Additional Resources Index Height Gage List of Sidebars OOP with Microsoft Visual Basic . NET and Microsoft Visual C# . NET Step by Step PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright  © 2002 by Robin A. Reynolds-Haertle All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Cataloging-in-Publication Data Reynolds-Haertle, Robin A. , 1959-OOP with Microsoft Visual Basic . NET and Microsoft Visual C# Step by Step / Robin A. Reynolds-Haertle. p. cm. Includes bibliographical references and index. ISBN 0-7356-1568-3 1. Object-oriented programming (Computer science). 2. Microsoft Visual BASIC. 3. C# (Computer program language) I. Title. QA76. 64 . R495 2001 005. 2’768—dc21 2001052122 Printed and bound in the United States of America. 1 2 3 4 5 6 7 8 9 QWT 7 6 5 4 3 2 Distributed in Canada by Penguin Books Canada Limited. A CIP catalogue record for this book is available from the British Library.Microsoft Press books are available through booksellers and distributors worldwide. For further information about international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly at fax (425) 936-7329. Visit our Web site at www. microsoft. com/mspress. Send comments to: [email  protected] com. IntelliSense, Microsoft, Microsoft Press, Visual Basic, Visual C#, Visual Studio, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.Other product and company names mentioned herein may be the trad emarks of their respective owners. The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Acquisitions Editor: Danielle Bird Project Editor: Kathleen AtkinsTechnical Editor: Jack Beaudry Body Part No. X08-42192 MICROSOFT LICENSE AGREEMENT Book Companion CD IMPORTANT—READ CAREFULLY:This Microsoft End-User License Agreement (â€Å"EULA†) is a legal agreement between you (either an individual or an entity) and Microsoft Corporation for the Microsoft product identified above, which includes computer software and may include associated media, printed materials, and â€Å"online† or electronic documentation (â€Å"SOFTWARE PRODUCT†).Any component included within the SOFTWARE PRODUCT that is accompanied by a separate End -User License Agreement shall be governed by such agreement and not the terms set forth below. By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, you are not authorized to install, copy, or otherwise use the SOFTWARE PRODUCT; you may, however, return the SOFTWARE PRODUCT, along with all printed materials and other items that orm a part of the Microsoft product that includes the SOFTWARE PRODUCT, to the place you obtained them for a full refund. Software PRODUCT LICENSE The SOFTWARE PRODUCT is protected by United States copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold. 1. GRANT OF LICENSE. This EULA grants you the following rights: a. Software Product. You may install and use one copy of the SOFTWARE PRODUCT on a single computer.The primary user of the computer on which th e SOFTWARE PRODUCT is installed may make a second copy for his or her exclusive use on a portable computer. b. Storage/Network Use. You may also store or install a copy of the SOFTWARE PRODUCT on a storage device, such as a network server, used only to install or run the SOFTWARE PRODUCT on your other computers over an internal network; however, you must acquire and dedicate a license for each separate computer on which the SOFTWARE PRODUCT is installed or run from the storage device.A license for the SOFTWARE PRODUCT may not be shared or used concurrently on different computers. c. License Pak. If you have acquired this EULA in a Microsoft License Pak, you may make the number of additional copies of the computer software portion of the SOFTWARE PRODUCT authorized on the printed copy of this EULA, and you may use each copy in the manner specified above. You are also entitled to make a corresponding number of secondary copies for portable computer use as specified above. . Sample Cod e. Solely with respect to portions, if any, of the SOFTWARE PRODUCT that are identified within the SOFTWARE PRODUCT as sample code (the â€Å"SAMPLE CODE†): i. Use and Modification. Microsoft grants you the right to use and modify the source code version of the SAMPLE CODE, provided you comply with subsection (d)(iii) below. You may not distribute the SAMPLE CODE, or any modified version of the SAMPLE CODE, in source code form. ii. Redistributable Files.Provided you comply with subsection (d)(iii) below, Microsoft grants you a nonexclusive, royalty-free right to reproduce and distribute the object code version of the SAMPLE CODE and of any modified SAMPLE CODE, other than SAMPLE CODE, or any modified version thereof, designated as not redistributable in the Readme file that forms a part of the SOFTWARE PRODUCT (the â€Å"Non-Redistributable Sample Code†). All SAMPLE CODE other than the Non-Redistributable Sample Code is collectively referred to as the â€Å"REDISTRIBU TABLES. † iii. Redistribution Requirements.If you redistribute the REDISTRIBUTABLES, you agree to: (i) distribute the REDISTRIBUTABLES in object code form only in conjunction with and as a part of your software application product; (ii) not use Microsoft’s name, logo, or trademarks to market your software application product; (iii) include a valid copyright notice on your software application product; (iv) indemnify, hold harmless, and defend Microsoft from and against any claims or lawsuits, including attorney’s fees, that arise or result from the use or distribution of your software application product; and (v) not permit further distribution of the REDISTR IBUTABLES by your end user. Contact Microsoft for the applicable royalties due and other licensing terms for all other uses and/or distribution of the REDISTRIBUTABLES. 2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS. †¢ Limitations on Reverse Engineering, Decompilation, and Disassembly. You may not reve rse engineer, decompile, or disassemble the SOFTWARE PRODUCT, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. †¢ Separation of Components. The SOFTWARE PRODUCT is licensed as a single product.Its component parts may not be separated for use on more than one computer. †¢ Rental. You may not rent, lease, or lend the SOFTWARE PRODUCT. †¢ Support Services. Microsoft may, but is not obligated to, provide you with support services related to the SOFTWARE PRODUCT (â€Å"Support Services†). Use of Support Services is governed by the Microsoft policies and programs described in the user manual, in â€Å"online† documentation, and/or in other Microsoft-provided materials. Any supplemental software code provided to you as part of the Support Services shall be considered part of the SOFTWARE PRODUCT and subject to the terms and conditions of this EULA.With respect to technical information you provide to Microsoft as part of the Support Services, Microsoft may use such information for its business purposes, including for product support and development. Microsoft will not utilize such technical information in a form that personally identifies you. †¢ Software Transfer. You may permanently transfer all of your rights under this EULA, provided you retain no copies, you transfer all of the SOFTWARE PRODUCT (including all component parts, the media and printed materials, any upgrades, this EULA, and, if applicable, the Certificate of Authenticity), and the recipient agrees to the terms of this EULA. †¢ Termination.Without prejudice to any other rights, Microsoft may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the SOFTWARE PRODUCT and all of its component parts. 3. COPYRIGHT. All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, photogr aphs, animations, video, audio, music, text, SAMPLE CODE, REDISTRIBUTABLES, and â€Å"applets† incorporated into the SOFTWARE PRODUCT) and any copies of the SOFTWARE PRODUCT are owned by Microsoft or its suppliers. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, ou must treat the SOFTWARE PRODUCT like any other copyrighted material except that you may install the SOFTWARE PRODUCT on a single computer provided you keep the original solely for backup or archival purposes. You may not copy the printed materials accompanying the SOFTWARE PRODUCT. 4. U. S. GOVERNMENT RESTRICTED RIGHTS. The SOFTWARE PRODUCT and documentation are provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252. 27-7013 or subparagraphs (c)(1) and (2) of the Commercial Computer Software Restricted Rights at 48 CFR 52. 227-19, as applicable. Manufacturer is Microsoft Corporation/One Microsoft Way/Redmond, WA 98052-6399. 5. EXPORT RESTRICTIONS. You agree that you will not export or re-export the SOFTWARE PRODUCT, any part thereof, or any process or service that is the direct product of the SOFTWARE PRODUCT (the foregoing collectively referred to as the â€Å"Restricted Components†), to any country, person, entity, or end user subject to U. S. export restrictions. You specifically agree not to export or re-export any of the Restricted Components (i) to any country to which the U. S. as embargoed or restricted the export of goods or services, which currently include, but are not necessarily limited to, Cuba, Iran, Iraq, Libya, North Korea, Sudan, and Syria, or to any national of any such country, wherever located, who intends to transmit or transport the Restricted Components back to such country; (ii) to any end user who you know or have reason to know will ut ilize the Restricted Components in the design, development, or production of nuclear, chemical, or biological weapons; or (iii) to any end user who has been prohibited from participating in U. S. export transactions by any federal agency of the U. S. government. You warrant and represent that neither the BXA nor any other U. S. ederal agency has suspended, revoked, or denied your export privileges. DISCLAIMER OF WARRANTY NO WARRANTIES OR CONDITIONS. MICROSOFT EXPRESSLY DISCLAIMS ANY WARRANTY OR CONDITION FOR THE SOFTWARE PRODUCT. THE SOFTWARE PRODUCT AND ANY RELATED DOCUMENTATION are PROVIDED â€Å"AS IS† WITHOUT WARRANTY OR CONDITION OF ANY KIND, EITHE R EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE PRODUCT REMAINS WITH YOU. LIMITATION OF LIABILITY.TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL MICROSOFT OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE PRODUCT OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF MICROSOFT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY CASE, MICROSOFT’S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS EULA SHALL BE LIMITED TO THE GREATER OF THE AMOUNT ACTUALLY PAID BY YOU FOR THE SOFTWARE PRODUCT OR US$5. 00; PROVIDED, HOWEVER, IF YOU HAVE ENTERED INTO A MICROSOFT SUPPORT SERVICES AGREEMENT, MICROSOFT’S ENTIRE LIABILITY REGARDING SUPPORT SERVICES SHALL BE GOVERNED BY THE TERMS OF THAT AGREEMENT.BECAUSE SOME STATES AND JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY, THE ABOVE LIMITATION MAY NOT APPLY TO YOU. MISCELLAN EOUS This EULA is governed by the laws of the State of Washington USA, except and only to the extent that applicable law mandates governing law of a different jurisdiction. Should you have any questions concerning this EULA, or if you desire to contact Microsoft for any reason, please contact the Microsoft subsidiary serving your country, or write: Microsoft Sales Information Center/One Microsoft Way/Redmond, WA 98052- 6399. PN 097-0002296 For Bruce You’re still the one.About the Author Robin A. Reynolds-Haertle Robin’s interest in computing began when she taught herself to program in C to fulfill a programming language requirement for her master’s degree in biomathematics at the University of Washington. Fascinated by the subject, Robin attended as many computer science classes as her schedule would permit, and took a position as a programmer with the University of Washington after graduation. Robin spent several years in the biotechnology industry, writing dat a applications in various database management systems, C, and Microsoft Visual Basic.Not content to just read computer science and software engineering books, she then pursued and completed a master’s degree in software engineering at Seattle University. During these years, Robin presented training sessions on software engineering topics to her peers. After so many years in the classroom, Robin wanted to try teaching, and jumped at the opportunity to teach object- oriented programming with Visual Basic for the University of Washington Outreach program. Here she discovered she loved writing instructional materials and sample projects for her students. This led Robin to her current position as a programmer/writer at Microsoft, writing conceptual documentation for Visual Basic and Microsoft Visual C#.When not at the computer, Robin is trying to make peace with her abandoned husband and sons. After she completes this book, they look forward to Mom’s attention to Cub Scouts , Boy Scouts, hiking, and watching BattleBots. After catching up with the family, Robin hopes to sew a few quilts. Acknowledgments First I’d like to thank the team at Microsoft Press that turned my writing into a book. Without Jack Beaudry, the technical editor, I never would have gotten any sleep. His meticulous reviews saved me time and saved readers from much frustration. Kathleen Atkins, the project editor, kept everything running smoothly and improved my text considerably.Credit is also due to Danielle Bird, acquisitons editor; Rebecca McKay (Becka), manuscript editor; Cheryl Penner and Rebecca Wendling (Becky), copy editors; Gina Cassill, compositor; and Michael Kloepfer, electronic artist. I also want to thank my colleagues at Microsoft who listened sympathetically to my complaints about deadlines and beta software. Editors Roger Haight and Meredith Waring made me a better writer. Mike Pope reminded me to put the reader ahead of being clever. Megan Shult and Ann Morris , my managers, were supportive even when writing consumed all my after-hours energy. Much of what I learned about . NET came from the material written by my team members Jina Chan, Seth Grossman, Steve Hoag, Steve Stein, and Matt Stoecker. And thank you to Diana Rain, my office mate.I’d also like to thank Ruth McBride, my longtime manager, and my instructors at Seattle University. I appreciate their patience with my often experimental approaches to their assignments over the years. I also have to mention the friends that still call to check on me, even though I haven’t called them in months. Jennifer Wirt, Lisa Wiken, Molly Potteiger, and Julie Brinkley have been true friends. This book would never have been written without the support of my husband, Bruce. He completely ran my life for the seven months I was writing this book. I worked and wrote; he did everything else. My friends are still laughing about how he RSVPs for me.Lastly, I thank my sons for just being ther e and for being proud of me. Introduction Microsoft Visual Basic developers have long clamored for complete objectoriented language support. Microsoft Visual Basic . NET supports all the features of an object- oriented language. In addition, the entire Microsoft . NET Framework, which includes the development support for Microsoft Windows applications, Web applications, Web services, graphics, and data access, is designed according to object-oriented principles. Developers who have a firm grasp of object-oriented principles will be the strongest . NET developers.Also new to developers is C#, a C-based language that gives developers a language choice for developing with the . NET Framework. Some C, Java, and C++ development will move to C# to take advantage of . NET’s features. Visual Basic programmers looking to learn a C language might also move to C#. Visual Basic . NET and C# both support object-oriented development with the . NET Framework. No matter what language you cho ose for development, being able to read code in either language will double your access to Microsoft Visual Studio documentation, . NET books, magazine articles, and other developer resources. System RequirementsYou’ll need the following hardware and software to complete the exercises in this book:  ¦  ¦ Microsoft Visual Studio . NET Professional edition. The Visual Studio . NET software isn’t included with this book. You must purchase it separately and install it before you can complete the exercises in this book. A computer capable of running Microsoft Visual Studio . NET. The following hardware configuration is recommended by the Microsoft Visual Studio . NET Web site, at http://msdn. microsoft. com/vstudio/nextgen/ Computer/Processor PC with a Pentium II–class processor, 450 megahertz (MHz); Pentium III–class processor, 600 MHz recommendedOperating System Microsoft Windows 2000, Server or Professional Microsoft Windows XP Home or Professional Micr osoft Windows NT 4. 0 Server Memory Windows 2000 Professional, 96 megabytes (MB) of RAM; 128 MB recommended Windows 2000 Server, 192 MB of RAM; 256 MB recommended Windows XP Professional, 128 MB of RAM; 160 Recommended Hard Disk 500 MB on System Drive and 3. 0 gigabyte (GB) on installation drive Drive CD-ROM drive Display VGA or higher–resolution monitor Computer/Processor Input Device Microsoft Mouse or compatible pointing device Finding Your Best Starting Point This book is designed to teach you the fundamentals of object-oriented programming.You can use this book if you have a basic knowledge of Visual Basic 6, Visual Basic . NET, Visual C#, or another Windows programming language. The exercises in this book assume you can already perform the following tasks:  ¦ Create a new Windows Application project, build it, and run it.  ¦ Add Windows Forms controls to a Windows Form.  ¦ Create a method to respond to the Click event of a Button control.  ¦ Create a simple meth od (called a Sub or Function in Visual Basic . NET).  ¦ Declare and use variables. For an introduction to Visual Basic . NET, read Microsoft Visual Basic . NET Step by Step by Michael Halvorson (Microsoft Press, 2002).For an introduction to Visual C# , read Microsoft Visual C# . NET Step by Step by John Sharp and Jon Jagger (Microsoft Press, 2002). Use the following table to find your best starting point in this book. If you are New To object- oriented programming Migrating From Visual Basic 6 Switching From another object- oriented programming Follow these steps Install the practice files as described in the following section, â€Å"Installing and Using the Practice Files† Work through the chapters sequentially for a complete introduction to object-oriented programming. Chapters 1 through 7, 9, and 11 concentrate on the mechanics of object- riented programming, while the other chapters cover the concepts in more depth. Install the practice files as described in â€Å"Inst alling and Using the Practice Files† on the next page. Work through the chapters sequentially for a complete introduction to object- oriented programming with Visual Basic .NET. Chapters 1 through 7, 9, and 11 concentrate on the mechanics of object- oriented programming, while the other chapters cover the concepts in more depth. Install the practice files as described in â€Å"Installingand Using the Practice Files. † If you are New language. Referencing The book after working through the exercises Follow these steps Complete Chapter 1 to learn the basic yntax of properties and methods. Read the Quick Reference sections at the end of the chapters for information about specific class constructs. Use the index or the Table of Contents to find information about particular subjects. Read the Quick Reference at the end of each chapter to find a brief review of the syntax and techniques presented in the chapter. Installing and Using the Practice Files The companion CD inside the back cover of this book contains the practice files that you’ll use as you perform the exercises in the book. For example, when you’re learning to create class events, you’ll use a bitmap file named Train. bmp.By using the practice files, you won’t waste time creating objects that aren’t relevant to the exercise. Instead, you can concentrate on learning object-oriented programming with Visual Basic . NET and Visual C# . NET. The files and the step-by-step instructions in the lessons also let you learn by doing, which is an easy and effective way to acquire and remember new skills. Important Install the practice files Before you break the seal on the OOP with Microsoft Visual Basic . NET and Microsoft Visual C# Step by Step companion CD package, be sure that this book matches your version of the software.This book is designed for use with Microsoft Visual Studio . NET Professional Edition for the Windows operating systems. To find out what softw are you’re running, you can check the product package or you can start the software, and then click About Microsoft Development Environment in the Help menu at the top of the screen. Follow these steps to install the practice files on your computer’s hard disk so that you can use them with the exercises in this book. 1. Remove the companion CD from the package inside the back cover of this book and insert the CD in your CD-ROM drive. 2. Double-click the My Computer icon on the Desktop.Tip On some computers, the startup program might run automatically when you close the CD-ROM drive. In this case, skip steps 2 through 5 and follow the instructions on the screen. 3. Double-click the icon for your CD-ROM drive. 4. Double-click StartCD. exe 5. Click Install Sample Code. The setup program window appears with the recommended options preselected for you. For best results in using the practice files with this book, accept these preselected settings. 6. When the files have been installed, remove the CD from your CD- ROM drive and replace it in the package inside the back cover of the book.A folder called OOPVBCS has been created on your hard disk, and the practice files have been placed in that folder. Using the Practice Files Each lesson in this book explains when and how to use any practice files for that lesson. The practice files contain the complete source listings for all the applications created in this book, as well as any resources, such as bitmaps and databases, that you’ll need to complete the exercises. For those of you who like to know all the details, here’s a list of the Visual Basic and Visual C# projects on the practice disk: Project Chapter 1 ReadBooks Chapter 2 ReadMoreBooks Chapter 3 CodeAnalysis CodeAnalysis2 Chapter 4DeckOfCards Chapter 5 TheBank ARoundButton Chapter 6 ABetterBank ABetterLibrary Variations Description This simple program demonstrates the basics of creating, instantiating, and using a class. This program expands on the ReadBooks program and adds constructors. These two applications demonstrate different approaches to using class properties, and the interaction of class properties and the DataGrid control. This application explores class methods by using dynamic creation of Windows Forms controls and drag-and-drop operations. This simple application demonstrates the basics of class inheritance. This small project shows how easy it is to derive rom a Windows Forms control and redefine its drawing. This adaptation of Chapter 5’s TheBank application uses an abstract class as a base class. This improvement on Chapter 1’s ReadBooks application uses a strongly typed collection. This application contains code snippets demonstrating variations on inheritance. Chapter 7 TrainGame ThrowSystemException PersonList Project Chapter 8 GamesLibrary Memory Chapter 9 MoveIt Points Chapter 10 PatternMaker Chapter 11 BetterCard SortablePoint Singleton Chapter 12 VectorAlgebra Chapter 13 S erialize DataSetExercise Chapter 14 This application introduces delegates, events, and user-drawn controls in the context of a simple game.This small program throws a system exception and recovers by using exception handling. This application creates and throws a custom application exception. Description The GamesLibrary project creates a component library containing objects used to develop the simple Memory card game This application covers the basics of creating and implementing an interface. The Points project contains objects that implement the IComparable, IFormattable, and IEnumerable interfaces. Moving beyond the basics of inheritance, the PatternMaker program makes extensive use of inheritance and polymorphism. This improvement on the Card class from Chapter 4 uses static methods to liminate the project’s dependency on file locations. The SortablePoint application from Chapter 10 is made more flexible through static properties. Static fields are used to implement the Singleton design pattern. The mathematical concept of vectors is used to demonstrate the definition and use of operator overloading in Visual C#. The Serialize application demonstrates the use of binary and XML serialization of data. This very simple ADO. NET application reads data from an Access database. PatternMaker Uninstall the practice files This example uses the PatternMaker exercise from Chapter 10 to demonstrate the way to make design changes after the i nitial development of an application.If you are using the Windows XP Professional operating system, follow these steps to remove the practice files from your computer. If you are using a different version of Windows, refer to your Windows Help documentation for removing programs. 1. Click Start, and then click Control Panel. 2. In Control Panel, click Add Or Remove Programs. 3. In the Add Or Remove Programs window, click OOP Visual Basic And C# . NET Code in the Currently Installed Programs list. 4. Click Change/Remove. The Confirm File Deletion dialog appears. 5. Click Yes to delete the practice files. 6. Click Close to close the Add Or Remove Programs window. 7. Close Control Panel.Conventions and Features in this Book This book uses conventions designed to make the information more readable and easier to follow. The book also includes features that contribute to a deeper understanding of the material. Conventions  ¦ Each exercise is a series of tasks. Each task is presented as a series of numbered steps. If a task has only one step, the step is indicated by a round bullet.  ¦ Notes labeled â€Å"tip† provide more information for completing a step successfully.  ¦ Notes labeled â€Å"important† alert you to information you need to check before continuing. The book uses typographic styles to help organize the information presented. The following table describes the styles used. Style Code Italics Used for Code that you type in Method argument or parameter Event Procedure Field Ful ly Qualified Name Keyword Method Property value Example ‘ Visual Basic Public Class Book End Class // Visual C# public class Book { } aBook showPage_Click m_shelf SomeBook. Text Public, public, If, if GetPage listOfBooks Roman Other Features Boolean values Class name Control type Data type Event Form Namespace Parameter type Property True, true, False, false Book, Library, Train ListBox, TextBox String, string, Integer, int Click Form1 ReadBooks String, string, Integer, int NameShaded sidebars throughout the book provide more in-depth information about the exercise. The sidebars might contain debugging tips, design tips, or topics you might want to explore further. Each chapter ends with a Quick Reference section. The Quick Reference provides a brief review of the syntax and techniques presented in the chapter. Corrections, Comments, and Help Every effort has been made to ensure the accuracy of this book and the contents of the practice files on the companion CD. Microsoft Pre ss provides corrections and additional content for its books through the World Wide Web at http://www. microsoft. com/mspress/support/If you have problems, comments, or ideas regarding this book or the companion CD, please send them to Microsoft Press. Send e-mail to [email  protected] com Or send postal mail to Microsoft Press Attn: Step by Step Series Editor One Microsoft Way Redmond, WA 98052-6399 Please note that support for the Visual Studio . NET software product itself is not offered through the preceding address. For help using Visual Studio . NET, visit http://support. microsoft. com. Visit the Microsoft Press World Wide Web Site You are also invited to visit the Microsoft Press World Wide Web site at http://www. microsoft. com/mspress/You’ll find descriptions for the complete line of Microsoft Press books, information about ordering titles, notice of special features and events, additional content for Microsoft Press books, and much more. You can also find out the latest in Visual Studio . NET software developments and news from Microsoft Corporation at http://msdn. microsoft. com/vstudio/nextgen/ Check it out! Chapter 1: Writing Your First Object-Oriented Program Overview ESTIMATED TIME 2 hr. 30 min. In this chapter, you’ll learn how to  ¦ Decide which classes to implement in your program.  ¦ Create a class with fields, properties, and methods. Use a class in an application.  ¦ Use Microsoft Visual Studio . NET tools to create a class definition. Classes are the building blocks of object-oriented programs. Object-oriented program design is driven by the objects in the problem you need to solve. If your goal is to automate class registration, you might create classes for the instructor, student, and class schedule objects. Objects also have properties that describe them and their behavior. These are implemented as properties and methods of a class. Just as an instructor has a name, so does the Instructor class have a Name proper ty.To assign a student to a class, you’d need to find an open section in the schedule. So your ClassSchedule class might implement a FindOpenSection method. The method would likely check the variable, called a field, in the class in which you’ve stored information about sections. In this chapter, you’ll learn how to identify the objects in your problem domain and their properties and behaviors (methods). Using this analysis, you’ll design and implement the classes using property and method programming constructs. You’ll then declare and initialize the variables of the classes you’ve coded.Finally, you’ll implement the solution to your problem by calling the properties and methods of the class variables. Reading Books: Your First Object-Oriented Program Your task in this chapter is to implement a program that displays large text files in page- size pieces. Typically, your task begins with a specification, perhaps complete, perhaps not. The specification for Chapter 1 follows: You have downloaded on your computer the text of several books. You want to be able to select a book and read one particular page at a time. You also want to be able to set the length of a page. You’ve already decided which user interface you want to use; it’s shown here:As you look at the user interface, you can see that you need to add some controls to a Windows form: a ListBox, a RichTextBox, two NumericUpDown controls, and some labels. How will you store the texts of the books? How will you fill the list? How will you retrieve the correct page of the book that you want to read? You can use object-oriented programming to answer these questions. Designing the Classe s Before you can implement your classes, you must decide which classes you need. First you look for the objects in the problem. Having found the objects, you then look for properties, which are characteristics or qualities that belong to the object, and methods, w hich are behaviors of the object.You can choose from many ways to design the classes in an application. The approach presented here begins with a textual analysis of the problem. The nouns are selected as candidates for classes, while verbs become candidates for the methods. In the course of the analysis, you’ll eliminate many of the nouns as candidates, and you might discover classes that aren’t among the nouns in the specification. After you determine the objects, properties, and methods that belong to your classes, you can then write the class specification that you’ll use in the implementation. Find the classes . Read the problem statement, and find all the nouns. You have downloaded on your computer the text of several books. You want to be able to select a book and read one particular page at a time. You also want to be able to set the length of a page. 2. Eliminate candidates. Reasons to eliminate a candidate include  ¦ The class based on the noun would have only properties or only methods.  ¦ The class based on the noun wouldn’t be relevant to the problem.  ¦ The class based on the noun wouldn’t represent one object.You can eliminate the irrelevant candidates: computer and time. Length (of a page) is merely an integer value and wouldn’t generate enough behavior to qualify as a class. The same is true of text in this example—the only thing to be done with it is to display a piece of it, a page. By the same reasoning, page is also not a class. That leaves book and books. Books is just the plural of book , so you are left only with book as a potential class. But you aren’t finished yet. 3. Search for missing candidates. Consider this specification, â€Å"The dealer deals four cards to each player. There’s no mention of a deck of cards, although deck is a likely class in that problem. Remember eliminating books? Another class does, in fact, represent the properties and behavior of a grou p of books. You can call this class Library. The library concept is different from the book concept. A book has a title and text and can be read. A library contains many books, which can be checked out and returned. Left with the Book and Library classes, you can now search for properties and methods. Find the methods and properties 1. Read the problem statement, and find all the verbs. You can leave out the helping verbs, such as is, was, and have.As in the case of the nouns, textual analysis of verbs is just the starting point for finding the methods. You have downloaded on your computer the text of several books. You want to be able toselect a book and read one particular page at a time. You also want to be able to set the length of a page. 2. Consider each verb. Is it a method, or does it indicate a method? Is it relevant to the problem? Downloaded and want are clearly irrelevant to the problem. Select is an operation of the Library class. In a real library, this action would co rrespond to finding a book on the shelf and checking it out. So the Library has a CheckOut method.There’s also a hidden property here because a book needs a title. Read is an operation of the Book class. This method allows you to read one particular page, so it can be named GetPage. The verb set indicates that a property needs to be changed, and that property is the length of a page, PageLength. 3. The same nouns that you eliminated as classes might in fact be properties of those classes. Text, length (of a page), and page were eliminated as classes. A book does need text, so Text becomes a property of Book. You discovered that PageLength is a property in considering the verb set.Page represents one section of the text and represents the result of the GetPage operation, so it isn’t a property. 4. Look for missing properties and methods. If you’re going to check books out of the library, you need a way to add books to the library and return the checked-out books. A CheckIn method will handle this. Testing the Class Design Reread the problem, and determine whether your classes, with their properties and methods, provide the functionality necessary to solve the problem. You have downloaded on your computer the text of several books. Do you have a way of storing and organizing several books?Yes, you can create one Book for each book and one Library to store them all. You want to be able to select a book and read one particular page at a time. Can you select one book and read one page? Yes, books can be selected by their titles, and the GetPage method retrieves one page. You also want to be able to set the length of a page. Can you set the length of a page? Yes, the Book class has a PageLength property. The results are shown in the following table. The methods are shown as they might be declared in Visual Basic. Class Book Properties Integer PageLengt h Methods GetPage (pageNumber As Integer) As String Class Library Creating the Book Class Prop ertiesString Text String Title Methods CheckIn (aBook As Book) CheckOut(title As String) As Book The following exercise covers the basics of class implementation using the Book class as an example. To implement the Library class, you’ll use some of the development tools provided by the Microsoft Visual Studio . NET integrated development environment (IDE). Create the book class 1. In the IDE, click the File menu, point to New, and then click Project. The New Project dialog box opens. 2. Select Visual Basic Projects or Visual C# Projects in the Project Types tree, click Windows Application in the Templates list. 3.Enter ReadBooks in the Name box, and click OK. 4. Display the Solution Explorer by selecting Solution Explorer on the View menu. Click the ReadBooks project in the Solution Explorer. 12. On the Project menu, click Add Class. The Add New Item dialog box appears, as shown here: 13. Enter either Book. vb or Book. cs in the Name box, depending on the language you are usi ng. Note that the class name begins with a capital letter and is singular. 14. Click Open. The IDE adds a file to your project. The file includes the basic definition of a class, as shown in the following two screen shots.The Visual Basic class contains the minimum for a class declaration. Here’s the syntax for declaring a class in Visual Basic: Class ClassName End Class In this case, the class is named Book. The IDE adds the Public modifier that’s shown to indicate that the class can be used throughout the project. The Visual C# class contains the class declaration as well as a constructor. Here’s the syntax for declaring a class in C#: class ClassName {} A constructor contains code to initialize the fields of a class and perform other class initialization fun‘ctions. In C#, it has the same name as the class. A constructor isn’t required.I’ll talk more about constructors in Chapter 2, â€Å"Creating Class Instances with Constructors. † Add the Text and PageLength fields A field is a variable declared in a class block. Fields can be any . NET data type, such as Integer or Boolean; . NET class, such as TextBox or ListBox; or any class that you have created. 1. Locate the beginning of the class definition. In Visual Basic, the class definition begins immediately after the line that shows the class name. In Visual C#, the class definition begins after the opening curly brace of the class. 2. Add the following code inside the class to create Text and PageLength fields. 3. ‘ Visual BasicPublic Text As String = â€Å"† Public PageLength As Integer = 10 // Visual C# public string Text = â€Å"†;p public int PageLength = 10; Tip By convention, the initial letters of names of public members (fields, properties, methods, and events) of a class are capitalized (Textfield) or are intercapitalized (PageLength field). According to the code, you have specified initial values for the fields: the empty string for Text and 10 for PageLength. A basic tenet of object-oriented programming is that an object should maintain a consistent state. That means that the state of the object (the values of its fields) should represent a usable state.If you didn’t initialize the fields, values would default to â€Å"† for the Text field and 0 for the PageLength field. If those were acceptable values for a book, you could leave them uninitialized. But because compilers and their default values change, you can prevent maintenance problems by initializing the fields. Your client code (the code that uses a Book object) is able to read and write to any field declared with the public keyword (Public in Visual Basic and public in Visual C#). Providing direct access to the class data is a violation of the object-oriented principle of information hiding, which stipulates that the client has no knowledge of the underlying data structure of an object.In the next section, you’ll learn how to al low the client code to get and set the Title of the Book without giving away details about the implementation. Add the Title property A property is a programming construct that allows your code to get and set a value. Typically, the code in the property constructor will get and set the value of a private field in the class. In client code, a public field and a property are used in the same way—for example, SomeBook. Text and SomeBook. Title. 1. Add the following code to the Book class after the Text and PageLength declarations. 2. Private m_title As String ‘ Visual Basic private string m_title; // Visual C#This code creates a private field in the Book class. Client code doesn’t have access to this property. Tip Private fields of a class are declared using the m_ prefix to identify them as member data. Private field names aren’t capitalized. 3. Add the following code to the Book class, after the m_title declaration. 4. ‘ Visual Basic 5. Public Propert y Title() As String 6. Get 7. Return m_title 8. End Get 9. Set(ByVal value As String) 10. m_title = value 11. End SetEnd Property 12. // Visual C# 13. public string Title { 14. get { 15. return m_title; 16. } 17. set { 18. m_title = value; 19. }} These syntax blocks define class properties.The Title property appears in the IntelliSense drop-down list just like any other property, such as the familiar TextBox. Text or Form. Backcolor. The property block allows you to control access to the property. You can add validation code to the Set block to ensure that only reasonable values are assigned to the underlying m_title field. Note Please notice an important difference between fields and properties. A place is reserved in memory for fields. They contain the actual data of the class. Properties provide access to the data but are not data themselves. In this book, I use the word set to mean changing a property. I use the word get to mean retrieving the value of a property.The Get and Set blocks of a property can be called getters and setters, or accessors . The property block is more flexible than you’ve seen here. Properties can be public or private, read/write, read-only, or write-only. In Visual Basic, the property statements can even take a parameter. By the way, I cover properties in detail inChapter 2, but I need to talk about them at least a little bit in this chapter. A Little Bit About Properties We can use the word properties, in a general object-oriented sense, to mean the descriptive information about an object. We can also use properties to mean the particular syntactic construct provided by Visual Basic and C#.The particular meaning of the word can be determined by context. Use properties to validate class data and hide class implementation. You have to make a strong case for using public fields in a class. The addition of a property to a class to control access to the underlying data requires minimal effort. The benefit of this practice is tha t you can easily add validation or change the implementation if you need to without affecting clients already using your objects. Add the GetPage method  ¦ Add the GetPage method to the class definition after the field declarations. ‘ Visual BasicPublic Function GetPage(ByVal pageNumber As Integer) As String Dim start As Integer = (pageNumber -1) * PageLength If (start < Text. Length) And (start >= 0) Then If (start + PageLength) < Text. Length Then Return Text. Substring(start, PageLength) Else Return Text. Substring(start, Text. Length – start) End If Else Return â€Å"† End IfEnd Function // Visual C# public string GetPage(int pageNumber) { int start = (pageNumber – 1) * PageLength; if ((start < Text. Length) && (start >= 0)) { if ((start + PageLength) < Text. Length) { return Text.Substring(start, PageLength); } else { return Text. Substring(start, Text. Length – start); } } else { return â€Å"†; }} In Chapter 3, â€Å"Fields and Prop erties,† you’ll see how we can replace the GetPage method with a construct known as an indexer in Visual C# or with a default Item method in Visual Basic. The complete class definitions for our project are shown here: ‘ Visual Basic Public Class Book Public Text As String = â€Å"† Public PageLength As Integer = 10 Private m_title As String Public Property Title() As String Get Return m_title End Get Set(ByVal Value As String) m_title = Value End Set End PropertyPublic Function GetPage(ByVal pageNumber As Integer) As String Dim start As Integer = (pageNumber – 1) * PageLength If (start < Text. Length) And (start >= 0) Then If (start + PageLength) < Text. Length Then Return Text. Substring(start, PageLength) Else Return Text. Substring(start, Text. Length – start) End If Else Return â€Å"† End If End FunctionEnd Class // Visual C#using System;namespace ReadBooks{ /// /// Summary description for Book. /// public class Book { public strin g Text = â€Å"†; public int PageLength = 10; private string m_title; public Book() { // // TODO: Add constructor logic here // } public string Title { get { return m_title; } set { m_title = value; } } ublic string GetPage(int pageNumber) { int start = (pageNumber – 1) * PageLength; if ((start < Text. Length) && (start >= 0)) { if ((start + PageLength) < Text. Length) { return Text. Substring(start, PageLength); } else { return Text. Substring(start, Text. Length – start); } } else { return â€Å"†; } } }} Fields, properties, methods, and constructors can appear in any order in a class definition. Good organization benefits future readers of your code.Here’s a common organization and, in fact, the one I used in this book:  ¦ Field declarations  ¦ Constructors  ¦ Properties  ¦ Methods Using the Book Class in an Application You’ve just finished implementing the Book class. The class definition is just a template for an object. To put data in the fields and properties, you have to create an instance of the class in memory; this action is known as instantiation. When you create an instance, a section of memory is set aside to hold the fields of the object. If you create another instance of the class, another section of memory is set aside for its fields. You aren’t going to implement the full solution yet.First you need to write some code to test your class. You’ll create two instances of the Book class in the ReadBooks project, and you’ll display the fourth page of each book. (These will be very short books. ) You’ll create a cookbook and a book of fairy tales, so you’ll need to create two separate instances of the Book class. Instead of creating a fancy interface, you’ll write just enough code to see whether your class is working as you expected. Test Drivers A short program to test a class is called a driver. It’s a good idea to exercise your class a bit with a driver before adding the class to a larger program.Use the driver to test your class without the interference of other code in the program. Create an instance of Book 1. In the Solution Explorer, double-click Form1 to open it in the Windows form designer. If Form1 is opened in the code editor, select View, Designer. 2. Drag a button from the Toolbox onto Form1. If the Toolbox isn’t visible, select View, Toolbox. 3. Right -click the button, and click Properties on the shortcut menu. In the Properties window, set the Name property of the button to showPage and set the Text property to Show Page. The button on the Windows form is created from the Button class.Name and Text are properties of the Button class. So we can talk about getting and setting these properties. Form1 is a class as well, and the button you just created is a field of the Form1 class. 4. Double-click the button to create the Click event method. 5. Add the following code in boldface to the Click event to create a book of fairy tales. 6. ‘ Visual Basic 7. Private Sub showPage_Click(ByVal sender As System. Object, _ 8. ByVal e As System. EventArgs) Handles showPage. Click 9. Dim fairyTales As Book 10. fairyTales = New Book() 11. End Sub 12. // Visual C# 13. rivate void showPage_Click(object sender, System. EventArgs e) { 14. Book fairyTales; 15. fairyTales = new Book(); } 16. Add the following code to set the Text, PageLength, and Title properties immediately after the code you entered in step 5: 17. ‘ Visual Basic 18. fairyTales. Text = â€Å"Once upon a time there was a bear. † 19. fairyTales. PageLength = 8fairyTales. Title = â€Å"Fairy Tales† 20. // Visual C# 21. fairyTales. Text = â€Å"Once upon a time there was a bear. â€Å"; 22. fairyTales. PageLength = 8; fairyTales. Title = â€Å"Fairy Tales†;When the instance of Book is created, its fields contain the values specified in the class definition. The Text field is an empty string, the page length is 10, and the title is blank. Notice that it makes no difference in the client code whether you use a field or a property. 23. Add the following code after the fairyTales code to create another instance of the Book class. (This instance will be a recipe book. ) 24. ‘ Visual Basic 25. Dim cookies As Book = New Book() 26. cookies. Text = â€Å"Chocolate chip cookies are the most delicious co okies. † 27. ookies. PageLength = 8 28. cookies. Title = â€Å"Cookie Recipes† 29. // Visual C# 30. Book cookies = new Book(); 31. cookies. Text = â€Å"Chocolate chip cookies are the most delicious co okies. â€Å"; 32. cookies. PageLength = 8; cookies. Title = â€Å"Cookie Recipes†; In this case, you used a different syntax for declaring and initializing a variable of the Book class. Visual Basic and Visual C# allow declaration and initialization in the same statement. Declaring and initializing in the same statement has the following advantages:  ¦ Programmers ar e less likely to forget to initialize the variable. When a class defines a constructor with parameters, the fields can be initialized at the same time. (You’ll create constructors with parameters in Chapter 3. ) Use an instance of the Book class 1. Add the following code after the cookies code to display some of the text of the two books. In later chapters, you’ll learn other ways to return the text of a particular page in the book. 2. ‘ Visual Basic 3. Dim page As Integer = 3 4. Dim report As String 5. report = â€Å"Page † & page. ToString() & ControlChars. CrLf _ 6. & fairyTales. Title & â€Å": † & fairyTales. GetPage(page) _ 7. ControlChars. CrLf _ 8. & â€Å"Cookies: † & cookies. GetPage(page) 9. MessageBox. Show(report) 10. report = â€Å"Titles: † + fairyTales. Title & † and † & cookies. Title 11. MessageBox. Show(report) 12. // Visual C# 13. int page = 3; 14. string report; 15. report = â€Å"Page † + page. ToString() + † † 16. + fairyTales. Title + â€Å": † + fairyTales. GetPage(page) + † † 17. + cookies. Title + â€Å": † + cookies. GetPage(page); 18. MessageBox. Show(report); 19. report = â€Å"Titles: † + fairyTales. Title + † and † + cookies. Title; MessageBox. Show(report);This bit of code demonstrates that there are two separate instances of the Book class. We can refer to these instances using the variables fairyTales and cookies . The object-oriented concept that permits each instance to be referred to separately is known as identity. You’ll see in later chapters that the identity principle doesn’t mean that you have to create a variable for each instance. Creating so many variables is unwieldy if you need hundreds of instances of a class. Identity does mean that you can refer to each instance separately when you need to.Notice that when you created an instance of Book, the fields of fairyTales were change d and the GetPage method was called. Later on we retrieved the value of the Title property. The value of Title was unchanged after the GetPage method was called. The fact that the value was unchanged demonstrates the concept of object state, the idea that the fields retain their values between method calls. Compare the way the GetPage method works with a method that has variable declarations. After the GetPage method ends, the variables go out of scope and their values are lost to the application. 20. Press F5 to run the code. Click the Show Page button.The results are shown here: Click OK, and the book titles are displayed in a message box as shown here: Click OK, and then close the application. You’ve now created a class, Book, and two instances of it. Your code sent a message to the Book class through the GetPage method to ask for the third page of the text. In the next sections, you’ll implement another class, Library. This time, however, you’ll let some of the IDE tools do some of the syntactic work for you. Using the Class View The IDE provides a Class View that displays a tree view of the class structure of the project, namespaces, and classes.The Class View can share the same window as the Solution Explorer. On the View menu, click Class View to open the Class View. The expanded Class View is shown below for Visual Basic and Visual C#, respectively. The highest-level node represents the project, ReadBooks. The next level of nodes represents the namespaces in the project. A project can contain several namespaces; in this case, there’s only one. The project namespace contains two classes: the class that we created, Book, and the class for the Windows form, Form1. The Book class contains two public fields, PageLength and Text, epresented by blue blocks, and one private field, m_ti