Friday, November 29, 2019

Why did it take Lincoln so long to allow blacks to join the military and fight for the north in the Civil War Essay Example Essay Example

Why did it take Lincoln so long to allow blacks to join the military and fight for the north in the Civil War? Essay Example Paper Why did it take Lincoln so long to allow blacks to join the military and fight for the north in the Civil War Essay Introduction The inauspicious commencement of the Civil War signalled that the war would not be a brief affair, even if such briefness had earlier been anticipated. The first battle christened the Bull Run on July 21 1861, pitted federal troops numbering 30,000 under General Irvin McDonell against Confederate troops numbering 22,000 under General P.G.T. Beauregard.1 The defensive superiority of the Confederates rent a major blow to the budding press corps. This was just the beginning. Even though the Union forces desired to increase their manpower concerns in the white American mind rent questions as regards the black man’s degree of intelligence, humanity and common sense. These questions and doubts created a situation in which the Lincoln administration was unsure of which side the African Americans slaves would take in the conflict between the Union and the Confederacy. Most whites believed that blacks could barely comprehend the nature of the war. Moreover, the degree of their loyalty to their slave masters rendered them irrelevant to the overall outcome of the conflict.1 These initial doubts to the recruitment of the black soldier were answered unambiguously just within the initial weeks of the war. As the Union forces advanced and occupied South Carolina Sea Islands, slaves escaped from the plantations and joined the Union army lines. To understand the developments in the Civil War, a concise exposition is worthwhile. The Civil War gave the slave population the opportunity to actively engage in their own emancipation and become free men. Even though major slave uprisings were absent and not more than a quarter of the overall slave population made it in the Union lines, slavery disintegrated as the Union Armies moved with irreversible momentum into the slave territories.2 Through the act of seizing their freedom whenever opportune, African Americans became enshrined into a self-emancipation process. The process was to extend to almost all spheres of their lives leading into the reconstruction. After Lincoln’s Emancipation Proclamation on January 1, 1863, the black quest for freedom was converted into an official war aim. Even though the proclamation was historically congruent to Lincoln’s constitutional scruples, the ramifications of the proclamation itself was lost on the general public who viewed it as nothing but a general moral anti-slavery crusade. Why did it take Lincoln so long to allow blacks to join the military and fight for the north in the Civil War? Essay Body Paragraphs However, blacks began to sense that the war against the Confederacy was a war for their own liberation; the war was caused by their being slaves and that the end result of the war would be their eventual freedom.3 Therefore as federal forces advanced, they acted as a magnet; attracting slaves from the adjacent areas. The first attraction of such kind occurred in Charleston, South Carolina, Savannah and Georgia. Geographically these areas covered rice and sea island plantations. As more and more blacks hurried into the Union enclaves, the surrounding areas which had hitherto been ripe in slavery collapsed. As the Union armies moved into New Orleans, thousands of blacks moved into Union camps resulting in the collapse of slavery in the entire lower Mississippi. This ripple effect was repeated as the Union forces advanced into new areas. In New Orleans the Southern myths that blacks were docile were blown away when the black populations decided to release years of accumulated hostility and anger. The slaves seized the lands for their own use, drove off overseers, stopped working or fled to the Union camps.4 As blacks continued to pour into contraband camps, the mortality rates increased averaging approximately 25%. In line with the Union policy, these refugees received employment in whatever capacity that was deemed useful to the Union war effort. Both the Navy and the Army organized labour battalions of the increasing black population for work as teamsters, construction hands, laundresses, and cooks and so on. In practice, the employment was akin to imposition of forced labour controls by the military. Thus, the refugees received pay but these wages were way below what their white counterparts’ received. A greater number were also leased out, according to the terms of employment drawn by federal commanders and the conferences and local planters or superintendents representing Northern freedmen’s aid societies, to work in plantations that had been se ized by the Union forces. Amid these employment options, the eagerness of blacks to fight for their cause could not be vanquished because since the war began, blacks had tried, albeit unsuccessfully, to register in enlist in the Union Navy and Army.5 On April 23 1861; a black employee of the United States senate: Jacob Dobson drafted a letter to the Secretary of War to express his determination as well as that of other three hundred Black Americans to militarily play a part in defending their capital. In New York, Black men independently organized drilling sessions in preparation for the war. In a rally held in Boston in April 1861, blacks expressed their wish that the statutes prohibition their enlistment in the United States army be abolished. Despite all these, Lincoln still held profound doubts about the character of black males. He feared that if blacks were to be armed, then in a few weeks time the same arms would be in the hands of the rebels.1 On another occasion Lincoln rei terated that should blacks be enlisted in the army then it would be akin to betraying the political realities that existed at that time. He was disturbed that such an enlistment would turn the fifty thousand bayonets originating from the Border States that were loyal against the Union. During the war there existed a popular sentiment that the Civil War was a white mans war. Others feared that enlisting the black man into the army increased their probability of being successful in the battlefield hence making the black man gain additional respect that the white had no intention of extending to their black brethren. Added to these concerns, was the discriminatory attitudes among the white soldiers who believed that it was extremely deteriorating to fight alongside a race they considered too inferior. It is prudent to note that during this period, the white male was viewed as being too cowardly and an unthinking menial. Such an image was extrapolated to imply that they when recruited t hey would be poor soldiers In 1863, Lincoln made a bold step that created the program for the enlistment of black soldiers into the federal forces. At the onset of the program, the insecurities of the Northern white supremacist majority were immediately aroused as they thought that the Union and its gains may be tainted if blacks shed blood in their own defence or in the process of liberating the remaining slaves. This was one of the reasons that Lincoln had delayed the recruitment of blacks in the Union forces. The presence of political risks posed by white backlash as well as the military danger that such a move would lead to a drop in morale other challenges to the recruitment of blacks in the army. However, he overcame these challenges by successful implementing the policy whose main aim was to increase manpower in the Union armies. Eventually, the policy enabled the recruitment of 200,000 Afro-Americans in the Union military.2 The recruitment of blacks into the military did not instantaneously transform the northern racial attitudes; in fact it exacerbated racial tensions and intensified the Democratic opposition to the emancipation. The black soldiers were segregated, given meagre pay, commanded by white officers and deemed fit for the labour battalions and the garrison.6 As blacks transformed the war into a revolution intent on throwing out the old order, Lincoln attitude towards the policy changed from that of reluctance to that of enthusiasm. Blacks soldiers fighting for their own liberation signified the progress in the revolution that Lincoln had started by the Emancipation Proclamation. In the South, the response to black enlistment was ferocious both on paper and practically. Upon hearing of the policy, General Beauregard called for the execution of black Union soldiers. A sober analysis of the Generals policy prevented the enforcement of such an order but there were evidences of the execution of black soldiers in the South either in the battlefie ld or thereafter. Reports and rumours of such massacres caused a vexation among the Union authorities during the entire war period. This was one of the main reasons why Lincoln had initially hesitated to enlist blacks in the Union army as combatants since they had a high risk of capture. Moreover, the Confederate utterly refused to treat black soldiers who were captured as legitimate prisoners of war. This refusal eventually led to the breakdown of prisoner of war exchanges. As the war strode on attitudes that has delayed their recruitment in the Union Army began to change. There are those who believed that recruiting blacks was a sure way of saving whites from dying in the battlefield. Expanding the ranks with black men also served in hastening the war towards its end. Despite the difficulties these black soldiers faced such as discrimination from white soldiers, white men, bad food, cold winter quarters, boredom, loneliness, hard drilling hours, dirt and diseases, they endured the m all. On the other hand, they were earning a reputation for exhibiting courage under fire, winning heroic invasions on Confederate territory.7 Numerous accounts of unflinching courage among colored regiments finally silenced the critics of the emancipation and black enlistment. However, from the first day that the blacks entered into the battlefield they faced greater perils than the white soldiers. As prisoners of war, they were either shot or hanged. In reaction, Lincoln threatened the confederates that for every single soldier shot or hung, the same will be done to rebel prisoners of war. It was this threat that led to the cessation of prisoner exchanges as the South refused to hand over black prisoners of war and so the execution by the South continued, but these actions could not stop blacks from enlisting into the army. As the Civil war ended, between 180,000-200,000 African Americans had adorned the Union uniform; constituting 10% of the Northern Army. We will write a custom essay sample on Why did it take Lincoln so long to allow blacks to join the military and fight for the north in the Civil War? Essay Example specifically for you for only $16.38 $13.9/page Order now We will write a custom essay sample on Why did it take Lincoln so long to allow blacks to join the military and fight for the north in the Civil War? Essay Example specifically for you FOR ONLY $16.38 $13.9/page Hire Writer We will write a custom essay sample on Why did it take Lincoln so long to allow blacks to join the military and fight for the north in the Civil War? Essay Example specifically for you FOR ONLY $16.38 $13.9/page Hire Writer

Monday, November 25, 2019

Mayhem and Maiming

Mayhem and Maiming Mayhem and Maiming Mayhem and Maiming By Maeve Maddox A series of insurance ads personifies insurable disaster as a man who causes various kinds of property damage. The ads always end with the character saying, â€Å"be protected from mayhem like me,† spreading the idea that mayhem means, â€Å"damage.† Mayhem shares its origin with the verb maim, which originally meant â€Å"to wound or cause bodily hurt or disfigurement.† In current usage, maim means â€Å"to mutilate† or â€Å"to cripple.† Twin Blasts Kill 3 and Leave Scores Maimed, Wounded Children maimed, tortured in Syria, says damning UN report A new generation of maimed veterans is coming home with critical needs that overwhelm existing care facilities and devastate their families. As a term in criminal law, mayhem retains the meaning of inflicting physical injury on a person. Mayhem is a crime in which tremendous violence is done onto the victim.   [] to prove the defendant guilty of mayhem, the prosecution needs to prove that the defendant had malicious intent to maim or disfigure, cuts or maims an ear, nose, lip or cuts off or disable limb of another person. (site of a Boston attorney) In ordinary speech, mayhem is used to refer to any kind of violent behavior or disorder. A surfers’ event in Huntington Beach, Calif., ended in mayhem late Sunday, as riot police were called to the streets to disperse violent crowds and break up numerous fights. Akm Antivirus 2010 Pro is a virus that is causing mass mayhem around the internet by infecting thousands of PCs. Current mayhem in the financial sector opens up an opportunity for Nigeria to rid itself of the political and economic cancer it has endured for decades. U.S. Secretary of State John Kerry said that Yanukovych must decide between protecting the people that he serves all of the people versus violence and mayhem. The word maim always denotes a crippling injury. Apart from legal use, mayhem may refer either to physical injury or to violent behavior that does not necessarily lead to injury. 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 Vocabulary category, check our popular posts, or choose a related post below:Passed vs Past5 Lessons for Mixing Past and Present TenseCapitalizing Titles of People and Groups

Friday, November 22, 2019

Criminal justice Thesis Example | Topics and Well Written Essays - 1000 words - 2

