Friday, July 26, 2019
Identify and compare examples of motivation techniques used within Assignment
Identify and compare examples of motivation techniques used within Cadbury's and Nestle and briefly justify a suitable managemen - Assignment Example Company profiles of Cadbury and Nestle Cadbury limited, founded in 1824 and headquartered in London, is one of the worldââ¬â¢s largest candy makers to share 10 percent of the market. It produces and sells confectionary products offering chocolate bags, boxes and tins and chocolate bars and drinks. It is worldââ¬â¢s second largest chewing gum makers and has merged to be a multi-million multinational company (Bloomberg Business Week, 2013). Nestle, a food and beverage multinational company headquartered in Vevey, Switzerland, is worldââ¬â¢s No-1 food and Drink Company in terms of sales and worldââ¬â¢s leader in coffee market. It is worldââ¬â¢s top bottled water maker and biggest frozen pizza maker and is one of the most reputed brands name across the world (Hoovers.com, 2013). Objectives and Vision A business organization needs to describe the purpose and major objectives for which the organization exists. Objectives of an organization provide information, direction and inspiration to explicitly outline the future of the firm. The vision of a firm consists of practical ideals that offer certain goals to be accomplished in terms that can be evaluated (Hitt, Ireland and Hoskisson, 2011, p. 18). For Cadbury, quality is its promise as its reputation has been built upon quality and it promises to ensure quality in its six products line- confectionary, candy, desserts, gums, snacks and beverages. Its objectives include delivering superior shareholder returns, managing resources efficiently to ensure growth and achieve high performance. With its vision ââ¬Å"to be the biggest and the best confectionery company in the worldâ⬠, Cadbury always attempts to deliver supreme values and quality so as to become the best and biggest confectionary company in the world (Bloomberg.com, 2013). Nestle promises ââ¬ËGood Food, Good Lifeââ¬â¢ to provide best tasting, fresh and nutritious choices in a different segments of food and beverage to its targeted marke ts. Nestleââ¬â¢s objective is to become the leader in nutrition, health and wellness trusted by all its stakeholders (Nestle, 2012). Its vision is to ââ¬Ëbe a leading, competitive, nutrition, health and wellness company that delivers improved shareholder valueââ¬â¢ (Nestle.co.za, 2013). Organizational Culture and Structure Organizational structure in a firm designates formal relationship including number of levels in the management hierarchy and grouping together of individuals in to departments to ensure effective communication, coordination and integration of efforts among departments (Daft, 2010, p. 90). Organizational culture is a system of shared values, beliefs and assumptions that are established in an organization so as to influence and motivate people towards achieving the desired goals. Cadbury employs more than 4500 employees in over six countries. In 2009, the company has eliminated the regional structure to operate seven business units and leverage the category leadership across its markets. At Cadbury, the board of directors plays vital roles and responsibilities for overall management and performance and for the approval of long-term objectives. As shown in the diagram, the span of control and communication is spread among different
Thursday, July 25, 2019
Marketing H.W Essay Example | Topics and Well Written Essays - 500 words
Marketing H.W - Essay Example The production department relies on consumer preferences when producing goods. Workers On the other hand, companies hire workers from the population. Labor plays an important role in production, processing, assembly and distribution. Furthermore, labor wage rates influence the location decision. The facility location has a significant impact on transport costs. When a facility is located far away from the market, the transport costs incurred when transporting goods to the market is high. When the facility is close to the market, the cost is reduced. It is for this reason that companies want to find the optimal location which will save transport cost. Companies thus consider the costs involved before making facility location decisions. Facility relocation involves moving a facility to a different location. Facility closing means that that facility stops being function completely. In the case of relocation, the company should be ready to cover the moving costs of workers who move to the new location, and plan for transport expenses for workers who wish to travel to the new facility every day. When a facility is closed, the human resource department should explain to workers the reasons behind and if possible hire some to other facility locations. In a supply chain, warehousing helps in distribution efficiency and marketing. Warehouses are included in the supply chain because they are used for receiving new inventory, storing inventory, packaging and shipping to customers. Modern warehousing has more roles other than stocking inventory especially economic and service benefits. These include offering value added services such as additional processing in addition to storage and delivery of products. The purpose of warehouses and distribution centers is to store goods before they are transported to the consumer. The emphasis is on maximizing the space available for storage. However, the emphasis of distribution centers is the fast movement of goods through the
Wednesday, July 24, 2019
Museum Exhibit Design Coursework Example | Topics and Well Written Essays - 250 words
Museum Exhibit Design - Coursework Example In a way this commercializes art which partially necessary but may not be health if exhibitions are dependent on market forces or sale of paintings. It would make exhibits sustainable and interesting as well if workshops by known artist will be conducted along with the exhibits to engage the audience in several ways. First by letting them see the creative process of painting, by letting them experience the joy of painting through the workshop that would eventually draw larger audience. Source of revenue to sustain the exhibit is two-fold, first is on the sale of the art work and second the proceeds of the workshops. Art is not just a means to express our creative self and to heighten our aesthetic sensibility but also an effective social commentary. Presenting diversity is a wonderful theme in art narratives but limiting it to race is somewhat lacking because race is just a portion of diversity. I think it would be wonderful to include gender, diversity of perspectives and even diversity in style. A same subject probably can be rendered in diverse method and perspective. For example, the same portrait can be rendered through impressionism, classical, bistre and alla prima method giving the audience not only the narrative of the subject but also the breadth and narrative of how can it be rendered. Interpretation can also be expanded say for example, from a feminist point of view, racial point of view etch. This would provide audience different experience and perspective with the same subject and sort of educating them that there are a lot of ways to look at
Tuesday, July 23, 2019
Career Analysis of a Real Estate Enterpreneur Essay
Career Analysis of a Real Estate Enterpreneur - Essay Example Their impact lives on for generations. A real estate entrepreneur, also known as a real estate investor, is a person actively or passively involved in real estate. Real estate refers to property that consists of land together with the housing and natural resources found on it. Thus, in business, real estate is a profession that deals with sales and purchase, or renting of land, housing or buildings. An active investor may buy or make improvements on property to be sold at a later date for profit. On the other hand, a passive investor does the work of an active investor indirectly. In their case, they hire firms to buy and manage property on their behalf. Career Path Real estate is an occupation to be considered by people with a balance of industry knowledge and entrepreneurial acumen. Even though getting a job as a real estate entrepreneur may not be difficult, beginning workers face a lot of competition from seasoned and well established entrepreneurs in the field. Organizations hav e taken the liberty to chart out the path of a real estate investment. This is done in stages of training. In each stage, an employee undergoes training. Upon their success, they rise up the ranks. For instance, Keller Williams Realty has seven levels of training (Keller Williams Realty, 2012). These levels include career launch, success series and boot camps. A summary of these levels is as shown below. Trends Real estate markets have a great impact on the economy. A healthy real estate market has been known to positively drive the economy. A good example is China. According to Barboza (2010), in 2003 to 2010 period, real estate prices in Shanghai increased by over 150%. Construction of property has continued despite the threat of credit crunch. The government has benefited from this rise in prices as GDP has increased from 2% (2000) to 6% (2011) due to residential housing investment. The 2008 global recession had an adverse effect on real estate industry. Sad though, the reverse i s also true. Economies have declined as a result of an unproductive real estate industry. In America, there was a decline of people being hired into the sector. However, this changed shortly after. Between January 2011 and January 2012, there was a 20% increase in job advertisements (Lombardi, 2012). Hiring Demands in the Real Estate Industry ââ¬â 4 Year Hiring Trend Source: WANTED Analytics Technology is a significant aspect to the growing change in career trends. For part time real estate entrepreneurs, the increasing use of technology may work to their detriment in comparison to full time entrepreneurs who invest in technology. The same technology does have a positive impact. It has increased the productivity of real estate investors. It has widened the market base since they are able to access their customers and do research on various property using the internet. The internet is particularly resourceful because of the pool of information it contains. The perception of real estate as a worthwhile investment and low interest rates continue to stimulate real estate sales. This creates demand for real estate entrepreneurs. One may, therefore, choose real estate investment as a career path. The legal front also plays a vital role in determining trends in real estate. Real estate entrepreneurs need to meet certain legal requirements and adhere to certain legal conditions. Changes in legal requirements, like the disclosure laws, may discourage some who are not serious or are not abreast with such
Monday, July 22, 2019
A Significant Symbol in U.S. Contemporary History Essay Example for Free
A Significant Symbol in U.S. Contemporary History Essay The statement above is just one of the several famous and affecting quotes from a former president of the United States of America, Dwight David Eisenhower. In this short and concise statement, his general principles, beliefs, and ideologies may be observed. This man with a huge heart for peace and humanity has been perceived by millions of Americans as a tough yet upright and high-profiled symbol of the government over the decades. However, this man who has been looked up to by the whole of America may be discovered to have humble beginningsââ¬âbrought up from a simple family, he was an average boy who grew up to fulfill great dreams and great aspirations for the United States of America. On the 14th day of October in 1890, Dwight David Eisenhower, of David Eisenhower, a mechanic, and Ida Elizabeth Stover, a religious pacifist, was born (Kelly). As a child, he had to help his family and work with extra effort in order to suffice their everyday necessities. He was brought up in a simple yet very religious environment where people are exposed to real-life plain-living (The Eisenhower Foundation). He was born in Denison, Texas, but they eventually moved to Abilene in Kansas where he spent his early education in humble community schools. During this stage of his life, he was raised to be a fun loving youth who was fascinated with the Western American history and had always dreamed of getting into college and obtaining a degree which was considered an extravagance for families like his during that time (The Eisenhower Foundation). It was in Abilene where he had his early foundations, and it was also the place where he acquired his early values which eventually molded him to what people know him forââ¬âa noble and principled individual. Eisenhower joined the U. S. Military at West Point, New York on the 14th day of June in 1911 (ââ¬Å"Dwight David Eisenhowerâ⬠). Here, he was made into a principled and trained fighter which helped him to reach the rank of Second Lieutenant on September 1915. This was the start of his career in the military which have been a difficult battle and a rich learning experience as well for the fighter Eisenhower. In his entire military career, he has been blessed with the might of an ultimate warrior and a fair mind of a just leader. He has been part of several historical events such as McArthurââ¬â¢s venture to the Philippine Islands and the First and Second World War (ââ¬Å"Dwight David Eisenhowerâ⬠). Eventually, he was able to receive several recognitions due to his selfless and self-sacrificing service for the United States. On the 4th day of November in 1952, he was awarded with the greatest authority an American citizen could ever have; he became the 34th president of the Unites States of America (The Eisenhower Foundation). As it appears, the presidents of the world are given this special privilege of being immortalized through their works and principles. However, people may still question why a person such as Dwight Eisenhower should be remembered when all the other presidents seem to have done the same thing: to serve the country. As Eisenhower ventured in the greatest challenge to rule America, he was faced with serious challenges through the problems and obstacles in the political and economic sectors. The American values and the national security have been put in great risk by the powerful Europe and Asia which vexed the newly appointed president (Dwight D. Eisenhower Memorial Commission). Yet, despite these challenges, he maintained his aim on his strategies and game-plans on how he can win every battle that the country was facing at that time, such as the Cold War which he skillfully handled with utmost determination. In addition, as Eisenhower went through the most difficult and complex challenges as a president, he was able to maintain the balance in the national budget, the credibility of the countryââ¬â¢s fiscal responsibility, and the public works that were significant in the lives of his people. He became remarkable in his efforts to establish sturdy innovations to the government as a whole and to his presidency in order to improve not just the countryââ¬â¢s infrastructures but also the morale and dignity of the government (Dwight D. Eisenhower Memorial Commission). Eisenhower also had that incomparable heart for his people. He recognized the needs and the grievances of the less fortunate Americans which led him to establish agencies like the Department of Health and the Education and Welfare in 1953, while he also made improvements in the Social Security through increased benefits for millions of Americans (Dwight D. Eisenhower Memorial Commission). These were just some of his simple yet very significant efforts that will forever rest in Americansââ¬â¢ memories as he left them after a long heart ailment on the solemn day of March 28, 1969 uttering his last words, I want to go; God take me. (The Eisenhower Foundation). Among the many presidents that the United States has met, Dwight Eisenhower created a difference as inspired by his upbringing. It provided him enough courage and determination to reach greater heights. It may appear that the function and role of the American president is one of the hardest and most complicated in the world. Yet, to think that Eisenhower was able to go through it while maintaining a spiritual and fair heart is also commendable. A leader who does not allow his power and authority to rule his heart has also been attributed to Eisenhower by the people themselves. This is because while he was a man who was very well exposed to violence and wars, he spoke of peace and freedom from strife. Over his years of service, aside from literally fighting for his nation and helping to winning the wars, he was able to win the trust and confidence of his people through keeping his values and morale in his leadership strategy. Truly, it may be hard to find a perfect leader. Nevertheless, finding a leader like Eisenhower who had a sense of humor and integrity at the same time can also be one in a million chances. Considering the accounts of history which tell stories of Eisenhower as a hero of America, it may appear that he indeed played a significant role in the U. S. contemporary history. A man who led a simple life as a child and grew up to become the person with the highest authority in America but never abused his powers for wealth and personal interest is indeed worthy of remembrance. Indeed, no person must be judged according to his or her roots. Certainly, societal status does not in any way make a discerning factor to tell the worth and value of a person, because if there is any symbol and example who best represents a story of humble roots to the height of glory and honor in America, it would be undeniably someone like former President Dwight Eisenhower of the United States. Works Cited Bancroft, David G. ââ¬Å"Dwight D. Eisenhower: 34th President (1953-1961). â⬠USA Patriotism. 2002. 24 November 2008 http://www. usa-patriotism. com/quotes/eisenhower. htm. Dwight D. Eisenhower Memorial Commission. Why Memoralize Eisenhower?. 27 August 2008. 24 November 2008 http://www. eisenhowermemorial. org/whymemorializeike. htm. ââ¬Å"Dwight David Eisenhowerâ⬠. The Eisenhower Library Information Resources. September 2000. Ibiblio. 24 November 2008 http://www. ibiblio. org/lia/president/EisenhowerLibrary/_General_Materials/DDE_Biography. html. The Eisenhower Foundation. Biography: Dwight David Eisenhower October 14, 1890-March 28, 1969. 05 August 2008. Eisenhower. com. 24 November 2008 http://www. dwightdeisenhower. com/biodde. html. Kelly, Martin. ââ¬Å"Dwight D. Eisenhower- Thirty-Fourth President of the United States. â⬠About. com: American History. 24 November 2008. http://americanhistory. about. com/od/dwightdeisenhower/p/peisenhower. htm.
Sunday, July 21, 2019
Causes of the Mau Mau Rebellion in Kenya
Causes of the Mau Mau Rebellion in Kenya The Mau Mau rebellion in 1952 was undeniably caused by the growing tensions between the Kikuyu and the white European settlers in Kenya. However, despite growing unrest, the precise causes of the rebellion remain unclear. This essay will discuss a number of possible reasons for the revolt, examining the economic, social and political tensions caused by the colonial administration in an attempt to discover the real reasons for the Mau Mau rebellion and why the Kikuyu were so unhappy with their colonial administrators. Arguably one of the most important reasons for the Mau Mau rebellion was the economic deprivation of the Kikuyu. The Kikuyu had long been unhappy with white settlers in Kenya taking their land, and their economic deprivation lead to vast discontent throughout the Kikuyu.[1] Despite attempts to address this issue, the Kikuyus were ignored. Michael Coray has argued that by failing to create a system through which Africa grievances against white settlers could be settled fairly, the Kikuyu grew more dissatisfied with the colonial administrations failures,[2] thus playing a significant part in the development of the Mau Mau rebellion. Economic deprivation continued throughout colonial rule; by 1948, 1.25 million Kikuyu were restricted to 2000 square miles whilst 30,000 white settlers occupied 12,000 square miles,[3] demonstrating the extent to which the Kikuyu were disadvantaged by the white settlers, causing them anger and resentment. As a result to these poor living conditions, there w as a huge increase in the number of Kikuyu migrating to the cities; leading to poverty, unemployment and overpopulation.[4] Despite these factors, it has been argued that economic deprivation was not of particular importance in relation to why the Mau Mau rebellion broke out. Claude Welch has claimed that grievances were expressed primarily on a tribal basis as opposed to a class basis, which he uses as evidence to suggest that economic deprivation is not as significant a factor as one might believe.[5] However, regardless of whether or not it contributed greatly to the break out of the Mau Mau rebellion, there is little doubt that the unrest caused by economic deprivation had an impact on the Kikuyu, and trough this contributed to the Mau Mau rebellion. As well as economic deprivation, the Kikuyu were arguably angered by their loss of economic independence during the colonial period. As Eric Brown has stated, the loss of land to white settlers meant not only that the Kikuyu were bereft of their land, but also that they had to then find work in order to make a living; usually working for the white settlers.[6] Brown has paralleled this with Serfdom, and argues that Kikuyu reliance on white settlers caused an increase in social tensions amongst the Kikuyu.[7] Though already at a disadvantage, the Kikuyu would also earn on average only a fifth of the payment which white workers would earn for the same amount of work,[8] which only furthered the Kikuyu resentment of the settlers. Despite migrating to the cities, which one might consider puts the Kikuyu at an economic advantage, the Kikuyu were in fact disadvantaged when considering their prosperous position prior to colonial administration; coffee growing in particular was a rewarding i ndustry due to the fertile land held by the Kikuyu, and so the prohibition of coffee growing imposed by the colonial government crippled the Kikuyu.[9] In this light, a rebellion against the British settlers might be seen as inevitable. The Kikuyu were the most populous ethnic group in Kenya, with what Brown calls a flourishing society;[10] therefore, when the Mau Mau offered them an opportunity to revolt against British colonialism, the group grew rapidly.[11] One could then argue that a main reason why the Mau Mau rebellion broke out was so that the Kikuyu could regain the economic independence that they longed for, and were used to prior to colonial disruption. However, the social conditions of the Kikuyu cannot be ignored when attempting to address the main reasons for the break out of the Mau Mau rebellion. Harsh restrictions were placed upon the Kikuyu; they were taxed heavily (which when one considers that they were earning only a fifth of the wages white settlers were earning, seems particularly severe),[12] and racial tensions increased. White settlers saw the Kikuyu as agricultural competition, thus explaining why such heavy restrictions were placed upon them.[13] Disciplinary measures were introduced by white settlers on the Kikuyu who worked on their land; workers were often tortured or abused by the white settlers.[14] This horrific treatment of the Kikuyu only angered them further and caused greater discontent between black and white. Alongside their economic deprivation, the Kikuyu and other people of Africa were made to feel like outsiders within their homeland, and became alienated from society. Many Kikuyu had no choice but t o become squatters on white land, which to them seemed degrading considering the land was rightfully theirs.[15] There were also increasing tensions between the Kikuyu people themselves. Kikuyu land owners and those forced to work on white land began to despise each other; Furedi argues that this led to the land owners and their white allies releasing a wave of repression onto those with no land, thus increasing social tensions throughout Kenya.[16] This meant that poorer Kikuyu workers were not only angered by the white settlers but also by their own people, thus strengthening the argument that the Mau Mau rebellion was a peasant revolt against the wealthy and the white.[17] The vast growth of the Kikuyu Central Association also accounts for the break out of the Mau Mau rebellion in 1952. The KCA made its aims clear to reclaim the land taken from them and ran a campaign of civil disobedience in order to protest against the white settlers taking their land,[18] which demonstrates the unrest amongst the Kikuyu prior to the rebellion. The KCA also made radical demands, for example the return of their land, in hope of returning to their economic position prior to colonial rule.[19] The growth in membership of the KCA can be accounted for in the popular demands it made; for example, higher wages and the right to grow coffee again.[20] It has already been established that the Kikuyu were greatly unhappy with their social and economic position within Kenya, and so the KCA offered them an opportunity to voice their discontent and attempt to make a change through convincing the government that if their demands were not met, they would create more trouble.[21] De spite these protests, the KCA was largely ignored by the colonial government, thus furthering tensions between the two.[22] The KCAs grievances originated in the 1920s and 1930s, and so by the time the Mau Mau rebellion broke out in 1952, decades had passed with little change to benefit the Kikuyu, and therefore the rebellion had arguably been a long time coming. Consequently, the growth of the KCA reflects the growing tensions amongst the Kikuyu which led to the Mau Mau rebellion of 1952. Another key reason for the break out of the Mau Mau rebellion in 1952 was the internal divisions within the Kikuyu. It has been argued that there never was a single Mau Mau.[23] One possible reason for this argument is that the Mau Mau never made their goals clear; many have attempted to discover their goals through Mau Mau actions, and yet there is no solid evidence to suggest what the Mau Maus goals might be. Clough has argued that Mau Mau goals were political, and that they wanted to drive out the white settlers and isolate African enemies.[24] There is certainly some validity to this argument; as Clough notes, memoirs from Mau Mau meetings show that a great effort was made planning what the Mau Mau relationship should be with detained leaders, and how they would communicate with the British to get their message across,[25] demonstrating the importance of political motivations. Others have argued that their goals were economical, and that as previously stated the Kikuyu people str ived to regain their economic independence that was lost through colonialism.[26] The Mau Mau was a rapidly expanding group, and therefore the lack of a well-known, common goal meant that internal divisions were inevitable. Therefore the rebellion in 1952 was arguably caused by Mau Mau intentions to achieve something in order to avoid being seen as a radical group without a goal. However, as Lonsdale has pointed out, despite internal divisions, the Mau Mau were bound to each other by hopes of citizenship and bureaucracy,[27] and therefore perhaps the broadness of such a goal benefitted the Mau Mau rather than causing a failed uprising. It can therefore be concluded that there were a number of reasons for the break out of the Mau Mau rebellion in 1952. Arguably the most important cause of the rebellion was the economic discontent of caused by white settlers claiming Kikuyu land and its consequences. The restrictions placed upon the Kikuyu, both economically and socially, also played a significant role in the break out of the rebellion, as the Kikuyu were made to feel alienated from their own society and repressed by white settlers. However, the most likely cause of the Mau Mau rebellion was a combination of all the above factors, which led to a growth in discontent amongst the Kikuyu and left them with no other alternative than to revolt. In this sense, it can be concluded that there was not just one cause of the Mau Mau rebellion, but a vast amount of varying causes encompassing economic, social and political tensions. Bibliography Grinker, R., Perspectives on Africa: A reader in culture, history and representation (Wiley-Blackwell 1997) Shaw, C., Colonial Inscriptions: Race, Sex and Class in Kenya (University of Minnesota Press, 1995) Welch, C., Anatomy of Rebellion (SUNY Press, 1980) Mwakikagile, G., Africa and the West (Nova Publishers, 2000) Harcourt, W., Feminist Perspectives on Sustainable Development (Zed Books, 1994) Furedi, F., The Mau Mau War in Perspective (James Currey Publisers, 1989) Berman, B., and Lonsdale, J., Unhappy Valley: Conflict in Kenya and Africa (James Currey Publishers, 1992) Lonsdale, J., Foreword in Kershaw, G., Mau Mau from Below (Ohio University Press, 1997) Clough, M., Mau Mau Memoirs: History, Memory and Politics (Lynne Rienner Publishers, 1998) Odhiambo, E., and Lonsdale, J., Mau Mau and Nationhood: Arms, Authority and Narration (Ohio University Press, 2003) Kenya Information Sheet (Accessed 21st November) Eric W. Brown The Early Days of the Mau Mau Insurrection Jens Finke, Kikuyu Colonial History (Accessed December 2nd 2009) Coray, M., The Kenya Land Commission and the Kikuyu of Kiambu Agricultural History 52 (Jan 1978) [1]Grinker, R., Perspectives on Africa: A reader in culture, history and representation (Wiley-Blackwell 1997) pg. 654 [2]Coray, M., The Kenya Land Commission and the Kikuyu of Kiambu Agricultural History 52 (Jan 1978) pg. 179-93 [3] Kenya Information Sheet (Accessed 21st November) [4] Shaw, C., Colonial Inscriptions: Race, Sex and Class in Kenya (University of Minnesota Press, 1995) pg. 43 [5] Welch, C., Anatomy of Rebellion (SUNY Press, 1980) pg. 65-66 [6]Eric W. Brown The Early Days of the Mau Mau Insurrection [7] Ibid. [8] Ibid [9] Ibid. [10] Ibid. [11] Ibid. [12] Mwakikagile, G., Africa and the West (Nova Publishers, 2000) pp. 95 [13] Ibid. [14] Ibid. [15] Harcourt, W., Feminist Perspectives on Sustainable Development (Zed Books, 1994) pp. 133 [16] Furedi, F., The Mau Mau War in Perspective (James Currey Publisers, 1989) pp. 7 [17] Ibid. [18] Berman, B., and Lonsdale, J., Unhappy Valley: Conflict in Kenya and Africa (James Currey Publishers, 1992) pp. 446 [19] Jens Finke, Kikuyu Colonial History (Accessed December 2nd 2009) [20] Ibid. [21] Ibid. [22] Ibid. [23] Lonsdale, J., Foreword in Kershaw, G., Mau Mau from Below (Ohio University Press, 1997) [24] Clough, M., Mau Mau Memoirs: History, Memory and Politics (Lynne Rienner Publishers, 1998) pp. 167 [25] Ibid. [26] Brown, The Early Days of the Mau Mau Insurrection [27] Odhiambo, E., and Lonsdale, J., Mau Mau and Nationhood: Arms, Authority and Narration (Ohio University Press, 2003) pp. 77
Analysis of C Language and Operators
Analysis of C Language and Operators Introduction In order to perform different kinds of operations, C uses different kinds of operators. An operator indicates an operation to be performed on data that yields a value. Using various operators in C one link the variables and constants. An operand is a data item on which operators perform the operations. C is rich in the use of different operators. C provides four classes of operators. They are 1) Arithmetic 2) Relational 3) Logical 4) Bitwise. Apart from these basic operators, C also supports additional operators. 3.1 Types of operators Type of Operator Symbolic Representation Arithmetic operators + , -, *, / and % Relational operators >,=. Logical operators , II and ! Increment and decrement operator ++ and Assignment operator = Bitwise operators ,I,,à »,à «and Comma operator , Conditional operator ? : 3.2 PRIORITY OF OPERATORS AND THEIR CLUBBING Various relational operators have different priorities or precedence. If an arithmetic expression contains more operators then the execution will be performed according to their priorities. The precedence is set for different operators in C. List of operators with priority wise (hierarchical) are shown in Table 3.2. Table 3.2 List of operators with priority wise Operators Operation Clubbing Priority ( ) [ ] -> . Function call Array expression or square bracket Structure Operator Structure Operator Left to right 1st + ++ ! ~ * Sizeof type Unary plus Unary minus Increment Decrement Not operator Ones complement Pointer Operator Address operator Size of an object Type cast Right to Left 2nd * / % Multiplication Division Modular division Left to Right 3rd + Addition Subtraction Left to Right 4th >> Left shift Right Shift Left to Right 5th > >= Less than Less than or equal to Greater than Greater than or equal to Left to Right 6th == != Equality Inequality Left to Right 7th Bitwise AND Left to Right 8th ^ Bitwise XOR Left to Right 9th | Bitwise OR Left to Right 10th Logical AND Left to Right 11th || Logical OR Left to Right 12th ? : Conditional operator Right to Left 13th =,*=,-=, =,+=,^=, |=,>= Assignment operator Right to Left 14th , Comma operator Left to Right 15th 1) When two operators of the same priority are found in the expression, precedence is given to the extreme left operator. Example Example Example 3.3 COMMA AND CONDITIONAL OPERATOR 1) Comma operator (,) The comma operator is used to separate two or more expressions. The comma operator has the lowest priority among all the operators. It is not essential to enclose the expressions with comma operators within the parenthesis. For example the statements given below are valid. Example 2) Conditional operator (?) The conditional operator contains a condition followed by two statements or values. If the condition is true the first statement is executed otherwise the second statement. The conditional operator (?) and (:) are sometimes called ternary operators because they take three arguments. The syntax of conditional operator is as given below. Syntax Condition? (expression1): (expression2); Two expressions are separated by a colon. If the condition is true expression1 gets evaluated otherwise expression 2. The condition is always written before? Mark. Example Example 3.4 ARITHMETIC OPERATORS There are two types of arithmetic operators. They are 1) Binary Operator and 2) Unary Operator a) Binary operator Table 3.3 shows different arithmetic operators that are used in C. These operators are commonly used in most of the computer languages. These arithmetic operators are used for numerical calculations between the two constant values. They are also called as Binary Arithmetic Operators. The examples are also shown in the Table 3.3 In the program variables are declared instead of constants. Table 3.3 Arithmetic operators Arithmetic Operators Operator Explanation Examples + Addition 2+2=4 Subtraction 5-3=2 * Multiplication 2*5=10 / Division 10/2=5 % Modular Division 11%3=2 (Remainder 2) b) Unary Operators Unary operators are increment operator (++), decrement (- -) and minus (-) . These operators and their descriptions are given in the Table 3.4. Table 3.4 Unary arithmetic operators Operator Description or Action Minus ++ Increment Decrement Address Operator Size of Gives the size of variable a) Minus (-) Unary minus is used to indicate or change the algebraic sign of a value. b) Increment (++) Decrement () Operators The C compilers produce very fast efficient object codes for increment and decrement operations. This code is better than generated by using the equivalent assignment statement. So, increment and decrement operators should be used whenever possible. â⬠¢ The operator ++ adds one to its operand. Whereas the operator subtracts one from its operand. For justification x=x+1 can be written as x++; and x=x-1; can be written as x;. Both these operators may either follow or precede the operand. That is, x=x+ 1; can be represented as x++; 01 ++x; If ++ or are used as a suffix to the variables name then the post increased / decreased operations take place. Consider an example for understanding ++ operator as a suffix to the variable. x=20; y=10; z=x*y++; In the above equation the current value of y is used for the product. The result is 200, which is assigned to z. After multiplication, the value of y is increased by one. If ââ¬Å"++ or -ââ¬Å"are used as a prefix to the variable name then pre increment/ decrement operations take place. Consider an example for understanding ++ operator as a prefix to the variable. x=20; y=10; z=x*++y; In the above equation the value of y is increased and then used for multiplication. The result is 220, which is assigned to z. The following programs can be executed for verification of increment and decrement operations. Example 3.4 Example 3.5 c) Size of 0 and Operator The size of ( ) operator gives the bytes occupied by a variable. The number of bytes occupied varies from variable to variable depending upon its dab types. The operator prints address of the variable in the memory. The example given below illustrates the use of both the operators. Example 3.6 3.5 RELATIONAL OPERATORS These operators are used to distinguish between two values depending on their relations. These operators provide the relationship between the two expressions. If the relation is true then it returns a value 1 otherwise 0 for false relation. The relational operators together with their descriptions, example and return value are described in Table 3.5. Table 3.5 Relational Operator Operators Description or Action Example Return Value > Greater than 5>4 1 >= Greater than equal to 11>=5 1 = = Equal to 2==3 0 ! = Not equal to 3!=3 0 The relational operators symbols are easy to understand. They are self-explanatory. However readers benefit a program is illustrated below. Example 3.7 Example 3.8 Example 3.9 Example 3.10 3.6 LOGICAL OPERATORS The logical relationship between the two expressions are checked with logical operators. Using these operators two expressions can be joined. After checking the conditions it provides logical true (1) or false (0) status. The operands could be constants, variables, and expressions. The Table 3.6 describes the three logical operators together with examples and their return values. Table 3.6 Logical Operators Operator Description or Action Example Return Value Logical AND 5>3 5 || Logical OR 8>5 || 8 ! Logical NOT 8 ! = 8 0 From the above table following rules can be followed for logical operators. 1) The logical AND ( ) operator provides true result when both expressions are true otherwise 0. 2) The logical OR (I I) operator provides true result when one of the expressions is true otherwise 0. 3) The logical NOT operator (!) provides 0 if the condition is true otherwise 1. Example 3.11 Example 3.12 Example 3.13 Example 3.14 Example 3.15 Example 3.16 3.7 BITWISE OPERATORS C supports a set of bitwise operators as listed in the Table 3.7. C supports six bit operators. These operators can operate only on integer operands such as int, char, short, long int etc. Table 3.7 Bitwise operators Operator Meaning >> Right shift ^ Bitwise xor (Exclusive OR) ~ Ones complement Bitwise AND | Bitwise OR Example 3.17 Example 3.18 Example 3.19 Example 3.20 Example 3.21 SUMMARY You have now studied the various operators such as arithmetic, logical and relational which are essential to write and execute programs. The precedence of the operators in the arithmetic operations furnished in the form of a table. The conditional comma operators and programs on them, also described in this chapter. You are made aware of the logical operators OR, AND and NOT. Full descriptions on bit wise operators have been illustrated. Numerous Simple examples have been provided to the users to understand the various operators. The reader is expected to write more programs on this chapter. EXCERSICES Answer the following questions. 1. Explain different types of operators available in C? 2. What are the uses of comma (,) and conditional (?) operators? 3. What are Unary operators and their uses? 4. Describe logical operators with their return values? 5. Distinguish between logical and bitwise operators. 6. What are the relational operators? 7. What is the difference between = and = = ââ¬Ë? 8. What are the symbols used for a) OR b) AND c) XOR d) NOT operations? 9. Explain the precedence of operators in arithmetic operations? 10. List the operators from higher priority to least priority? 11. What is the difference between %f and %g? 12. What is the difference between division and modular division operations? 13. What are the ASCII codes? List the codes for digits 1 to 9, A to Z and a to z. We have already seen that individual constants, variables, array elements and function references joined together by various operators to form expressions. We have also mentioned that C includes a number of operators which fall into several different categories. In this chapter we examine certain of categories in detail. Specifically, we will see how arithmetic operators, unary operators, relational and logical operators, assignment operators and the conditional operator are used to form expressions. The data items that operators act upon are called operands. Some operators require two operands, while others act upon only one operand. Most operators allow the individual operands to be expressions. A few operator permit only single variables as operands (more about this later). 3.1 ARITHMETIC OPERATORS There are five arithmetic operators in C. They are Operator Purpose + addition subtraction * multiplication / division % remainder after integer division The %operator is sometimes referred to as the modulus operator. There is no exponentiation operator in C. However, there is a library function (pow) to carry out exponentiation (see Sec.3.6). The operands acted upon by arithmetic operators must represent numeric values. Thus, the operands can be integer quantities, floating-point quantities or characters (remember -that character constants represent integer values, as determined by the computers character set). The remainder operator (%) requires that both operands be integers and the second operand be nonzero. Similarly, the division operator (I) requires that the second operand be nonzero. Division of one integer quantity by another is referred to as integer division. This operation always results in a truncated quotient (i.e., the decimal portion of the quotient will be dropped). On the other hand if a division operation is carried out with two floating-point numbers, or with one floating-point number and one integer, the result will be a floating-point quotient. EXAMPLE 3.1 EXAMPLE 3.2 EXAMPLE 3.3 Operands that differ in type may undergo type conversion before the expression takes on its final value. In general, the final result will be expressed in the highest precision possible, consistent with the data types of the operands. The following rules apply when neither / operand is unsigned. 1. If both operands are floating-point types whose precisions differ (e.g., a float and a double), the lower precision operand will be converted to the precision of the other operand, and the result will be expressed in this higher precision. Thus, an operation between a float and a double will result in a double; a float and a long double will result in a long double; and a double and a long double will result in a long double. (Note: In some versions of C, all operands of type float are automatically converted to double.) 2. If one operand is a floating-point type (e.g., float, double or long double) and the other is a char or an int (including short int or long int), the char or int will be converted to the floating-point type and the result will be expressed as such. Hence, an operation between an int and a double will result in a double. 3. If neither operand is a floating-point type but one is a long int, the other will be converted to long int and the result will be long into Thus, an operation between a long int and an int will result in a long int. 4. If neither operand is a floating-point type or a long int, then both operands will be converted to int (if necessary) and the result will be into Thus, an operation between a short int and an int will result in an int. A detailed summary of these rules is given in Appendix D. Conversions involving unsigned operands are also explained in Appendix D. EXAMPLE 3.4 EXAMPLE 3.5 EXAMPLE 3.6 EXAMPLE 3.7 EXAMPLE 3.8 EXAMPLE 3.9 3.2 UNARY OPERATORS C includes a class of operators that act upon a single operand to produce a new value. Such operators are known as unary operators. Unary operators usually precede their single operands, though some unary operators are written after their operands. Perhaps the most common unary operation is unary minus, where a numerical constant, variable or expression is preceded by a minus sign. (Some programming languages allow a minus sign to be included as a part of a numeric constant. In C, however, all numeric constants are positive. Thus, a negative number is actually an expression, consisting of the unary minus operator, followed by a positive numeric constant.) Note that the unary minus operation is distinctly different from the arithmetic operator which denotes subtraction (-). The subtraction operator requires two separate-operands. 3.3 RELATIONALAND LOGICAL OPERATORS There are four relational operators in C. They are Operator Meaning > greater than >= greater than or equal to These operators all fall within the same precedence group, which is lower than the arithmetic and unary operators. The associatively of these operators is left to right. Closely associated with the relational operators are the following two equality operators. Operator Meaning == equal to != not equal to The equality operators fall into a separate precedence group, beneath the relational operators. These operators also have a left-to-right associatively. These six operators are used to form logical expressions, which represent conditions that are either true or false. The resulting expressions will be of type integer, since true is represented by the integer value 1 and false is represented by the value 0. EXAMPLE 3.15 EXAMPLE 3.16 EXAMPLE 3.17 EXAMPLE 3.18 EXAMPLE 3.19 EXAMPLE 3.20 3.4 ASSIGNMENT OPERATORS There are several different assignment operators in C. All of them are used to form assignment .expressions which assign the value of an expression to an identifier. The most commonly used assignment operator is = Assignment expressions that make use of this operator are written in the form identifier = expression where identifier generally represents a variable, and expression represents a constant, a variable or a more complex expression. EXAMPLE 3.21 Remember that the assignment operator = and the equality operator == are distinctly different. The assignment operator is used to assign a value to an identifier, whereas the equality operator is used to determine if two expressions have the same value. These operators cannot be used in place of one another. Beginning programmers often incorrectly use the assignment operator when they want to test for equality. This results in a logical error that is usually difficult to detect. Assignment expressions are often referred to as assignment statements, since they are usually written as complete statements. However, assignment expressions can also be written as expressions that are included within other statements (more about this in later chapters). If the two operands in an assignment expression are of different data types, then the value of the expression on the right (i.e., the right-hand operand) will automatically be converted to the type of the identifier on the left. The entire assignment expression will then be of this same data type. Under some circumstances this automatic type conversion can result in an alteration of the data being assigned. For example: A floating-point value may be truncated if assigned to an integer identifier. A double-precision value may be rounded if assigned to a floating-point (single-precision) identifier. An integer quantity may be altered if assigned to a shorter integer identifier or to a character identifier (some high-order bits may be lost). Moreover the value of a character constant assigned to a numeric-type identifier will be dependent upon the particular character set in use. This may result in inconsistencies from one version of C to another. The careless use of type conversions is a frequent source of error among beginning programmers. EXAMPLE 3.22 EXAMPLE 3.23 EXAMPLE 3.24 EXAMPLE 3.25 THE CONDITIONAL OPERATOR Simple conditional operations can be carried out with the conditional operator (? :). An expression that makes use of the conditional operator is called a conditional expression. Such an expression can be written in place of the more traditional if -else statement, which is discussed in Chap.6. A condition expression is written in the form expression 1 ? expression 2 : expression 3 When evaluating a conditional expression, expression 1 is evaluated first. If expression 1 is true (i.e., if, its value is nonzero), then expression 2 is evaluated and this becomes the value of the conditional expression. However, if expression 1 is false (i.e., if its value is zero),then expression 3 is evaluated and this becomes the value of the conditional expression. Note that only one of the embedded expressions (either expression 2 or expression 3) is evaluated when determining the value of a conditional expression. EXAMPLE 3.26 EXAMPLE 3.27 EXAMPLE 3.28 EXAMPLE 3.29 LIBRARY FUNCTIONS The C language is accompanied by a number of library functions that carry out various commonly used operations or calculations. These library functions are not a part of the language per se, though all implementations of the language include them. Some functions return a data item to their access point; others indicate whether a condition is true or false by returning a 1 or a 0, respectively; still others carry out specific operations on data items but do not return anything. Features which tend to be computer-dependent are generally written as library functions. For example, there are library functions that carry out standard input/output operations (e.g., read and write characters, read and write numbers, open and close files, test for end of file, etc.), functions that perform operations on characters (e.g., convert from lower- to uppercase, test to see if a character is uppercase, etc.), and function that perform operations on strings (e.g., copy a string, compare strings, concatenate strings, etc.), and functions that carry out various mathematical calculations (e.g., evaluate trigonometric, logarithmic and exponential functions, compute absolute values, square roots, etc.). Other kinds of library functions are also available. Library functions that are functionally similar are usually grouped together as (compiled) object programs in separate library files. These library files are supplied as a part of each C compiler. All C compilers contain similar groups of library functions, though they lack precise standardization. Thus there may be some variation in the library functions that are available in different versions of the language. A typical set of library functions will include a fairly large number of functions that are common to most C compilers such as those shown in Table 3-2 below. Within this table, the column labeled type refers to the data type of the quantity that is returned by the function. The void entry shown for function srand indicates that nothing is returned by this function. A more extensive list, which includes all of the library functions that appear in the programming examples presented in this book, is shown in Appendix H. For complete list, see the programmers reference manual that accompanies your particular version of C. A library function is accessed simply by writing the function name, followed by a list of arguments that represent information being passed to the function. The arguments must be enclosed in parentheses and separated by commas. The arguments can be constants, variable names, or more complex expressions. The parentheses must be present, even if there are no arguments. A function that returns a data item can appear anywhere within an expression, in place of a constant or an identifier(i.e., in place of a variable or an array element). A function that carries out operations on data items but does not return anything can be accessed simply by writing the function name, since this type of function reference constitutes an expression statement. Table 3-2 Some Commonly Used Library Functions Function Type Purpose abs(i) Int Return the absolute value of i. ceil(d) double Round up to the next integer value (the smallest integer that is greater than or equal to d). cos(d) double Return the cosine of d. cosh (d) double Return the hyperbolic cosine of d. exp (d) double Raise e to the power d (e =2.7182818. .. is the base of the natural (Naperian) system of logarithms). fabs (d) double Return the absolute value of d. floor (d) double Round down to the next integer value (the largest integer that does not exceed d). fmod (d1,d2) double Return the remainder (i.e., the noninteger part of the quotient) of d1/d2, with same sign as d1. getchar () int Enter a character from the standard input device. log (d) double Return the natural logarithm of d. pow (d1,d2) double Return d1 raised to the d2 power. printf(â⬠¦) int Send data items to the standard output device (arguments are complicated see Chap. 4). pitcher à © int Send a character to the standard output device rand ( ) int Return a random positiv e integer. sin (d) double Return the sine of d. sqrt (d) double Return the square root of d. srand (u) void Initialize the random number generator. scanf(â⬠¦) int Enter data items from the standard input device (arguments are complicated see Chap. 4). tan (d) double Return the tangent of d. toascii à © int Convert value of argument to ASCII. tolower à © int Convert letter to lowercase toupper à © int Convert letter to uppercase. Note: Type refers to the data type of the quantity that is returned by the function. c denotes a character-type argument i denotes an integer argument d denotes a double-precision argument u denotes an unsigned integer argument EXAMPLE 3.30 EXAMPLE 3.31 Review Questions 1. What is an expression? What are its components? 2. What is an operator? Describe several different types of operators that are included in C. 3. What is an operand? What is the relationship between operators and operands? 4. Describe the five arithmetic operators in C. Summarize the rules associated with their use. 5. Summarize the rules that apply to expressions whose operands are of different types. 6. How can the value of an expression be converted to a different data type? What is this called? 7. What is meant by operator precedence? What are the relative precedenceââ¬â¢s of the arithmetic operators? 8. What is meant by associativity? What is the associativity of the arithmetic operators? 9. When should parentheses be included within an expression? When should the use of parentheses be avoided. 10. In what order are the operations carried out within an expression that contains nested parentheses? 11. What are unary operators? How many operands are associated with a unary op erator? 12. Describe the six unary operators discussed in this chapter. What is the purpose of each? 13. Describe two different ways to utilize the increment and decrement operators. How do the two method differ? 14. What is the relative precedence of the unary operators compared with the arithmetic operators? What is their associativity? 15. How can the number of bytes allocated to each data type be determined for a particular C compiler? 16. Describe the four relational operators included in C. With what type of operands can they be used? What type of expression is obtained? 17. Describe the two equality operators included in C. How do they differ from the relational operators? 18. Describe the two logical operators included in C. What is the purpose of each? With what type of operands can they be used? What type of expression is obtained? 19. What are the relative precedenceââ¬â¢s of the relational, equality and logical operators with respect to one another and with respect to the arithmetic and unary operators? What are their associativities? 20. Describe the logical not (logical negation) operator. What is its purpose? Within which precedence group is it included? How many operands does it require? What is its associativity? 21. Describe the six assignment operators discussed in this chapter. What is the purpose of each? 22. How is the type of an assignment expression determined when the two operands are of different data types? In what sense is this situation sometimes a source of programming errors? 23. How can multiple assignments be written in C? In what order will the assignments be carried out? 24. What is the precedence of assignment operators relative to other operators? What is their associativity? 25. Describe the use of the conditional operator to form conditional expressions. How is a conditional expression evaluated? 26. How is the type of a conditional expression determined when its operands differ in type? 27. How can the conditional op erator be combined with the assignment operator to form an if -else type statement? 28. What is the precedence of the conditional operator relative to the other operators described in this chapter? What is its associativity? 29. Describe, in general terms, the kinds of operations and calculations that are carried out by the C library functions. 30. Are the library functions actually a part of the C language? Explain. 31. How are the library functions usually packaged within a C compiler? 32. How are library functions accessed? How is information passed to a library function from the access point? 33. What are arguments? How are arguments written? How is a call to a library function written if there are no arguments? 34. How is specific information that may be required by the library functions stored? How is this information entered into a C program? 35. In what general category do the #define and #include statements fall? INTRODUCTION C supports a rich set of operators. We have already used several of them, such as =, +. -, *, and, C operators can be classified into a number of categories. They include: 1. Arithmetic operators. 2. Relational operators. 3. Logical operators. 4. Assignment operators. 5. Incrementand decrement operators. 6. Conditional operators. 7. Bitwiseoperators. 8. Speciaolperators. 3.2 ARITHMETIC OPERATORS C provides all the basic arithmetic operators. They are listed in Table 3.1. The operators +, -, * and I all work the same way as they do in other languages. These can operate on any built-in data type allowed in C. The unary minus operator, in effect, multiplies its single operand by -1. Therefore, a number preceded by a minus sign changes its sign. Table 3.1 Arithmetic Operators Operator Meaning + Addition or unary plus Subtraction or unary minus * Multiplication / Division % Modulo division Integer division truncates any fractional part. The modulo division produces the remainder of an integer division. Examples of arithmetic operators are: a ââ¬â b a + b a * b a / b a % b -a * b Here a and b are variables and are known as operands. The modulo division operator % cannot be used on floating point data. Note that C does not have an operator for exponentiation. Older versions of C does not support unary plus but ANSI C supports it. Integer Arithmetic When both the operands in a single arithmetic expression such as a+b are integers, the expression is called an integer expression, and the operation is called integer arithmetic. Integer arithmetical ways yields an integer value. The largest integer value depends on the machine, as pointed out earlier. In the above examples, if a and b are integers, then for a = 14 and b = 4 we have the following results: a b = 10 a + b = 18 a*b=56 a / b = 3 (decimal part truncated) a % b = 2 (remainder of division) During integer division, if both the operands are of the same sign, the result is truncated towards zero. If one of them is negative, the direction of truncation is implementation dependent. That is, 6/7 = 0 and -6/-7 = 0 but -6/7 may be zero or -1. (Machine dependent) Similarly, during modulo division, the sign of the result is always the sign of the first operand (the dividend.) That is -14 % 3 = -2 -14 % -3 = -2 14 % -3 = 2 EXAMPLE 3.1 Real Arithmetic An arithmetic operation involving only real operands is called eal arithmetic. A real operand may assume values either in decimal or exponential notation. Since floating point values are rou
Subscribe to:
Posts (Atom)