Friday, August 30, 2019
The Papaer Java Test Questions and Answers
Gaddis ââ¬â Starting Out With Java 5 ââ¬â From Control Structures to Objects Chapter 06 ââ¬â A First Look At Classes Multiple Choice 1. One or more objects may be created from a(n)_____. a. field b. class c. method d. instance ANS: B 2. Class objects normally have _____ that perform useful operations on their data, but primitive variables do not. a. fields b. instances c. methods d. relationships ANS: C 3. In the cookie cutter method: Think of the _____ as a cookie cutter and _____ as the cookies. a. object; classes b. class; objects c. class; fields d. field; methods ANS: B 4. A UML diagram does not contain _____. . class name b. methods c. fields d. object names ANS: D 5. An access specifier indicates how the class may be accessed. a. True b. False ANS: A 6. Data hiding, which means that critical data stored inside the object is protected from code outside the object is accomplished in Java by _____. a. using the public access specifier on the class methods b. using the private access specifier on the class methods c. using the private access specifier on the class definition d. using the private access specifier on the class fields ANS: D 7. For the following code, which statement is not true? ublic class Sphere { private double radius; public double x; private double y; private double z; } a. x is available to code that is written outside the Sphere class. b. radius is not available to code written outside the Sphere class. c. radius, x, y, and z are called members of the Sphere class. d. z is available to code that is written outside the Sphere class. ANS: D 8. Which of the following is not part of the method header? a. Method name b. Return type c. Access specifier d. Parameter variable declaration e. All of the above are parts of the method header ANS: E 9.A method that stores a value in a classââ¬â¢s field or in some other way changes the value of a field is known as a mutator method. a. True b. False ANS: A 10. You should not define a cl ass field that is dependent upon the values of other class fields _____. a. in order to avoid having stale data b. because it is redundant c. because it should be defined in another class d. in order to keep it current ANS: A 11. The following UML diagram entry means _____ + setHeight(h : double) : void a. this is a public field called Height and is a double data type b. this is a private method with no parameters and returns a double data type c. his is a private field called Height and is a double data type d. this is a public method with a parameter of data type double and does not return a value ANS: D 12. Instance methods should be declared static. a. True b. False ANS: B 13. Methods that operate on an objectââ¬â¢s fields are called a. instance variables b. instance methods c. public methods d. private methods ANS: B 14. The scope of a private instance field is a. the instance methods of the same class b. inside the class, but not inside any method c. inside the parentheses of a method header d. the method in which they are defined ANS: A 15.A constructor is a method that is automatically called when an object is created. a. True b. False ANS: A 16. A constructor a. always accepts two arguments b. has return type of void c. has the same name as the class d. always has an access specifier of private ANS: C 17. Shadowing is the term used to describe where the field name is hidden by the name of a local or parameter variable. a. True b. False ANS: A 18. Which of the following statements will create a reference, str, to the String, ââ¬Å"Hello, Worldâ⬠? a. String str = ââ¬Å"Hello, Worldâ⬠; b. string str = ââ¬Å"Hello, Worldâ⬠; c. String str = new ââ¬Å"Hello, Worldâ⬠; . str = ââ¬Å"Hello, Worldâ⬠; ANS: A 19. Two or more methods in a class may have the same name as long as a. they have different return types b. they have different parameter lists c. they have different return types, but the same parameter list d. you cannot ha ve two methods with the same name ANS: B 20. Given the following code, what will be the value of finalAmount when it is displayed? public class Order { private int orderNum; private double orderAmount; private double orderDiscount; public Order(int orderNumber, double orderAmt, double orderDisc) { orderNum = orderNumber; orderAmount = orderAmt; rderDiscount = orderDisc; } } public class CustomerOrder { public static void main(String[] args) { int ordNum = 1234; double ordAmount = 580. 00; double discountPer = 0. 1; Order order; double finalAmount = order. orderAmount ââ¬â order. orderAmount * order. orderDiscount; System. out. println(ââ¬Å"Final order amount = $â⬠+ finalAmount); } } a. 528. 00 b. 580. 00 c. There is no value because the constructor has an error. d. There is no value because the object order has not been created. ANS: D 21. A class specifies the _____ and _____ that a particular type of object has. a. relationships; methods b. ields; object names c. field s; methods d. relationships; object names ANS: C 22. ____ refers to the combining of data and code into a single object. a. Data hiding b. Abstraction c. Object d. Encapsulation ANS: D 23. Another term for an object of a class is ____. a. access specifier b. instance c. member d. method ANS: B 24. In this book the general layout of a UML diagram is a box that is divided into three sections. The top section has the ____; the middle section holds ____; the bottom section holds ____. a. class name; fields; methods b. class name; object name; methods c. object name; fields; methods . object name; methods; fields ANS: A 25. The public access specifier for an field indicates that the field may not be accessed by statements outside the class. a. True b. False ANS: B 26. For the following code, which statement is not true? public class Circle { private double radius; public double x; private double y; } a. x is available to code that is written outside the Circle class. b. radius is not ava ilable to code written outside the Circle class. c. radius, x, and y are called members of the Circle class. d. y is available to code that is written outside the Circle class.ANS: D 27. It is common practice in object-oriented programming to make all of a classââ¬â¢s _____. a. methods private b. fields private c. fields public d. fields and methods public ANS: B 28. After the header, the body of the method appears inside a set of a. brackets, [] b. paretheses, () c. braces, {} d. double quotes, ââ¬Å"â⬠ANS: C 29. A method that gets a value from a classââ¬â¢s field but does not change it is known as a mutator method. a. True b. False ANS: B 30. In UML diagrams, a ____ indicates the member is private and a _____ indicates the member is public. a. *; / b. ; @ c. ââ¬â; + d. (); : ANS: C 31. In a UML diagram to indicate the data type of a variable enter a. the variable name followed by the data type b. the variable name followed by a colon and the data type c. the class name followed by the variable name followed by the data type d. the data type followed by the variable name ANS: B 32. Instance methods do not have the key word static in their headers. a. True b. False ANS: A 33. When an object is created, the fields associated with the object are called a. instance fields b. instance methods c. fixed fields d. class instancesANS: A 34. A constructor is a method that a. returns an object of the class. b. never receives any arguments. c. with the name (class name). constructor. d. performs initialization or setup operations. ANS: D 35. The term ââ¬Å"default constructorâ⬠is applied to any constructor that does not accept arguments. a. True b. False ANS: B 36. The scope of a public instance field is a. only the class in which it is defined b. inside the class, but not inside any method c. inside the parentheses of a method header d. the instance methods and methods outside the class ANS: D 37.When a local variable in an instance method has th e same name as an instance field, the instance field hides the local variable. a. True b. False ANS: B 38. Which of the following statements will create a reference, str, to the string, ââ¬Å"Hello, worldâ⬠? A. String str = new String(ââ¬Å"Hello, Worldâ⬠); B. String str = ââ¬Å"Hello, worldâ⬠; a. A b. B c. A and B d. Neither A or B ANS: C 39. Overloading means multiple methods in the same class a. have the same name, but different return types b. have different names, but the same parameter list c. have the same name, but different parameter lists d. perform the same function ANS: C
Thursday, August 29, 2019
Perfect Pizzeria: Case study Essay
Job satisfaction is a key driver to corporate success. It is clear that at Perfect Pizzeria employees are dissatisfied with their work environment. In order to overcome job dissatisfaction, one might influence employee motivation by applying the expectancy theory ââ¬â the theory of motivation that suggests employees are more likely to be motivated when they perceive their efforts will result in successful performance and ultimately, desired rewards and outcomes (McShane and Travaglione 2007, p146). The effort-to-performance (E-to-P) expectancy is the belief that increased effort will lead to increased performance. In the present case, the company has no systemic criteria in hiring and formal training for mangers reduce the capability of performing the job successfully. Also, the indistinct role perception for night managers to perform regular employeesââ¬â¢ duties and for assistant managers to learn bookkeeping and management reduce efficiency. In order to strengthen the individualââ¬â¢s belief that s/he is able to perform the task, the company should select the appropriate person with the required skills to do the job and to clearly communicate the tasks required for each position. Furthermore, managers should provide the necessary support to get the job done and to create workforce harmony. The performance-to-outcome (P-to-O) expectancy is the belief that performance at a certain level will result in the attainment of outcomes. The case suggested that employees are not reward based on their performance as they only earn the minimum wage. On the other hand, mangers are rewarded based on the percentage of food unsold or damaged, which is not highly correlated to performance. In order to increase the belief that good performance will result in valued outcome, the company should transparent the process that determines employeeââ¬â¢s reward and explain the outcome that will result from the desired performance. Most importantly there should be an accurate measure of job performance in place. The outcome valence (V) is the importance that the individual places upon the expected outcome. Employees may mainly motivated by money and equality, which is deprived at the present situation. In order to ensure rewards are valued by employees, the company should distribute bonus for desiredà performance and promote fairness within the company. The MARS model of individual behaviour highlights four factors that influence employeesââ¬â¢ behaviour and explain the current resulting performance (McShane and Travaglione 2007, p36). The inequality of reward to performance discourage efforts (motivation), the mismatch of individual competencies with job requirement undermine employeesââ¬â¢ performance (ability), the replicate of duties between night managers and regular employees and assistant managers dimmed their assigned tasks (role perceptions), and the retaliatory measures between managers and employees restrains employees to achieve their performance potential. To overcome the motivation problem, the company should promote equality in the distribution of rewards. The Equity theory suggests that employees strive for equity between themselves and other workers, therefore positive outcomes and high levels of motivation can be expected only when employees perceive their treatment to be fair ââ¬â when the ratio of employee outcomes over inputs is equal to other employee outcomes over inputs (McShane and Travaglione 2007, p154). The first move to adjust the under-reward inequity for employees is to make them engage in organizational citizenship by mobilizing qualified workers to full-time job. The company should have a competency-based reward system in place. When employees show exceptional competence in workforce, their pay will get increase with the skills demonstrated in order to reinforce the probability of that specific behavior ââ¬â positive reinforcement. On the other hand, instead of having a percentage of food unsold or damaged b onus scheme, managers should be rewarded based on their performance and qualification. This would be an equitable solution for both managers and employees. To overcome the ability problem, the company should select employees whose existing competencies best fit the required tasks. This mismatch of ability can be seen where relatively young and inexperienced managers are performing challenging tasks, whereas having highly educated employees responsible for less challenging tasks. A solution for that is to increase the capability of college qualified employees through job design. Having the requiredà knowledge and educational background employees may get promote to perform those challenging tasks. To support multi-skilling, the company should exercise job rotation by moving employees from one job to another to enable them to learn several jobs. Moreover, job enlargement also increases skill variety, and work efficiency and flexibility. To ensure high satisfaction and performance, employees need to have autonomy as well as job knowledge. As shown in the case, with the absence of supervisor the unsold or damaged food percentage remained at a low level. This led us to another important point ââ¬â job enrichment. The heart of job enrichment is to give employees more freedom. To avoid the misuse of freedom, value congruence within the organization become significant, as such all employees share a common value to achieve a common objective. To overcome the problem of role perceptions, the process of goal setting is dominant by clarifying employees their role perceptions by establishing performance objectives (McShane and Travaglione 2007, p149). The goal has to be specific and relevant. For example, the role of night managers is to control the operation in the evenings (relevant) and to report the accurate employee mistake and burned pizza (specific). Yet the night managers should be committed to accomplishing the challenging goal set. This refers back to the E-to-P expectancy, the more belief that the goal can be accomplished, the more committed the night mangers are to the goal. Last but not least, to overcome the tension between managers and employees the building up of organizational commitment is essential. Managers should treat employees with justice and support, in which to retrieve the benefits employees had ââ¬â free pizzas, salads or drinks to build affective commitment and organizational justice discussed above. In addition the building up of trust is equally important, therefore to intimidate with a lie detector ought to be abolished. Employee feel obliged to work for an organization only when they trust their leaders. Therefore, with high levels of affective commitment employees are less likely to leave the organization, and have a higher work motivation as well as somewhat higher job satisfaction. Reference List McShane, S. and Travaglione, T. (2007), Organizational Behaviour on the Pacific Rim, 2nd Edition, North Ryde: McGraw-Hill Australia.
Effects on Saudi Arabia due to the events of the winter of 2010-2011 Research Paper
Effects on Saudi Arabia due to the events of the winter of 2010-2011 - Research Paper Example Saudi allies have fallen out of power in recent months, including former Egyptian president Hosni Mubarak. King Abdullah of Saudi Arabia responded quickly by distributing about $36 billion in state funds to youth throughout the country, hoping that money would satisfy any lurking desire to follow the examples of other Arab populations. The result, however, of the Arab uprisings has affected the population of Saudi Arabia, as demands for reform are being offered to the government while protests are emerging for different causes but with small turnouts. The list of demands includes lower taxes, better support for those unable to work, a solution to unemployment rates, higher minimum wages, and a cancellation of some restrictions on women (Barââ¬â¢el). However, this is hardly radical, as this list calls for only a brief number of economic changes and very little social reform, even concerning women. What it lacks is any demand for governmental reform, regime change, civil liberties, or religious freedom. When compared to the revolutions of other Arab states, the issues in Saudi Arabia are of an entirely different nature. These demonstrations, however, have already been met with a violent response, urging them into the same categories of neighboring movements. Human Rights Watch claims that over 160 dissidents have been locked up since February. Protests were not limited to the usual Sunni Muslim citizens of Saudi Arabia, but also consisted of separate movements by Shia members of society who were speaking out against religious intolerance and the imprisonment of peaceful activists. As if reaffirming what the Shia Muslims were protesting, Saudi police made arrests in April that included a prominent intellectual leader of the Shia sect, Al-Saeed al-Majid. (HRW) The Saudi government has been forced into a position of vigilance, as it intends to swift put down any attempt to destabilize the country. Grand Mufti Sheikh Abdul Aziz bin Abdullah al-Sheikh, a top Muslim authority with close ties to the Saudi royal family, decried the uprisings as ââ¬Å"chaotic actsâ⬠that ââ¬Å"have come from the enemies of Islam and those who serve themâ⬠. (Saudi) This statement may refer to Western powers, although Saudi Arabia usually depends on the American military for security on its borders and throughout the regionââ¬âespecially in the Gulf. The Gulf itself is in many ways entirely separate from the greater Arab world in that it tends to look inward rather than out. While Tunisia, Libya, and Egypt all have been concerned with their own neighbors as well as what is happening within their borders, Saudi Arabia looks across the Gulf to Iran, a rising Persian Shia power that is the antithesis of the Arab Sunni monarchy in the Arabian Peninsula. The Grand Muftiââ¬â¢s quote may indeed be referring to Iran and the Shia sect as the enemies of Islam, thus supporting Saudi crackdown on Shia protests. Saudi Arabia has taken specific action outside its borders, and has arguably put more focus into its foreign policy over its domestic policy in reaction to the regional uprisings. Saudi Arabiaââ¬â¢s neighbor, Bahrain, is a Sunni monarchy as well, but rules over a Shia Muslim majority. In Bahrain, the government faced a grave threat as its citizens sought to uproot the monarchy, and the Saudi
Wednesday, August 28, 2019
Assignment #3 PKG 381 Example | Topics and Well Written Essays - 250 words
#3 PKG 381 - Assignment Example Comparably, the creation teachings in Christianity clearly narrate that God created humans so they may have control over other animals. This implies that man should dominate and control other animals, as well as plans and the nonhuman things. The Garden of Eden was given to a man as a habitat where man would live. This signifies the close relationship man and other nonhuman had from the time of creation. However, this misused to man by God has been misused extensively. For example, a person today may kill an animal or clear a forest unjustifiably and claim it is biblically allowed (Clowney & Mosto, 2009).Ã The Islamic teachings about creation also support the arguments presented by Christianity that man was commissioned to steward other animals. However, Islam goes ahead to explain that every person will account for their actions in relation to the environment. This is the point of dissimilarity between the two religions as far as this issue is concerned. Islam agrees that man has the stewardship role, but the actions must be judged in the end by the creator (Clowney & Mosto,
Tuesday, August 27, 2019
Matrices Essay Example | Topics and Well Written Essays - 500 words
Matrices - Essay Example It remains to determine if any of the 33 sub matrices of the augmented matrix (B) have a non ââ¬â zero determinant. For example in a square sub matrix of order 33 of [B], namely, These system of equations are inconsistent, because the rank of the coefficient matrix [A] in which det(D) = 0. Moreover, a 3rd order square sub matrices of [B], namely, , and are such that their corresponding determinants are zero. In other words, all the 3rd order square sub matrices of the augmented matrix [B] have a zero determinant. Therefore, the rank of the augmented matrix [B] is less than 3. Since, there exists a 2nd order square sub matrix of matrix [B], such that det(H) = -120âⰠ0, the rank of the augmented matrix [B] is 2. The rank of the coefficient matrix [A], whereis to be determined. Det(A) = 0. Hence, the rank of the coefficient matrix [A] is less than 3. is a square sub matrix of matrix [A] and det (J) = -3 ï⠹ 0. Therefore, the rank of the coefficient matrix [A] is 2. Hence, rank of the coefficient matrix [A] = rank of the augmented matrix [B], accordingly the system of equations given by [A] [X] = [B] is consistent. Nevertheless, the rank of the coefficient matrix [A] = rank of the augmented matrix [B] < 3, therefore there are only 2 constraints; consequently, these equations have infinitely many
Monday, August 26, 2019
EBay expands around the globe Essay Example | Topics and Well Written Essays - 2500 words
EBay expands around the globe - Essay Example This growth has mainly come in the past 8 years. While expanding globally, eBay has exercised a variety and combination of options that it had available in the first place (Thompson, 2003). The following section discusses various options for businesses while expanding. For moving in the international markets, a business has a number of options that can be considered. The consideration is based on various analyses of cost versus benefit being the major highlight (Davis, 2000). Some of the main options that a business may consider while going international are: Franchising is when a foreign business (parent company) deals with a local business to be their representative in the local markets, with the parent company's name, rules, policies and procedures being followed. The local company operates under the name of the parent company, precisely as per their inherent instructions, and earns the parent company earns the royalty from this set up (Shull, 2000). Examples of such an arrangement are often witnessed in the fast food chain set up or even in gas stations. Mergers occur when two or more businesses decide on merging their set of services to compete in a much enhanced form in the industry. In such a form, the businesses unite and the separate existence and identity seizes (Price, 2003). Glaxo Smith Klime (GSK) is the most renowned merger of recent times, with Sony Ericsson being another one. Acquisitions takes place when one firm is taken over by another and the acquiree seizes to exist as the acquirer takes over the operations and assets under its own books. In such a scenario, the acquirer yields various advantages. The extent of the advantages increases further when the acquirer is a foreign entity, acquiring a local entity to enter into the local markets (Carr, 2004). For example, as Royal Bank of (Scotland RBS) took over ABN AMRO, it instantaneously got access to the countries where it had no existence earlier. Foreign Direct Investment (FDI) takes place when a business having no existence in a certain region or country decides to enter into the local market for purpose of expanding its operations and taking advantage of an existing opportunity. For the industry in which eBay operates, the two most viable options for expanding are either acquisition or FDI. However, on majority of the occasions, eBay has seemed to preferred acquisition over FDI. The following section discusses the pros and cons of this selection and preference in detail. eBay's Policy: Acquisition Vs FDI eBay while expanding globally has chosen the option of acquisition rather than any other mode of expanding. There have been several critiques on the issue because with the likes of funding available at eBay, the firm could have easily gone in with any mode of expansion. The aim of essay is to critically analyze the pros and cons of acquisition vs. FDI. Following are the main advantages for eBay to choose acquisition over FDI as its preferred strategy to enter into the markets (David, 2002): 1) Existing Infrastructure: The major advantage of
Sunday, August 25, 2019
Reaction Paper Essay Example | Topics and Well Written Essays - 500 words - 7
Reaction Paper - Essay Example This is the same reason why Saeko had to seek the help of the doctor after she felt her glue tricks would fail her one day. It is her fear of looking unattractive again that drives her to have cosmetic surgery done (Cullen, ââ¬Å"Changing Facesâ⬠). In accordance to the reaction paper, one could clearly pin point the effect of inequities in health care. The number of practitioners that got sued due to medical mishaps related to cosmetic surgery somehow increased over the years due to shoddy jobs done by people not licensed to do so. In poorer places, a lot of people claiming to offer cosmetic surgeries mushroomed and offered people to pay less money for the same services offered by registered practitioners. The unregistered health providers in this poorer areas resulted in increased number of lawsuits due to their poor health service (Cullen, ââ¬Å"Changing Facesâ⬠). The poor that wanted to get attractive fell for this unregistered health providers tricks since they offered them low prices for the same services. If not for poverty, this people would have looked for better services from registered cosmetic surgeons. From the film, it is clearly depicted that gender plays a role in health. Women are more likely to seek for health services compared to men. From the sociological perspective, Saeko went to seek the help of a cosmetic surgeon in order to have her eye widened so as to look attractive. In addition, more women in Asian countries are seeking to have their physical appearances made more attractive as westernization sets in and defines beauty in another way. From the film, women tend to have better health seeking behaviour compared to men. Men often are satisfied with the way they look and seek less services related to cosmetic surgery (Cullen, ââ¬Å"Changing Facesâ⬠). In addition, Saeko got employed as a hostess in a given bar after she
Subscribe to:
Posts (Atom)