Criminal justice - Thesis Example There have been a number of issues however that have been raised when dealing with medical experimentation especially when the test subjects are human beings. This has to do with medical ethics and the right of going about seeking test subjects as well as the process of the experiments themselves. One of these issues is the matter of using prisoners to conduct medical experiments on various diseases such as AIDS and Hepatitis C when seeking cures. The argument behind the use of prisoners for the conducting of medical experiments in these areas is the fact that there is a higher prevalence of these diseases in the prison populations as compared to other groups and thus it is generally a convenient approach whilst seeking test subjects (Epstein, 2009, pg38). However, it has to be considered whether it is right to use prisoners as guinea pigs for medical experiments, or is it a type of discrimination on the part of the medical researchers (Tauber, 2005, pg18). This subject can be said to have both pros and cons when put into, and the issue is if the pros outweigh the cons considerably enough to win the day. There are a number of advantages to be considered by using prisoners as test subjects for new drugs to combat these diseases. These advantages have to do with the situation at hand and the potential positive outcome should the drugs be successful. They include: Situational advantage – Prisoners are in a position where they reside in a controlled environment and thus this would make it easier for researchers to ensure that the test subjects are placed in a conducive environment for the conduction of the research (Lakhan et al, 2009, pg 12). For example, this is to say if the subject is not supposed to take any alcohol during the test period, this would not be a problem as they have no access to any liquor. Since the test subjects are all located in one area for the entirety of the test period, observation also becomes a simpler process as

Wednesday, November 20, 2019

Cross-Cultural Enterprise Management Essay Example | Topics and Well Written Essays - 4000 words

Cross-Cultural Enterprise Management - Essay Example Focus of the paper will be towards emphasizing the importance of effective cross cultural management in an enterprise and to what extent this affects the survival of the enterprise. Cross-cultural management is particularly important for the operation of an enterprise to gain the requisite advantage in the fiercely competitive world. If the problem of cultural conflict in an enterprise is not handled well, it might influence the entire working environment of the enterprise and make the task of management more complex and the decision-making and implementation of multinational operation more difficult. Such problems might restrict the selection of human resources from native or overseas market, products and services. The impact of cultural conflict on the transnational business happens to be quite comprehensive, systematic affecting the entire process. This study will center on the cross-cultural enterprise management to analyze the problems in enterprise cultural management and prese nt possible solutions which are of a certain guiding significance to some of the UK companies On the basis of successful and unsuccessful case analyses of overseas investments by some of the UK companies or by some MNCs in UK, the study tries to put forward general theories in such a manner that the study proves to be of some help in future research work. Background Cross-cultural management in essence means managing different cultures with effective coordination amongst the cultural groups and management teams of different cultures with its impact on organizational behavior, effective communication with people who come from different countries and cultural backgrounds. (Li,C & Lu,C, 2000) Along with the rapid development in the economic field and globalization and integration of economies, the role of corporate culture is becoming increasingly significant in upgrading enterprise competitiveness. Different culture backgrounds, values, enterprise management modes, politics, beliefs and cultures as well as racism and communication misunderstanding will give rise to corporate cultural conflicts. Cultural conflicts will in turn affect the relationship between multinational management and local employees and may lead to a loss in market opportunity and organizational efficiency, thus hampering the implementation plans of global strategies of multinat ionals. The so called "cultural conflict" refers to the process of confrontation and repulsion between different cultures or cultural elements, which not only includes the conflict arising from cultural difference between multinationals and countries where multinationals operate but also the conflict among internal employees from different cultural

Monday, November 18, 2019

LAND LAW Essay Example | Topics and Well Written Essays - 3750 words

LAND LAW - Essay Example He was not regular in visiting his property since he purchased it in year 1952, when he had asked his seller to plant Christmas trees on the land with the idea of harvesting it in later years. However, he could not tend to his land since he was posted at Bonn between the years 1955 to 1967. Subsequent to his return, between the years 1967-1972, the McFarlane’s could make few visits to the property site, but it was clear that his interest in his property was waning. The McFarlanes did not suspect that their land was under the possession of Powell until, in 1972, they noticed the new fencing on their land, which gave rise to suspicion in their minds that perhaps all was not well regarding their claims to the stated property. Powell brought action stating that he was in adverse possession of the said disputed land since 12 years from the period 1960 to1972.In order to substantiate this statement, he had to prove that he had actual possession and control over the said land for the last 12 years. The facts, as observed by Slade J, were that for a person to be in possession, whether legal or illegal, he should be able to bring action for trespass, against any trespasser or squatter, who comes into the said land, without his permission. This is except in the case of a person who has a better title to the land then what he himself has.. In other words, he had to maintain animus possidendi.This means that, when the law has to attribute possession of a land to person who does not have paper title on the said land, he must be in a position to prove that he has both the factual possession as well as the requisite intention to possess the said land. (Farlane 1977). The main issue in the event of alleged possession is that the squatter is dealing with the land as though it is his own, and in a manner that would be used by the true owner, and nobody else. The essence of animus posited is that the squatter, in his own

Saturday, November 16, 2019

John Dalton And Atomic Theory

John Dalton And Atomic Theory John Dalton was the originator of atomic theory, which theory provided scientists with new ways of seeing the physical world. Atomic weights and fixed ratios of atoms inside compounds provided researchers with the knowledge to explore chemical compositions of matter. Daltons new information on atomic weights allowed a Russian chemist, Dmitry Mendeleyev, to create the periodic table of elements. This table provided the means for discovering new elements, and Dalton also proposed symbols for the elements. The symbols would represent the atom combination in compounds, but these were later changed to the abbreviations known today. Daltons theory had been accepted at the time, but it opened new questions about atom interactions. The structure and interaction of atoms refined atomic theory. Until Dalton, the line between physics and chemistry was almost unnoticeable, but his atomic theory distinguished and divided the two disciplines. In physics and chemistry, the atom is a cornerstone providing an understanding of matter and force, especially in quantitative analysis. Quantitative analysis refers to the measurement of how much of a certain substance is within a sample. Daltons theory was the beginning of nuclear energy and fusion research still used today. The theory also provides for the study of the quantitative relationships between substances in chemical reactions, or stoichiometry. It provides for structural theory and arrangements of atoms for influencing properties. Daltons models eventually turned into the understanding of 3-dimensional qualities of molecules and the affect of structure on properties. Daltons theory did have some inaccuracies, but it did provide the foundation for future generations of scientists. Atomic theory is the idea that matter is made u p of little units called atoms. In 1897, the British scientist J.J. Thomson discovered that atoms are in fact made up of smaller particles. Today atomic theory refers to matter being made up of units that are indivisible only some of the time. Dalton concluded that evaporated water exists in air as an independent gas. He wondered how water and air could occupy the same space at the same time, when obviously solid bodies cant. If the water and air were composed of discrete particles, Dalton reasoned, evaporation might be viewed as a mixing of water particles with air particles. He performed a series of experiments on mixtures of gases to determine what effect properties of the individual gases had on the properties of the mixture as a whole. While trying to explain the results of those experiments, Dalton developed the hypothesis that the sizes of the particles making up different gases must be different. John Dalton published the first table on relative atomic weights that included six elements viz. hydrogen, oxygen, carbon, nitrogen, phosphorous and sulfur. He stated the atomic weight of hydrogen to be 1. It was not confirmed as to how he derived the atomic weights. However, his laboratory notebook indicated that he found out the relative weights from the studies of the compounds water, carbon dioxide and ammonia. In his notebook, the elements were represented by symbols. He was the first person to propose the idea of identifying an element by its symbol. Later on, elements are represented by their abbreviations, for example, H is the abbreviation of the element hydrogen. While the concept of atoms was thus being made indispensable, the ancient belief that they were probably structure less and certainly indestructible came under devastating attack. J.J. Thomsons discovery of the electron in 1897 soon led to the realization that the mass of an atom largely resides in a positively charged part, electrically neutralized by a cloud of much lighter electrons. A f ew years later Ernest Rutherford and Frederick Soddy showed how the emission of alpha and beta particles from radioactive elements causes them to be transformed into elements of different chemical properties. By 1913, with Rutherford as the leading figure, the foundations of the modern theory of atomic structure were laid. It was determined that a small, massive nucleus carries all the positive charge whose magnitude, expressed as a multiple of the fundamental charge of the proton, is the atomic number. An equal number of electrons carrying a negative charge numerically equal to that of the proton form a cloud whose diameter is several thousand times that of the nucleus around which they swarm. The atomic number determines the chemical properties of the atom, and in alpha decay a helium nucleus, whose atomic number is 2, is emitted from the radioactive nucleus, leaving one whose atomic number is reduced by 2. In beta decay the nucleus in effect gains one positive charge by emitting a negative electron and thus has its atomic number increased by unity. Rutherfords gold foil experiment, performed in conjunction with Geiger and Marsden, provided evidence for the nucleus due to the scattering of alpha particles. The protons. Further work by Chadwick revealed the existence of neutrons within the nucleus of the atom. The atomic number describes the number of protons in the nucleus. For a neutral atom this is also the number of electrons outside the nucleus. Subtracting the atomic number from the atomic mass number gives the number of neutrons in the nucleus. Isotopes are atoms of the same element they have the same number of protons, or the same atomic number which have a different number of neutrons in the nucleus. Isotopes of an element have similar chemical properties. Radioactive isotopes are called radioisotopes. Most of the elements in the periodic table have several isotopes, found in varying proportions for any given element. The average atomic mass of an el ement takes into account the relative proportions of its isotopes found in nature. A nuclear binding force holds the nucleus of the atom together. The nuclear mass defect, a slightly lower mass of the nucleus compared to the sum of the masses of its constituent matter, is due to the nuclear binding energy holding the nucleus together. The mass defect can be used to calculate the nuclear binding energy, with E = mc2. The average binding energy per nucleon is a measure of nuclear stability. The higher the average binding energy, the more stable the nucleus. The basic difference between Rutherfords Atomic Theory and the Plum Pudding Model has to do with the fact that the Plum Pudding Model theorized that an atom was made up electrons the plums surrounded by a positively charged mass the pudding. Rutherford later proved that this wasnt the case and theorized that atoms were comprised of a very small nucleus surrounded by electrons. The basic tenets of that statement are still held to be true in the modern era. The chief difference is the fact that Niels Bohr, when theorizing the design of the atom, included a thesis for the forces that help to hold the atomic structure together. The Bohr model is still widely accepted by contemporary scientists. The Bohr model of the atom was established in 1913 as the leading theory of atomic structure. Because of this, it can be truthfully said that Rutherfords Atomic Theory was an extremely short-lived phenomenon. Despite its brief time frame, however, Rutherfords theory was extremely important because Niels Bohr wouldnt have been able to develop his own model without the established background that Rutherfords Atomic Theory laid out for him. www.angelfire.com/sc2/atomtheory/ www.iun.edu/~cpanhd/C101webnotes//dalton.html www.angelfire.com/sc2/atomtheory/ www.chemprofessor.com/atomic.htm www.nobeliefs.com/atom.htm www.chemlin.net/chemistry/atomic_theory.htm

Wednesday, November 13, 2019

No School Should Usurp the Rights of Any Student Essays -- Teaching Ed

No School Should Usurp the Rights of Any Student   Ã‚  Ã‚  Ã‚  Ã‚  Children are forced to go to school. This has been the way for a long time. School is a place where students go to learn a curriculum given by government officials. They are not there to get their rights taken away from them. Although teachers have power, they cannot stop students from hearing the issues, speaking without censorship, or knowing their rights.   Ã‚  Ã‚  Ã‚  Ã‚  Students are living, breathing human beings. We go to school to learn about and succeed in the outside world. Government officials are to teach us these things and see how well we learn them. We are curious creatures. We need to know everything or else we will rebel. Teachers should tell us both parts of a certain subject to allow objectivity in our minds. If we hear only one side of a controversial issue we tend to assert ourselves with the only point of view. We may also find out information on our own that is bad and believe what we find out. Teachers are here to guide us to the correct information. If a teacher takes a side he/she may tell us only the negative points to his opposing side. He/she may, also, just tell us good points about his side. Either way, he/she gives us a one sided perception. We need to hear both sides in order to make up our own minds.   Ã‚  Ã‚  Ã‚  Ã‚  Many believe that teachers have more power than students. This is a weak argument because teachers cannot remove rights of students. The Supreme Court stated this: â€Å"It can hardly be argued that either students or teachers shed their constitutional rights to freedom of speech or expression at the school house gate† (Tinker vs. Des Moines Independent School District). Therefore, students are just as powerful as teachers. Teachers want to discipline their students how and when they choose. This is a major dispute among parents, teachers, and students. A teacher may not ever hit a student purposely. A teacher may lower our grade for not doing work or failing class criteria. They may not lower our grade just because they don’t like us or we act slightly out of hand. Many people say that students don’t know what is best for them. This is may be true at lower elementary, but in high school, students can speak for themselves and know what they need. In some court cases or public meetings, teachers or the school bo... ...rookfield: Millbrook,1997. â€Å"Student Government†. World Book: Millennium 2000. 2000ed. â€Å"Student Rights†. Natural Math. 21 Jan. 2002 . â€Å"Students Rights†. Rethinking Schools. Vol. 14, Issue 4 (Summer 2000). 21 Jan. 2002 . â€Å"Students Rights†. Y and M Online. 21 Jan. 2002 . â€Å"Students Rights and Responsibilities†. University of Virginia. 21 Jan. 2002 . â€Å"Students Rights Guide†. American Civil Liberties Union of Northern California. 21 Jan. 2002 . â€Å"Students‘ Rights of Free Speech†. The American Center for Law and Justice. 20 Jan. 2002 . â€Å"Students Rights on Public School Campuses†. Liberty Counsel. 20 Jan. 2002 http://www.lc.org/OldResources/Students_rights_0900.html. â€Å"Teachers‘ Rights on Public School Campuses†. Liberty Counsel. 20 Jan. 2002 . Young, David. Survey. Oakridge High School: 30 Jan. 2002.

Monday, November 11, 2019

C# Step by Step Codes

SREEKANTH C# STEP BY STEP Microsoft Visual Studio C#. NET Step By Step 1 SREEKANTH C# STEP BY STEP Introduction Microsoft Visual C# is a powerful but simple language aimed primarily at developers creating applications by using the Microsoft . NET Framework. It inherits many of the best features of C++ and Microsoft Visual Basic, but few of the inconsistencies and anachronisms, resulting in a cleaner and more logical language. The advent of C# 2. 0 has seen several important new features added to the language, including Generics, Iterators, and anonymous methods.The development environment provided by Microsoft Visual Studio 2005 makes these powerful features easy to use, and the many new wizards and enhancements included in Visual Studio 2005 can greatly improve your productivity as a developer. The aim of this book is to teach you the fundamentals of programming with C# by using Visual Studio 2005 and the . NET Framework. You will learn the features of the C# language, and then use them to build applications running on the Microsoft Windows operating system.By the time you complete this book, you will have a thorough understanding of C# and will have used it to build Windows Forms applications, access Microsoft SQL Server databases, develop ASP. NET Web applications, and build and consume a Web service. Part I Introducing Microsoft Visual C# and Microsoft Visual Studio 2005 Chapter 1 Welcome to C# After completing this chapter, you will be able to: †¢ †¢ †¢ †¢ Use the Visual Studio 2005 programming environment. Create a C# console application. Use namespaces. Create a C# Windows Forms application. Microsoft Visual C# is Microsoft's powerful, component-oriented language.C# plays an important role in the architecture of the Microsoft . NET Framework, and some people have drawn comparisons to the role that C played in the development of UNIX. If you already know a language such as C, C++, or Java, you'll find the syntax of C# reassuringly fami liar because it uses the same curly brackets to delimit blocks of code. However, if you are used to programming in other languages, you should soon be able to pick up the syntax and feel of C#; you just need to learn to put the curly brackets and semi-colons in the right place. Hopefully this is just the book to help you!In Part I, you'll learn the fundamentals of C#. You'll discover how to declare variables and how to use operators such as plus (+) and minus (-) to create values. You'll see how to write methods and pass arguments to methods. You'll also learn how to use selection statements such as if and iteration statements such as while. Finally, you'll understand how C# uses exceptions to handle errors in a graceful, easy-to-use manner. These topics form the core of C#, and from this solid foundation, you'll progress to more advanced features in Part II through Part VI. 2 SREEKANTH C# STEP BY STEPBeginning Programming with the Visual Studio 2005 Environment Visual Studio 2005 i s a tool-rich programming environment containing all the functionality you'll need to create large or small C# projects. You can even create projects that seamlessly combine modules from different languages. In the first exercise, you'll start the Visual Studio 2005 programming environment and learn how to create a console application. Create a console application in Visual Studio 2005 1. In Microsoft Windows, click the Start button, point to All Programs, and then point to Microsoft Visual Studio 2005. 2.Click the Microsoft Visual Studio 2005 icon. Visual Studio 2005 starts. NOTE If this is the first time that you have run Visual Studio 2005, you might see a dialog box prompting you to choose your default development environment settings. Visual Studio 2005 can tailor itself according your preferred development language. The various dialog boxes and tools in the integrated development environment (IDE) will have their default selections set for the language you 3 SREEKANTH C# STEP BY STEP choose. Select Visual C# Development Settings from the list, and then click the Start Visual Studio button.After a short delay, the Visual Studio 2005 IDE appears. 3. On the File menu, point to New, and then click Project. The New Project dialog box opens. This dialog box allows you to create a new project using various templates, such as Windows Application, Class Library, and Console Application, that specify the type of application you want to create. NOTE The actual templates available depend on the version of Visual Studio 2005 you are using. It is also possible to define new project templates, but that is beyond the scope of this book. 4.In the Templates pane, click the Console Application icon. 5. In the Location field, type C:Documents and SettingsYourNameMy DocumentsMicrosoft PressVisual CSharp Step by StepChapter 1. Replace the text YourName in this path with your Windows user name. To save a bit of space throughout the rest of this book, we will simply refer to th e path â€Å"C:Documents and SettingsYourNameMy Documents† as your â€Å"My Documents† folder. 4 SREEKANTH C# STEP BY STEP NOTE If the folder you specify does not exist, Visual Studio 2005 creates it for you. 6. In the Name field, type TextHello. . Ensure that the Create Directory for Solution check box is checked and then click OK. The new project opens. The menu bar at the top of the screen provides access to the features you'll use in the programming environment. You can use the keyboard or the mouse to access the menus and commands exactly as you can in all Windows-based programs. The toolbar is located beneath the menu bar and provides button shortcuts to run the most frequently used commands. The Code and Text Editor window occupying the main part of the IDE displays the contents of source files.In a multi-file project, each source file has its own tab labeled with the name of the source file. You can click the tab once to bring the named source file to the foreg round in the Code and Text Editor window. The Solution Explorer displays the names of the files associated with the project, among other items. You can also double-click a file name in the Solution Explorer to bring that source file to the foreground in the Code and Text Editor window. 5 SREEKANTH C# STEP BY STEP Before writing the code, examine the files listed in the Solution Explorer, which Visual Studio 2005 has created as part of your project: Solution ‘TextHello' This is the top-level solution file, of which there is one per application. If you use Windows Explorer to look at your My DocumentsVisual CSharp Step by StepChapter 1TextHello folder, you'll see that the actual name of this file is TextHello. sln. Each solution file contains references to one or more project files. †¢ TextHello This is the C# project file. Each project file references one or more files containing the source code and other items for the project. All the source code in a single project must be written in the same programming language.In Windows Explorer, this file is actually called TextHello. csproj, and it is stored in your My DocumentsVisual CSharp Step by StepChapter 1TextHelloTextHello folder. †¢ Properties This is a folder in the TextHello project. If you expand it, you will see that it contains a file called AssemblyInfo. cs. AssemblyInfo. cs is a special file that you can use to add attributes to a program, such as the name of the author, the date the program was written, and so on. There are additional attributes that you can use to modify the way in which the program will run.These attributes are outside the scope of this book. †¢ References This is a folder that contains references to compiled code that your application can use. When code is compiled, it is converted into an assembly and given a unique name. Developers use assemblies to package up useful bits of code that they have written for distribution to other developers that might want to use them in their applications. Many of the features that you will be using when writing applications using this book will make use of assemblies provided by Microsoft with Visual Studio 2005. †¢ Program. csThis is a C# source file, and is the one displayed in the Code and Text Editor window when the project is first created. You will write your code in this file. It contains some code that Visual Studio 2005 provides automatically, which you will examine shortly. Writing Your First Program The Program. cs file defines a class called Program that contains a method called Main. All methods must be defined inside a class. The Main method is special—it designates the program's entry point. It must be a static method. (Methods are discussed in 6 SREEKANTH C# STEP BY STEP Chapter 3, â€Å"Writing Methods and Applying Scope. Static methods are discussed in Chapter 7, â€Å"Creating and Managing Classes and Objects. † The Main method is discussed in Chapter 11, â€Å"Unde rstanding Parameter Arrays. †) IMPORTANT C# is a case-sensitive language. You must spell Main with a capital M. In the following exercises, you'll write the code to display the message Hello World in the console; you'll build and run your Hello World console application; you'll learn how namespaces are used to partition code elements. Write the code using IntelliSense technology 1. In the Code and Text Editor window displaying the Program. s file, place the cursor in the Main method after the opening brace, and type Console. As you type the letter C at the start of the word Console an IntelliSense list appears. This list contains all of the valid C# keywords and data types that are valid in this context. You can either continue typing, or scroll through the list and double-click the Console item with the mouse. Alternatively, after you have typed Con, the Intellisense list will automatically home in on the Console item and you can press the Tab, Enter, or Spacebar key to selec t it. Main should look like this: static void Main(string[] args) Console } NOTE Console is a built-in class that contains the methods for displaying messages on the screen and getting input from the keyboard. 2. Type a period immediately after Console. Another Intellisense list appears displaying the methods, properties, and fields of the Console class. 3. Scroll down through the list until WriteLine is selected, and then press Enter. Alternatively, you can continue typing until WriteLine is selected and then press Enter. The IntelliSense list closes, and the WriteLine method is added to the source file. Main should now look like this: static void Main(string[] args) Console. WriteLine } 4. Type an open parenthesis. Another IntelliSense tip appears. This tip displays the parameters of the WriteLine method. In fact, WriteLine is an overloaded method, meaning that Console contains more than one method named Write Line. Each version of the WriteLine method can be used to output differ ent 7 SREEKANTH C# STEP BY STEP types of data. (Overloaded methods are discussed in Chapter 3. ) Main should now look like this: static void Main(string[] args) { Console. WriteLine( } You can click the tip's up and down arrows to scroll through the overloaded versions of WriteLine. . Type a close parenthesis, followed by a semicolon. Main should now look like this: static void Main(string[] args) { Console. WriteLine(); } 6. Type the string â€Å"Hello World† between the left and right parentheses. Main should now look like this: static void Main(string[] args) { Console. WriteLine(â€Å"Hello World†); } TIP Get into the habit of typing matched character pairs, such as ( and ) and { and }, before filling in their contents. It's easy to forget the closing character if you wait until after you've entered the contents. 8 SREEKANTH C# STEP BY STEP NOTEYou will frequently see lines of code containing two forward slashes followed by ordinary text. These are comments. They a re ignored by the compiler, but are very useful for developers because they help document what a program is actually doing. For example: Console. ReadLine(); // Wait for the user to press the Enter key All text from the two slashes to the end of the line will be skipped by the compiler. You can also add multi-line comments starting with /*. The compiler will skip everything until it finds a */ sequence, which could be many lines lower down.You are actively encouraged to document your code with as many comments as necessary. Build and run the console application 1. On the Build menu, click Build Solution. This action causes the C# code to be compiled, resulting in a program that you can run. The Output windows appears below the Code and Text Editor window. a. TIP If the Output window does not appear, click the View menu, and then click Output to display it. b. In the Output window, messages similar to the following show how the program is being compiled and display the details of any errors that have 9 SREEKANTH C# STEP BY STEP occurred.In this case there should be no errors or warnings, and the program should build successfully: c. —— Build started: Project: TextHello, Configuration: Debug Any CPU —d. Csc. exe /config /nowarn:†1701;1702†³ /errorreport: prompt /warn:4 †¦ e. Compile complete –- 0 errors, 0 warnings f. TextHello -> C:Documents and SettingsJohnMy DocumentsMicrosoft Press†¦ g. ============ Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ======== h. NOTE An asterisk after the file name in the tab above the Code and Text Editor window indicates that the file has been changed since it was last saved.There is no need to manually save the file before building because the Build Solution command automatically saves the file. 2. On the Debug menu, click Start Without Debugging. A Command window opens and the program runs. The message Hello World appears, and then the program waits for the user to press any key, as shown in the following graphic: 3. Ensure that the Command window displaying the program has the focus, and then press Enter. The Command window closes and you return to the Visual Studio 2005 programming environment. NOTE If you run the program using Start Debugging on the Debug menu, the pplication runs but the Command window closes immediately without waiting for you to press a key. 4. In the Solution Explorer, click the TextHello project (not the solution), and then click Show All Files button. Entries named bin and obj appear above the C# source filenames. These entries correspond directly to folders named bin and obj in the project folder (My DocumentsVisual CSharp Step by StepChapter 1TextHelloTextHello). These folders are created when you build your application, and they contain the executable version of the program and some other files. 10 SREEKANTHC# STEP BY STEP 5. 5. In the Solution Explorer, click the + to the left of the bin entry. Another folder named Deb ug appears. 6. 6. In the Solution Explorer, click the + to the left of the Debug entry. Three entries named TextHello. exe, TextHello. pdb, and TextHello. vshost. exe appear. The file TextHello. exe is the compiled program, and it is this file that runs when you click Start Without Debugging in the Debug menu. The other two files contain information that is used by Visual Studio 2005 if you run your program in Debug mode (when you click Start Debugging in the Debug menu).Command Line Compilation You can also compile your source files into an executable file manually by using the csc command-line C# compiler. You must first complete the following steps to set up your environment: 1. On the Windows Start menu, point to All Programs, point to Microsoft Visual Studio 2005, point to Visual Studio Tools, and click Visual Studio 2005 Command Prompt. A Command window opens, and the envionment variables PATH, LIB, and INCLUDE are configured to include the locations of the various . NET Frame work libraries and utilities. TIP You can also run the vcvarsall. at script, located in the C:Program FilesMicrosoft Visual Studio 8VC folder, if you want to configure the environment variables while running in an ordinary Command Prompt window. 2. In the Visual Studio 2005 Command Prompt window, type the following command to go to the My DocumentsMicrosoft PressVisual CSharp Step by StepChapter 1TextHelloTextHello project folder: 3. cd Documents and SettingsYourNameMy DocumentsMicrosoft PressVisual CSharp Step by StepChapter 1TextHelloTextHello 4. Type the following command: csc /out:TextHello. exe Program. cs 11 SREEKANTH C# STEP BY STEPThis command creates the executable file TextHello. exe from the C# source file. If you don't use the /out command-line option, the executable file takes its name from the source file and is called Program. exe. 5. Run the program by typing the following command: TextHello The program should run exactly as before, except that you will not see the à ¢â‚¬Å"Press any key to continue† prompt. Using Namespaces The example you have seen so far is a very small program. However, small programs can soon grow into bigger programs. As a program grows, it creates two problems. First, more code is harder to understand and maintain than less code.Second, more code usually means more names; more named data, more named methods, and more named classes. As the number of names increases so does the likelihood of the project build failing because two or more names clash (especially when the program uses third-party libraries). In the past, programmers tried to solve the name-clashing problem by prefixing names with some sort of qualifier (or set of qualifiers). This solution is not a good one because it's not scalable; names become longer and you spend less time writing software and more time typing (there is a difference) and reading and re-reading incomprehensibly long names.Namespaces help solve this problem by creating a named container for other identifiers, such as classes. Two classes with the same name will not be confused with each other if they live in different namespaces. You can create a class named Greeting inside the namespace named TextHello, like this: namespace TextHello { class Greeting { †¦ } } You can then refer to the Greeting class as TextHello. Greeting in your own programs. If someone else also creates a Greeting class in a different namespace and installs it on your computer, your programs will still work as expected because they are using the TextHello.Greeting class. If you want to refer the new Greeting class, you must specify that you want the class from the new namespace. It is good practice to define all your classes in namespaces, and the Visual Studio 2005 environment follows this recommendation by using the name of your project as the toplevel namespace. The . NET Framework Software Developer Kit (SDK) also adheres to this recommendation; every class in the . NET Framework lives inside a namespace. For 12 SREEKANTH C# STEP BY STEP example, the Console class lives inside the System namespace. This means that its fully qualified name is actually System.Console. Of course, if you had to write the fully qualified name of a class every time, it would be no better that just naming the class SystemConsole. Fortunately, you can solve this problem with a using directive. If you return to the TextHello program in Visual Studio 2005 and look at the file Program. cs in the Code and Text Editor window, you will notice the following statements: using System; using System. Collections. Generic; using System. Text; The using statement brings a namespace into scope, and you no longer have to explictly qualify objects with the namespace they belong to in the code that follows.The three namespaces shown contain classes that are used so often that Visual Studio 2005 automatically adds these using statements every time you create a new project. You can add further using direct ives to the top of a source file. The following exercise demonstrates the concept of namespaces further. Try longhand names 1. In the Code And Text Editor window, comment out the using directive at the top of Program. cs: //using System; 2. On the Build menu, click Build Solution. The build fails, and the Output pane displays the following error message twice (once for each use of the Console class):The name ‘Console' does not exist in the current context. 3. In the Output pane, double-click the error message. The identifier that caused the error is selected in the Program. cs source file. TIP The first error can affect the reliability of subsequent diagnostic messages. If your build has more than one diagnostic message, correct only the first one, ignore all the others, and then rebuild. This strategy works best if you keep your source files small and work iteratively, building frequently. 4. In the Code and Text Editor window, edit the Main method to use the fully qualified name System. Console.Main should look like this: static void Main(string[] args) { System. Console. WriteLine(â€Å"Hello World†); 13 SREEKANTH C# STEP BY STEP } NOTE When you type System. , notice how the names of all the items in the System namespace are displayed by IntelliSense. 5. On the Build menu, click Build Solution. The build succeeds this time. If it doesn't, make sure Main is exactly as it appears in the preceding code, and then try building again. 6. Run the application to make sure it still works by clicking Start Without Debugging on the Debug menu. In the Solution Explorer, click the + to the left of the References entry.This displays the assemblies referenced by the Solution Explorer. An assembly is a library containing code written by other developers (such as the . NET Framework). In some cases, the classes in a namespace are stored in an assembly that has the same name (such as System), although this does not have to be the case—some assemblies hold more than one namespace. Whenever you use a namespace, you also need to make sure that you have referenced the assembly that contains the classes for that namespace; otherwise your program will not build (or run). Creating a Windows Forms ApplicationSo far you have used Visual Studio 2005 to create and run a basic Console application. The Visual Studio 2005 programming environment also contains everything you'll need to create graphical Windows applications. You can design the form-based user interface of a Windows application interactively by using the Visual Designer. Visual Studio 2005 then generates the program statements to implement the user interface you've designed. From this explanation, it follows that Visual Studio 2005 allows you to maintain two views of the application: the Design View and the Code View.The Code and Text Editor window (showing the program statements) doubles as the Design View window (allowing you to lay out your user interface), and you can switch bet ween the two views whenever you want. In the following set of exercises, you'll learn how to create a Windows program in Visual Studio 2005. This program will display a simple form containing a text box where you can enter your name and a button that, when clicked, displays a personalized greeting in a message box.You will use the Visual Designer to create your user interface by placing controls on a form; inspect the code generated by Visual Studio 2005; use the Visual Designer to change the control properties; use the Visual Designer to resize the form; write the code to respond to a button click; and run your first Windows program. Create a Windows project in Visual Studio 2005 1. On the File menu, point to New, and then click Project. The New Project dialog box opens. 2. In the Project Types pane, click Visual C#. 14 SREEKANTH C# STEP BY STEP 3. In the Templates pane, click the Windows Application icon. . Ensure that the Location field refers to your My DocumentsVisual CSharp St ep by StepChapter 1 folder. 5. In the Name field, type WinFormHello. 6. In the Solutions field, ensure that Create new Solution is selected. This action creates a new solution for holding the Windows application. The alternative, Add to Solution, will add the project to the TextHello solution. 7. Click OK. Visual Studio 2005 closes your current application (prompting you to save it first of necessary) and creates and displays an empty Windows form in the Design View window.In the following exercise, you'll use the Visual Designer to add three controls to the Windows form and examine some of the C# code automatically generated by Visual Studio 2005 to implement these controls. Create the user interface 1. Click the Toolbox tab that appears to the left of the form in the Design View. The Toolbox appears, partially obscuring the form and displaying the various components and controls that you can place on a Windows form. 2. In the Toolbox, click the + sign by Common Controls to display a list of controls that are used by most Windows Forms applications. 15 SREEKANTHC# STEP BY STEP 3. Click Label, and then click the visible part of the form. A Label control is added to the form, and the Toolbox disappears from view. TIP If you want the Toolbox to remain visible but not hide any part of the form, click the Auto Hide button to the right in Toolbox title bar (it looks like a pin). The Toolbox appears permanently on the left side of the Visual Studio 2005 window, and the Design View shrinks to accommodate it. (You might lose a lot of space if you have a low-resolution screen. ) Clicking the Auto Hide button once more causes the Toolbox to disappear again. 4.The Label control on the form is probably not exactly where you want it. You can click and drag the controls you have added to a form to reposition them. Using this technique, move the Label control so that it is positioned towards the upper-left corner of the form. (The exact placement is not critical for this app lication. ) 5. On the View menu, click Properties Window. The Properties window appears on the right side of the screen. The Properties window allows you to set the properties for items in a project. It is context sensitive, in that it displays the properties for the currently selected item.If you click anywhere on the form displayed in the Design View, you will see that the Properties windows displays the properties for the form itself. If you click the Label control, the window displays the properties for the label instead. 6. Click the Label control on the form. In the Properties window, locate the Text property, change it from label1 to Enter your name, and then press Enter. On the form, the label's text changes to Enter Your Name. TIP By default, the properties are displayed in categories. If you prefer to display the properties in alphabetical order, click the Alphabetical button that appears above the properties list. . Display the Toolbox again. Click TextBox, and then click the form. A TextBox control is added to the form. Move the TextBox control so that it is directly underneath the Label control. TIP When you drag a control on a form, alignment handles appear automatically when the control becomes aligned vertically or horizontally with other controls. This give you a quick visual cue for making sure that controls are lined up neatly. 8. While the TextBox control is selected, locate the Text property in the Properties window, type here, and then press Enter. On the form, the word here appears in the text box. 9.In the Properties window, find the (Name) property. Visual Studio 2005 gives controls and forms default names, which, although they are a good starting point, are not always very meaningful. Change the name of the TextBox control to userName. 16 SREEKANTH C# STEP BY STEP NOTE We will talk more about naming conventions for controls and variables in Chapter 2, â€Å"Working with Variables, Operators, and Expressions. † 10. Display the T oolbox again, click Button, and then click the form. Drag the Button control to the right of the TextBox control on the form so that it is aligned horizontally with the text box. 11.Using the Properties window, change the Text property of the Button control to OK. Change its (Name) property to ok. The caption on the button changes. 12. Click the Form1 form in the Design View window. Notice that resize handles (small squares) appear on the lower edge, the right-hand edge, and the righthand bottom corner of the form. 13. Move the mouse pointer over the resize handle. The pointer changes to a diagonal double-headed arrow. 14. Hold down the left mouse button, and drag the pointer to resize the form. Stop dragging and release the mouse button when the spacing around the controls is roughly equal.TIP You can resize many controls on a form by selecting the control and dragging one of the resize handles that appears in the corners of the control. Note that a form has only one resize handle, whereas most controls have four (one on each corner). On a form, any resize handles other than the one in the lower-right corner would be superfluous. Also note that some controls, such as Label controls, are automatically sized based on their contents and cannot be resized by dragging them. The form should now look similar to the one in the following graphic. 1. In the Solution Explorer, right-click the file Form1. s, and then click View Code. The Form1. cs source file appears in the Code and Text Editor window. There are now two tabs named Form1. cs above the Code and Text Editor/Design View window. You can click the one suffixed with [Design] to return to Design View window at any time. Form1. cs contains some of the code automatically generated by Visual Studio 2005. You should note the following elements: 17 SREEKANTH C# STEP BY STEP o using directives Visual Studio 2005 has written a number of using directives at the top of the source file (more than for the previous example) . For example: using System. Windows. Forms;The additional namespaces contain the classes and controls used when building graphical applications—for example, the TextBox, Label, and Button classes. o The namespace Visual Studio 2005 has used the name of the project as the name of the toplevel namespace: namespace WinFormHello { †¦ } o A class Visual Studio 2005 has written a class called Form1 inside the WinForm Hello namespace: namespace WinFormHello { partial class Form1 †¦ { †¦ } } NOTE For the time being, ignore the partial keyword in this class. I will describe its purpose shortly. This class implements the form you created in the Design View. Classes are discussed in Chapter 7. ) There does not appear to be much else in this class—there is a little bit of code known as a constructor that calls a method called InitializeComponent, but nothing else. (A constructor is a special method with the same name as the class. It is executed when the form is cr eated and can contain code to initialize the form. Constructors are also discussed in Chapter 7. ) However, Visual Studio 2005 is performing a sleight of hand and is hiding a few things from you, as I will now demonstrate. In a Windows Forms application, Visual Studio 2005 actually generates a potentially large amount of code.This code performs operations such as 18 SREEKANTH C# STEP BY STEP creating and displaying the form when the application starts, and creating and positioning the various controls on the form. However, this code can change as you add controls to a form and change their properties. You are not expected to change this code (indeed, any changes you make are likely to be overwritten the next time you edit the form in the Design View), so Visual Studio 2005 hides it from you. To display the hidden code, return to the Solution Explorer, and click the Show All Files button.The bin and obj folders appear, much as they did with the Console application you developed in th e first part of this chapter. However, notice that Form1. cs now has a + sign next to it. If you click this + sign, you see a file called Form1. Designer. cs, and a file called Form1. resx. Double-click the file Form1. Designer. cs to display its contents in the Code and Text Editor window. You will see the remaining code for the Form1 class in this file. C# allows you to split the code for a class across multiple source files, as long as each part of the class is marked with the partial keyword.This file includes a region labelled Windows Form Designer generated code. Expanding this region by clicking the + sign reveals the code created and maintained by Visual Studio 2005 when you edit a form using the Design View window. The actual contents of this file include: o The InitializeComponent method This method is mentioned in the file Form1. cs. The statements inside this method set the properties of the controls you added to the form in the Design View. (Methods are discussed in Cha pter 3. ) Some of the statements in this method that correspond to the actions you performed using the Properties window are shown below: .. private void InitializeComponent() { this. label1 = new System. Windows. Forms. Label(); this. userName = new System. Windows. Forms. TextBox(); this. ok = new System. Windows. Forms. Button(); †¦ this. label1. Text = â€Å"Enter your name†; †¦ this. userName. Text = â€Å"here†; †¦ this. ok. Text = â€Å"OK†; †¦ } †¦ o Three fields Visual Studio 2005 has created three fields inside the Form1 class. These fields appear near the end of the file: private System. Windows. Forms. Label label1; 19 SREEKANTH C# STEP BY STEP private System. Windows. Forms. TextBox userName; private System. Windows. Forms. Button ok; .. These fields implement the three controls you added to the form in Design View. (Fields are discussed in Chapter 7. ) It is worth restating that although this file is interesting to look at, you should never edit its contents yourself. Visual Studio 2005 automatically updates this file when you make changes in the Design View. Any code that you need to write yourself should be placed in the Form1. cs file. At this point you might well be wondering where the Main method is and how the form gets displayed when the application runs; remember that Main defines the point at which the program starts.In the Solution Explorer, you should notice another source file called Program. cs. If you double-click this file the following code appears in the Code and Text Editor window: namespace WinFormHello { static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { Application. EnableVisualStyles(); Application. Run(new Form1()); } } } You can ignore most of this code. However, the key statement is: Application. Run(new Form1()); This statement creates the form and displays it, whereupon the form takes over. In the following exercise, you'll learn how to add code that runs when he OK button on the form is clicked. Write the code for the OK button 1. Click the Form1. cs[Design] tab above the Code and Text Editor window to display Form1 in the Design View. 2. Move the mouse pointer over the OK button on the form, and then double-click the button. The Form1. cs source file appears in the Code and Text Editor window. Visual Studio 2005 has added a method called ok_Click to the Form1 class. (It has also added a statement to the InitializeComponent method in the Form1. Designer. cs file to automatically call ok_Click when the OK button is 20 SREEKANTH C# STEP BY STEP clicked.It does this by using a delegate type; delegates are discussed in Chapter 16, â€Å"Delegates and Events. †) 3. Type the MessageBox statement shown below inside the ok_Click method. The complete method should look like this: 4. private void ok_Click(object sender, System. EventArgs e) 5. { 6. MessageBox. Show(â€Å"Hello † + userName . Text); } Make sure you have typed this code exactly as shown, including the trailing semicolon. You're now ready to run your first Windows program. Run the Windows program 1. On the Debug menu, click Start Without Debugging. Visual Studio 2005 saves your work, compiles your program, and runs it.The Windows form appears: 2. Enter your name, and then click OK. A message box appears welcoming you by name. 3. Click OK in the message box. The message box closes. 4. In the Form1 window, click the Close button (the X in the upper-right corner of the form). The Form1 window closes. †¢ If you want to continue to the next chapter Keep Visual Studio 2005 running, and turn to Chapter 2. †¢ If you want to exit Visual Studio 2005 now On the File menu, click Exit. If you see a Save dialog box, click Yes to save your work. Chapter 1 Quick Reference TO Do this KeyCombination 21 SREEKANTH C# STEP BY STEP Create a onsole application new On the File menu, point to New, and then click Projec t to open the New Project dialog box. For the project type, select Visual C#. For the template, select Console Application. Select a directory for the project files in the Location box. Choose a name for the project. Click OK. Create a Windows application new On the File menu, point to New, and then click Project to open the New Project dialog box. For the project type, select Visual C#. For the template, select Windows Application. Select a directory for the project files in the location box. Choose a name for the project.Click OK. Build application F6 the On the Build menu, click Build Solution. Ctrl+F5 Chapter 2 Working with Variables, Operators, and Expressions After completing this chapter, you will be able to: †¢ †¢ †¢ †¢ †¢ Understand statements, identifiers, and keywords. Use variables to store information. Work with primitive data types. Use arithmetic operators such as the plus sign (+) and the minus sign (–). Increment and decrement variabl es. In Chapter 1, â€Å"Welcome to C#,† you learned how to use the Microsoft Visual Studio 2005 programming environment to build and run a console program and a Windows Forms application.In this chapter, you'll be introduced to the elements of Microsoft Visual C# syntax and semantics, including statements, keywords, and identifiers. You'll study the primitive types that are built into the C# language and the characteristics of the values that each type holds. You'll also see how to declare and use local variables (variables that exist only within a function or other small section of code), learn about the arithmetic operators that C# provides, learn how to use operators to manipulate values, and learn how to control expressions containing two or more operators. Understanding StatementsA statement is a command that performs an action. Statements are found inside methods. You'll learn more about methods in Chapter 3, â€Å"Writing Methods and Applying Scope,† but for now , think of a method as a named sequence of statements inside a class. Main, which was introduced in the previous chapter, is an example of a method. Statements in C# must follow a well-defined set of rules. These rules are collectively known as syntax. (In contrast, the specification of what statements do is collectively known as semantics. ) One of the simplest and most important C# syntax rules states 22 SREEKANTH C# STEP BY STEP hat you must terminate all statements with a semicolon. For example, without its terminating semicolon, the following statement won't compile: Console. WriteLine(â€Å"Hello World†); TIP C# is a â€Å"free format† language, which means that white space, such as a space character or a new line, is not significant except as a separator. In other words, you are free to lay out your statements in any style you choose. A simple, consistent layout style makes a program easier to read and understand. The trick to programming well in any language is learning its syntax and semantics and then using the language in a natural and idiomatic way.This approach makes your programs readable and easy to modify. In the chapters throughout this book, you'll see examples of the most important C# statements. Using Identifiers Identifiers are the names you use to identify the elements in your programs. In C#, you must adhere to the following syntax rules when choosing identifiers: †¢ †¢ You can use only letters (uppercase and lowercase), digits, and underscore characters. An identifier must start with a letter (an underscore is considered a letter). For example, result, _score, footballTeam, and plan9 are all valid identifiers, whereas result%, footballTeam$, and 9plan are not.IMPORTANT C# is a case-sensitive language: footballTeam and FootballTeam are not the same identifier. Identifying Keywords The C# language reserves 77 identifiers for its own use, and you should not reuse these identifiers for your own purposes. These identi fiers are called keywords, and each has a particular meaning. Examples of keywords are class, namespace, and using. You'll learn the meaning of most of the keywords as you proceed through this book. The keywords are listed in the following table. abstract break char continue do event finally foreach in is as byte checked decimal double explicit fixed goto int ock base case class default else extern float if interface long 23 bool catch const delegate enum false for implicit internal namespace SREEKANTH new out protected return sizeof struct true ulong using while C# STEP BY STEP null override public sbyte stackalloc switch try unchecked virtual object params readonly sealed static this typeof unsafe void operator private ref short string throw uint ushort volatile TIP In the Visual Studio 2005 Code and Text Editor window, keywords are colored blue when you type them. TIP In the Visual Studio 2005 Code and Text Editor window, keywords are colored blue when you type them.Using Variabl es A variable is a storage location that holds a value. You can think of a variable as a box holding temporary information. You must give each variable in a program a unique name. You use a variable's name to refer to the value it holds. For example, if you want to store the value of the cost of an item in a store, you might create a variable simply called cost, and store the item's cost in this variable. Later on, if you refer to the cost variable, the value retrieved will be the item's cost that you put there earlier. Naming VariablesYou should adopt a naming convention for variables that help you avoid confusion concerning the variables you have defined. The following list contains some general recommendations: †¢ †¢ Don't use underscores. Don't create identifiers that differ only by case. For example, do not create one variable named myVariable and another named MyVariable for use at the same time, because it is too easy to get them confused. NOTE Using identifiers tha t differ only by case can limit the ability to reuse classes in applications developed using other languages that are not case sensitive, such as Visual Basic. †¢ †¢ †¢ Start the name with a lowercase letter.In a multiword identifier, start the second and each subsequent word with an uppercase letter. (This is called camelCase notation. ) Don't use Hungarian notation. (Microsoft Visual C++ developers reading this book are probably familiar with Hungarian notation. If you don't know what Hungarian notation is, don't worry about it! ) 24 SREEKANTH C# STEP BY STEP IMPORTANT You should treat the first two recommendations as compulsory because they relate to Common Language Specification (CLS) compliance. If you want to write programs that can interoperate with other languages, such as Microsoft Visual Basic .NET, you need to comply with these recommendations. For example, score, footballTeam, _score, and FootballTeam are all valid variable names, but only the first two ar e recommended. Declaring Variables Remember that variables are like boxes in memory that can hold a value. C# has many different types of values that it can store and process—integers, floating-point numbers, and strings of characters, to name three. When you declare a variable, you must specify what type of data it will hold. NOTE Microsoft Visual Basic programmers should note that C# does not allow implicit declarations.You must explicitly declare all variables before you can use them if you want your code to compile. You declare the type and name of a variable in a declaration statement. For example, the following statement declares that the variable named age holds int (integer) values. As always, the statement must be terminated with a semi-colon. int age; The variable type int is the name of one of the primitive C# types—integer which is a whole number. (You'll learn about several primitive data types later in this chapter. ) After you've declared your variable, you can assign it a value. The following statement assigns age the value 42.Again, you'll see that the semicolon is required. age = 42; The equal sign (=) is the assignment operator, which assigns the value on its right to the variable on its left. After this assignment, the age variable can be used in your code to refer to the value it holds. The next statement writes the value of the age variable, 42, to the console: Console. WriteLine(age); TIP If you leave the mouse pointer over a variable in the Visual Studio 2005 Code and Text Editor window, a ToolTip appears telling you the type of the variable. Working with Primitive Data Types C# has a number of built-in types called primitive data types.The following table lists the most commonly used primitive data types in C#, and the ranges of values that you can store in them. 25 SREEKANTH C# STEP BY STEP Data type int Description Size (bits) *Range Sample usage Whole numbers 32 int count; count = 42; long Whole numbers (bigger range) 64 float Floating-point numbers 32 231 through 2311 263 through 2631  ±3. 4 ? 1038 double Double accurate) numbers decimal Monetary values 128 string Sequence of characters 16 bits per Not applicable character char Single character 16 bool Boolean 8 precision (more 64 floating-point  ±1. 7 ? 10308 28 significant igures long wait; wait = 42L; float away; away = 0. 42F; double trouble; trouble = 0. 42; decimal coin; coin = 0. 42M; string vest; vest = â€Å"42†; char grill; grill = ‘4'; 0 through 216 1 bool teeth; true or false teeth false; = *The value of 216 is 32,768; the value of 231 is 2,147,483,648; and the value of 263 is 9,223,372,036,854,775,808. Unassigned Local Variables When you declare a variable, it contains a random value until you assign a value to it. This behavior was a rich source of bugs in C and C++ programs that created a variable and used it as a source of information before giving it a value.C# does not allow you to use an unassigned variable. Y ou must assign a value to a variable before you can use it, otherwise your program will not compile. This requirement is called the Definite Assignment Rule. For example, the following statements will generate a compile-time error because age is unassigned: int age; Console. WriteLine(age); // compile time error Displaying Primitive Data Type Values In the following exercise, you'll use a C# program named PrimitiveDataTypes to demonstrate how several primitive data types work. Display primitive data type values 26SREEKANTH C# STEP BY STEP 1. Start Visual Studio 2005. 2. On the File menu, point to Open, and then click Project/Solution. The Open Project dialog box appears. 3. Move to the Microsoft PressVisual CSharp Step by StepChapter 2PrimitiveDataTypes folder in your My Documents folder. Select the file PrimitiveDataTypes. sln and then click Open. The solution loads, and the PrimitiveDataTypes project. Solution Explorer displays the solution and NOTE Solution file names have the . sln suffix, such as PrimitiveDataTypes. sln. A solution can contain one or more projects.Project files have the . csproj suffix. If you open a project rather than a solution, Visual Studio 2005 will automatically create a new solution file for it. If you build the solution, Visual Studio 2005 automatically saves any updated or new files, and you will be prompted to provide a name and location for the new solution file. 4. On the Debug menu, click Start Without Debugging. The following application window appears: 5. In the Choose A Data type list, click the string type. The value 42 appears in the Sample value box. 6. Click the int type in the list.The value to do appears in the Sample value box, indicating that the statements to display an int value still need to be written. 27 SREEKANTH C# STEP BY STEP 7. Click each data type in the list. Confirm that the code for the double and bool types also needs to be completed. 8. Click Quit closing the window and stopping the program. Contro l returns to the Visual Studio 2005 programming environment. Use primitive data types in code 1. Right-click the Form1. cs file in the Solution Explorer and then click View Code. The Code and Text Editor window opens displaying the Form1. cs file. 2.In the Code and Text Editor window, find the show Float Value method listed here: private void showFloatValue() { float var; var = 0. 42F; value. Text = â€Å"0. 42F†; } TIP To locate an item in your project, point to Find And Replace on the Edit menu and click Quick Find. A dialog box opens asking what you want to search for. Type the name of the item you're looking for, and then click Find Next. By default, the search is not case-sensitive. If you want to perform a case-sensitive search, click the + button next to the Find Options label to display additional options, and check the Match Case check box.If you have time, you can experiment with the other options as well. You can also press Ctrl+F (press the Control key, and then p ress F) to display the Quick Find dialog box rather then usin g the Edit menu. Similarly, you can press Ctrl+H to display the Quick Find and Replace dialog box. The showFloatValue method runs when you click the float type in the list box. This method contains three statements: The first statement declares a variable named var of type float. The second statement assigns var the value 0. 42F. (The F is a type suffix specifying that 0. 2 should be treated as a float value. If you forget the F, the value 0. 42 will be treated as a double, and your program will not compile because you cannot assign a value of one type to a variable of a different type in this way. ) The third statement displays the value of this variable in the value TextBox on the form. This statement requires a little bit of your attention. The way in which you display an item in a TextBox is to set its Text property. You did this at 28 SREEKANTH C# STEP BY STEP design time in Chapter 1 using the Properties window. Thi s statement shows ou how to perform the same task programmatically, using the expression value. Text. The data that you put in the Text property must be a string (a sequence of characters), and not a number. If you try and assign a number to the Text property your program will not compile. For this reason, the statement simply displays the text â€Å"0. 42F† in the TextBox (anything in double-quotes is text, otherwise known as a string). In a real-world application, you would add statements that convert the value of the variable var into a string and then put this into the Text property, but you need to know a little bit more about C# and the .NET Framework before we can do that (we will cover data type conversions in Chapter 11, â€Å"Understanding Parameter Arrays,† and Chapter 19, â€Å"Operator Overloading†). 3. In the Code and Text Editor window, locate the showIntValue method listed here: private void showIntValue() { value. Text = â€Å"to do†; } T he showIntValue method is called when you click the int type in the list box. TIP Another way to find a method in the Code and Text Editor window is to click the Members list that appears above the window, to the right. This window displays a list of all the methods (and other items).You can click the name of a member, and you will be taken directly to it in the Code and Text Editor window. 4. Type the following two statements at the start of the showIntValue method, after the open curly brace: int var; var = 42; The showIntValue method should now look like this: private void showIntValue() { int var; var = 42; value. Text = â€Å"to do†; } 5. On the Build menu, click Build Solution. a. The build will display some warnings, but no errors. You can ignore the warnings for now. 6. In the original statement, change the string â€Å"to do† to â€Å"42†. b. The method should now look exactly like this: 9 SREEKANTH C# STEP BY STEP c. private void showIntValue() d. { i. int var; ii. var = 42; iii. value. Text = â€Å"42†; e. } 7. On the Debug menu, click Start Without Debugging. f. The form appears again. g. TIP If you have edited the source code since the last build, the Start Without Debugging command automatically rebuilds the program before starting the application. 8. Select the int type in the list box. Confirm that the value 42 is displayed in the Sample value text box. 9. Click Quit to close the window and stop the program. 10. In the Code and Text Editor window, find the showDoubleValue method. 1. Edit the showDoubleValue method exactly as follows: private void showDoubleValue() { double var; var = 0. 42; value. Text = â€Å"0. 42†; } 12. In the Code and Text Editor window, locate the showBoolValue method. 13. Edit the showBoolValue method exactly as follows: private void showBoolValue() { bool var; var = false; value. Text = â€Å"false†; } 14. On the Debug menu, click Start Without Debugging. The form appears. 15. I n the list, select the int, double, and bool types. In each case, verify that the correct value is displayed in the Sample value text box. 16. Click Quit to stop the program.Using Arithmetic Operators C# supports the regular arithmetic operations you learned in your childhood: the plus sign (+) for addition, the minus sign (–) for subtraction, the asterisk (*) for multiplication, and the forward slash (/) for division. These symbols (+, –, *, and /) are called operators as they â€Å"operate† on values to create new values. In the following 30 SREEKANTH C# STEP BY STEP example, the variable moneyPaidToConsultant ends up holding the product of 750 (the daily rate) and 20 (the number of days the consultant was employed): long moneyPaidToConsultant; oneyPaidToConsultant = 750 * 20; NOTE The values that an operator operates on are called operands. In the expression 750 * 20, the * is the operator, and 750 and 20 are the operands. Determining an Operator's Values Not all operators are applicable to all data types, so whether you can use an operator on a value depends on the value's type. For example, you can use all the arithmetic operators on values of type char, int, long, float, double, or decimal. However, with one exception, you can't use the arithmetic operators on values of type string or bool.So the following statement is not allowed because the string type does not support the minus operator (subtracting one string from another would be meaningless): // compile time error Console. WriteLine(â€Å"Gillingham† – â€Å"Manchester City†); The exception is that the + operator can be used to concatenate string values. The following statement writes 431 (not 44) to the console: Console. WriteLine(â€Å"43† + â€Å"1†); TIP You can use the method Int32. Parse to convert a string value to an integer if you need to perform arithmetic computations on values held as strings.You should also be aware that the type of the result of an arithmetic operation depends on the type of the operands used. For example, the value of the expression 5. 0 / 2. 0 is 2. 5; the type of both operands is double (in C#, literal numbers with decimal points are always double, not float, in order to maintain as much accuracy as possible), and so the type of the result is also double. However, the value of the expression 5 / 2 is 2. In this case, the type of both operands is int, and so the type of the result is also int. C# always rounds values down in circumstances like this.The situation gets a little more complicated if you mix the types of the operands. For example, the expression 5 / 2. 0 consists of an int and a double. The C# compiler detects the mismatch and generates code that converts the int into a double before performing the operation. The result of the operation is therefore a double (2. 5). However, although this works, it is considered poor practice to mix types in this way. C# also supports one less -familiar arithmetic operator: the remainder, or modulus, operator, which is represented by the percent symbol (%). The result of x % y is the remainder after dividing x by y.For example, 9 % 2 is 1 since 9 divided by 2 is 8, remainder 1. NOTE In C and C++, you can't use the % operator on floating-point values, but you can use it in C#. Examining Arithmetic Operators 31 SREEKANTH C# STEP BY STEP The following exercise demonstrates how to use the arithmetic operators on int values using a previously written C# program named MathsOperators. Work with arithmetic operators 1. On the File menu, point to Open, and then click Project/Solution. Open the MathsOperators project, located in the Microsoft PressVisual CSharp Step by StepChapter 2MathsOperators folder in your My Documents folder. . On the Debug menu, click Start Without Debugging. A form appears on the screen. 3. Type 54 in the left operand text box. 4. Type 13 in the right operand text box. You can now apply any of the operators to the values in the text boxes. 5. Click the – Subtraction option, and then click Calculate. The text in the Expression box changes to 54 – 13, and 41 appears in the Result box, as shown in the following graphic: 6. Click the / Division option, and then click Calculate. The text in the Expression text box changes to 54 / 13, and the number 4 appears in the Result box. In real life, 54 / 13 is 4. 53846 recurring, but this is not real life; this is C#! In C#, when you divide one integer by another integer, the answer you get back is an integer, as explained earlier. 32 SREEKANTH C# STEP BY STEP 7. Select the % Remainder option, and then click Calculate. The text in the Expression text box changes to 54 % 13, and the number 2 appears in the Result box. This is because the remainder after dividing 54 by 13 is 2 (54 – ((54 / 13) * 13) is 2 if you do the arithmetic rounding down to an integer at each stage—my old maths master at school would be horrified to b e told that (54 / 13) * 13 does not equal 54! . 8. Practice with other combinations of numbers and operators. When you're finished, click Quit. The program stops, and you return to the Visual Studio 2005 programming environment. Now take a look at the MathsOperators program code. Examine the MathsOperators program code 1. Display the Form1 form in the Design View window (click the Form1. cs[Design] tab if necessary). TIP You can quickly switch between the Design View window and the Code and Text Editor displaying the code for a form by pressing the F7 key. 2. In the View menu, point to Other Windows and then click Document Outline.The Document Outline window appears showing the names and types of the controls on the form. If you click each of the controls on the form, the name of the control is highlighted in the Document Outline window. 33 SREEKANTH C# STEP BY STEP IMPORTANT Be careful not to accidentally delete or change the names of any controls on the form while viewing them in the Document Outline window. The application will no longer work if you do. 3. Click the the two TextBox controls that the user types numbers into on the form. In the Document Outline window, verify that they are named lhsOperand and rhsOperand.When the form runs, the Text property of each of these controls holds (as strings) the numeric values you enter. 4. Towards the bottom of the form, verify that the TextBox control used to display the expression being evaluated is named expression, and that the TextBox control used to display the result of the calculation is named result. At runtime, setting the Text property of a TextBox control to a string value causes that value to be displayed. 5. Close the Document Outline window. 6. Press F7 to display the Form1. cs source file in the Code and Text Editor window. 7.In the Code and Text Editor window, locate the subtractValues method: private void subtractValues() { int lhs = int. Parse(lhsOperand. Text); int rhs = int. Parse(rhsOperand. Text); int outcome; outcome = lhs – rhs; expression. Text = lhsOperand. Text + † – † + rhsOperand. Text; result. Text = outcome. ToString(); } The first statement in this method declares an int variable called lhs and initializes it to the result of the explicit conversion of the lhsOperand. Text property to an int. (The Text property of a TextBox is a string, and must be converted to an integer before you can store it in an int. This is what the int.Parse method does) The second statement declares an int variable called rhs and initializes it to the result of the explicit conversion of the rhsOperand. Text property to an int. The third statement declares an int variable called outcome. The fourth statement subtracts the value of the rhs variable from the value of the lhs variable, and the result is assigned to outcome. The fifth statement concatenates three strings (using the + operator) and assigns the result to the expression. Text property. The sixth st atement converts the int value of outcome to a string by using the ToString method, and assigns the string to the result.Text property. 34 SREEKANTH C# STEP BY STEP The Text Property and the ToString Method I mentioned earlier that TextBox controls displayed on a form have a Text property that allows you to access the displayed contents. For example, the expression result. Text refers to the contents of the result text box on the form. Text boxes also have many other properties, such as the location and size of the text box on the form. You will learn more about properties in Chapter 14, â€Å"Implementing Properties to Access Attributes. † Every class has a ToString method.The purpose of ToString is to convert an object into its string representation. In the previous example, the ToString method of the integer object, outcome, is used to convert the integer value of outcome into the equivalent string value. This conversion is necessary because the value is displayed in the T ext property of the result field—the Text property can only contain strings. When you Controlling Precedence Precedence governs the order in which an expression's operators are evaluated. Consider the following expression, which uses the + and * operators: 2+3*4This expression is potentially ambiguous; does 3 bind to the + operator on its le

Saturday, November 9, 2019

Improvement Is Better Than Delayed Perfection

Question- † Continuous betterment is better than delayed flawlessness † A? Mark Twain ( 1835-1910 ) . Analyse this statement critically and strictly with mention to allow literature beginnings.IntroductionThis essay will be looking at the importance of quality and uninterrupted betterment at a glimpse within an educational context. The author ‘s involvement in the subject is simply to research and understand the kernel to which every constitution for whatever intent it was built upon should endeavor in uninterrupted betterment to services rendered to its clients and the community at big while keeping quality services. The focal point is to foreground any defects within the organizational pattern with which quality could still be improved upon for the good of the whole community. The construction of the essay will take an expressed reading and description of quality and uninterrupted betterment while portraying an interventionist stance at the conclusive statements made at the terminal of the essay.Literature reappraisalThe construct of QualityQuality direction is a systematic manner of vouching that organized activities happen the manner they are planned. It is a direction subject concerned with forestalling jobs from happening by making the attitudes and controls that make bar possible & A ; acirc ; By Philip Crosby Hagiographas in 2008, Winch and Gingell province that during the 1990s it became stylish to speak about â€Å" ?quality in instruction ‘ . Part of the ground for this is a renewed involvement in answerability. Why should the concern for answerability be expressed in footings of quality? One major ground is that concerns about whether or non a peculiar signifier of instruction is worthwhile have been expressed in footings of a paradigm derived from fabricating industry. â€Å" ?Quality ‘ in a commercial context strongly connotes merchandise utility and dependability. â€Å" ?Quality confidence ‘ refers to systems that are robust plenty to guarantee that merchandises that are faulty or undependable merely do non acquire made. The thought, as one quality guru has said, is to â€Å" ?get it right first clip ‘ . Of class, an artifact can be scrapped or reworked if it is faulty, but a service can non. If it is non â€Å" ?right first clip ‘ so it is non r ight. Some effectual quality confidence systems ought to be peculiarly relevant to serve countries of economic activity. Whether or non it is in the private or the public sector of the economic system, it is sometimes maintained that instruction has the features of a service industry. In peculiar, if instruction is ill provided so there is no 2nd opportunity for the receiver. A diner at a eating house who has a severely cooked repast will experience dissatisfied but will endure no lasting harm. On the other manus, the student who receives a hapless instruction may non even experience disgruntled but may endure lasting harm in footings of future life chances. It is, so, non surprising to hear that a cardinal characteristic of educational answerability is the proviso of quality confidence systems. Every facet of leading and direction across all sectors of most administrations require a sustainable attack towards guaranting quality and sustainable steps are being utilized and developed within a planetary context. This includes steps which most leaders would follow towards keeping and prolonging the strategic purposes of any administration with due considerations of internal and external forces which influences the determinations made each twenty-four hours. An illustration of what entails leading that is sustainable through quality steps can be found in a school direction system. Where the Head instructor aspires to hold really committed pupils who have good classs, a good school construction and a qualitative staff that would assist the school achieve its strategic aims successfully. But during the procedure of strategising for an academic twelvemonth other factors comes into drama i.e. client service, effectual acquisition and deployment of resources, school budget for the academic twelvemonth etc. There may be a figure of cardinal factors that would assist accomplish such successFirst, a well-devised system of service rating procedure of Search-Feedback-Act that could be put in topographic point affecting all employees, non merely direction or instructors, in developing programs for betterment.Second, all employees could be given considerable instruction and preparation to assist them better service quality and would actively and consistently promote creativeness and invention.Third, the administration that may travel off from mensurating quality strictly by the figure of ailments it gets from clients and the feelings of the caput of forces section. Alternatively, administrations implement a multi-factor index which includes quantitative points such as the length of clip clients have to pass being tested into the school, and qualitative points such as the friendliness/politeness experienced at response.The construct of Continuous bettermentContinuous betterment has been succes sfully used by the Japanese for a figure of old ages, and the Nipponese word kaizen is used to depict it. The thought of kaizen is non to sit back one time betterments have been made to a merchandise, but to be about like bees working off at a hive. Each does a small at a clip, but by adding on an incremental footing they can finally bring forth something that is much larger and better. The issue of quality can be approached in the same manner, so that really minor alterations over clip can ensue in a considerable betterment in public presentation. For illustration, the degrees of fuel efficiency in the mean barroom auto have improved dramatically over recent old ages. This has been made possible due to the cumulative effects of continual minor alterations in auto organic structure form, fuel bringing systems and engine design ( .Porter, K. , Smith, P. , Fagg, F. 2006 ) . Foskett, N. , Lumby, J. 2003 provinces that the 3rd manner of specifying quality ( in respects to uninterrupted betterment ) is to fit the current province with an imagined hereafter improved province. In other words, persons or groups non needfully take as their comparator an bing criterion or outlook but, instead, work creatively to propose ways to which a current facet of instruction could be improved. This definition is realistically based on working signifier what exist to what could be achieved. It is a universally applicable in theory in that thoughts for betterment will take into history resources and political worlds. However, the accent on uninterrupted betterment is predicated on a grade of liberty and power that may non be in all establishments or civilizations. If authoritiess impose a construction or course of study on schools/colleges, or if the internal direction constructions are hierarchal and commanding, so the freedom of staff, parents and pupils to propose ways f rontward is clearly constrained. This thought of uninterrupted betterment can be linked to Deming ‘s ( 1986 ) thought of Plan, Do, Study and Act, where a job is examined, information is gathered and a program to better it is suggested. The â€Å" ?Do ‘ portion is when the program is tested on a little graduated table, followed by the â€Å" ?Study ‘ phase, where rating of the test takes topographic point to see if any other issues have arisen. The â€Å" ?Act ‘ phase is where the program becomes standard and is carried out continuously. This leads back into the â€Å" ?Plan ‘ phase for farther analysis. The inquiry so arises of how one assures the quality of instruction. There are two replies which are non needfully incompatible with each other. The first focuses on procedures, the 2nd on results. Process-based quality confidence relies on observation of instruction and acquisition and the activities that support it, as the cardinal determiner of whether the instruction being offered is worthwhile. Inspection is the most common signifier of procedure quality confidence. Outcome-based quality confidence relies on the appraisal of the results against certain pre-agreed criterions. Examination and testing are the most common signifiers.Leadership ApproachsQualitative leading accomplishments in educational direction revolve around factors described below:Identifying the key issuesBettering Customer satisfaction and ways of mensurating itCustomer attention – preparation employees and scene criterionsEmployee engagement in overall ends of the administration.Bettering quality â€Å" † observation and benchmarkingContemplation and decisionQuality and organizational culture- Foskett, N. , Lumby, J. ( 2003 ) stated that Quality can besides be comparative to cultural norms. What appears to be choice proviso for pre-school kids in China will look really different to western eyes and frailty versa. They farther noted that steps of Quality by definition are dependent on numeral values in relation to, e.g. , scrutiny passed or scrutinies met, but such values do non needfully capture the assortment of results expected of instruction or the dynamic alterations in outlooks in the experiences of even the scholar, allow alone the all those of an establishment. Quality will therefore stay a fluid and cloudy construct, interpreted diversely in pattern, an orthodox to which many feel indebted to follow. No individual prescription will procure betterment in quality in a context as complex and animated as a school or college. The most that an educationalist can make is to stay cognizant of the impreciseness of the construct and be sensitive to both the educational and micro-political forces which affect its accomplishments, taking with attention from the overplus o f taxonomies, doctrines, good pattern and recommended procedure they can offer.MethodologyQualitative researched literature reappraisal was adopted which typically includes rationalist, interpretative, constructionist, critical, and participatory paradigms. The research worker ‘s perspective roots from the long documented history of realistic observation in real-world state of affairss. Positions of positivism scope from conservative to progressive-activist, but all involve the belief that world is external to self and can be observed utilizing tools that produce information that can be understood and interpreted by others. The essay is linked historically to societal activism through the thought that societal state of affairss can be studied, critiqued, and later changed. The essay may hold collected informations through observations or assorted signifiers of instruments and frequently derive accounts for their consequences from preexistent theory without concern for whether the survey population understands or agrees with their positions. a literature reappraisal is really much a plural instead than a remarkable one as there are many literatures a research worker must analyze to bring forth a consistent literature reappraisal. For illustration, by making qualitative research, the research worker is fall ining an on-going argument in some form or signifier. The originality of an thought, an attack, or a theoretical reinterpretation adds to bing literature. The aim of this entry is to depict the plurality of literature, to underscore the difference between general and specific literatures, to foreground how to utilize theoretical literature as a tool to increase apprehension of a capable country and prove a research inquiry or hypothesis, and to analyze the methodological analysis and information literatures that form of import parts of the research procedure. ( GIVEN, M. L. 2008 )Data findings on quality and uninterrupted betterment in educational conte xt.Wherever an educational operation is based, whether it is public or private, it needs clients, and consumer pick has increased dramatically over the past 20 old ages because of three factors: globalization, engineering and competition.TechnologyTechnology provides chances and menaces. The development of computing machine engineering in the signifier of online and blended acquisition, podcasts, webcasts and web logs can and progressively will supply consumers with the option of new self-study methods and the pick to larn with an administration in a foreign state while populating at place or working in the office. At some point interlingual rendition package may even contradict the demand for some people to larn a foreign linguistic communication. These engineerings, nevertheless, besides provide administrations with chances to supply new methods of larning and new agencies of communicating with clients. The rise of online acquisition and blended acquisition programmes, plus the en largement in province instruction of new engineering [ such as synergistic whiteboards ] means that pupils are progressively more techno-literate. It besides means that as engineering develops and becomes more portion of our mundane lives, pupils by and large expect linguistic communication categories, which in some instances take up a big portion of their disposable income, to be technologically well-equipped. The exponential growing of engineering can non be ignored as the velocity of technological promotion is improbable to decelerate down.CompetitionCompetition may come from new administrations come ining the market, as mentioned above, but it may besides look in other signifiers. As other states gain economic power, their linguistic communications become more of import and people begin to analyze them to enable them to come in that economic system. This phenomenon has already been observed ( Graddol, 1997 ) with Spanish, Arabic and Mandarin expected to derive importance over th e following decennaries, finally going a serious menace to English as a foreign linguistic communication. As economic systems develop, instruction is going progressively of import as skill becomes indispensable to happening work. An increasing figure of classs are going available, particularly in the field of computing machines and information engineering, which compete with ELT for clients, peculiarly within the preparation budget of major companies.Deriving an Edge over RivalsIf an administration has an component of its service which is different or more attractive than its rivals it is said to hold achieved competitory advantage. Deriving competitory advantage requires a transverse functional attack between an facet of selling which gathers informations about client demands and outlooks and the daily operational maps that translate those market needs into operational capablenesss. The functions of selling and pull offing the twenty-four hours to twenty-four hours operation are frequently taken by one individual in little administrations, which can do it easier to interpret client demands into operational world. In a little private linguistic communication school of 10 instructors, for illustration, the manager may be the focal point for information about the local market, the local economic system, the type of clients the school serves and how they feel about the service. In a school of this size the manager may besides be the individual who decides what classs are offered and whether the market is best served by, for illustration, offering expensive one-to-one ESP tuition for concern professionals or inexpensive general English classs for categories of 20 pupils. A not-for-profit administration may besides see prosecuting a peculiar scheme based on the sort of clients it serves. For illustration, a charitable or province ELT administration may make up one's mind to supply inexpensive walk-in English categories for deprived female parents to go to as and when they have clip. In this instance, flexibleness is the key to fulfilling the client and deriving competitory advantage. The three factors of globalization, engineering and competition mean that educational administrations have to pay increased attending to the demands and outlooks of bing and possible clients to retain them and to pull new 1s. By garnering information on clients ‘ demands and through market analysis administrations can develop a service which is different or more attractive than that of rivals. ( Walter. 2001 )DecisionIf stakeholders allow ourselves to acquire caught by the short-run disease of modern direction, non-thinking, market-driven patterns so the thought of sustainable organisation is out of the inquiry. Besides the opportunity of of all time making the degrees desired will be eliminated in all but the shortest of steps. It is necessary for every leader of the hereafter to cognize plenty about the moral side of concern and how it could be approached with sacrificial purposes through which sharing and upholding several values together among rivals would better upon planetary jobs. Or how the socio-economic net income of the organisation could be able to show or help the concerns required to reflect a longer-term position of the community at big. I would urge that every leader in every spectrum or field of survey to convey about ways through which the underlining influences surrounding the picks we make in life ( in respects to quality and uninterrupted betterment ) should reflect upon the curative social issues instead than viing. Merely as we know in the history of human dealingss over clip that competition brings about a helter-skelter province while the harmoniousness of shared values and forfeits brings about social coherence and benefits all.MentionsCrosby, P. ( 1980 ) Quality is Free. McGraw-Hill. Deming, W. ( 1986 ) Out of the Crisis. MIT. Foskett, N. , Lumby, J. ( 2003 ) Leading and pull offing education-International dimensions.London. Paul Chapman Printing Given, M. L. ( 2008 ) The SAGE Encyclopaedia of Qualitative research methods. California. Sage Publication series Graddol, D. ( 1997 ) The hereafter of English. London. The British council Porter, K. , Smith, P. , Fagg, F. ( 2006 ) Leadership and Management for HR Professionals Oxford.Butterworth-Heinemann Walker, J. ( 2001 ) . Clients ‘ Positions of TESOL â€Å" † Expectations and Perceptions The International Journal of Educational Management 15/4. MCB University Press hypertext transfer protocol: //www.emeraldinsight.com/Insight/viewPDF.jsp? Filename=html/Output/Published/EmeraldFullTextArticle/Pdf/0600150404.pdf Walker, J. ( 2007 ) Service Climate in New Zealand Language Centres Journal of EducationalAdministration 2007 Volume: 45 Issue: 3 hypertext transfer protocol: //www.emeraldinsight.com/Insight/viewPDF.jsp? Filename=html/Output/Published/EmeraldFullTextArticle/Pdf/0740450305.pdf Winch, C. , Gingell, J. ( 2008 ) Doctrine of instruction. Oxon. Routledge publishing houses