The following is the code of a service that Universities Canada, a consultancy firm for University...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The following is the code of a service that Universities Canada, a consultancy firm for University administrators, is offering to customers for retrieving University data for analyses, publications, articles etc. Assume that the object is used by various clients including York University and the University of Waterloo. public class UniInfo { } public int getStudent No (String university) { int istNo; } switch (university) { case "York University": istNo = 55,000; case "University of Waterloo": istNo = 41,000; default: ist No = -1; // error } return (istNo); Apply the Strategy pattern to make the solution compliant to the Single Responsibility Principle (SRP). In particular: 1. Submit a Class diagram describing your Strategy solution. 2. Update and complete the Client code in the answer box below. 3. Explain (in the answer box) why the original design did not meet the SRP and how the strategy solution satisfies SRP. (50 words max) The following is the code of a service that Universities Canada, a consultancy firm for University administrators, is offering to customers for retrieving University data for analyses, publications, articles etc. Assume that the object is used by various clients including York University and the University of Waterloo. public class UniInfo { } public int getStudent No (String university) { int istNo; } switch (university) { case "York University": istNo = 55,000; case "University of Waterloo": istNo = 41,000; default: ist No = -1; // error } return (istNo); Apply the Strategy pattern to make the solution compliant to the Single Responsibility Principle (SRP). In particular: 1. Submit a Class diagram describing your Strategy solution. 2. Update and complete the Client code in the answer box below. 3. Explain (in the answer box) why the original design did not meet the SRP and how the strategy solution satisfies SRP. (50 words max)
Expert Answer:
Answer rating: 100% (QA)
Strategy Pattern Solution First lets create an interface for the strategy public interface Universit... View the full answer
Related Book For
Operations Management Creating Value Along the Supply Chain
ISBN: 978-1118301173
1st Canadian Edition
Authors: Roberta S. Russell, Bernard W. Taylor, Ignacio Castillo, Navneet Vidyarthi
Posted Date:
Students also viewed these programming questions
-
Sally consumes only two goods, shoes and "everything else." For five different shopping trips (each with different prices), the prices and Sally's marginal utilities are shown below. a. Is Sally...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
A load must be suspended 6 m below a high ceiling using cables attached to two supports that are 2 m apart (see figure). How far below the ceiling (x in the figure) should the cables be joined to...
-
Jiffy Print is a printing shop on a local college campus. In analyzing the costs over a two-year period, the following data was available for the printing jobs on the colour printer: Required: 1....
-
Talk to the manufacturing vice president and emphasize the responsibility that Petro-Tech has as an industry leader to set an example. Present her with a recommendation that Petro-Tech participate in...
-
Which statement is false with respect to backdating of stock options? a. Steve Jobs, CEO of Apple, was involved with backdating. b. Manipulating a stock option exercise date to a lower price will...
-
ErgoFurn, Inc. manufactures ergonomically designed computer furniture. ErgoFurn uses a job order costing system. On November 30, the Work in Process Inventory consisted of the following jobs: On...
-
Jamestown Industries is contemplating the acquisition of somenew equipment. The purchase price is $40,000. The equipment has a4-year life after which time it will be worthless. Furthermore,lease qu 0...
-
James and his daughter, Lydia, own 100% of Garden Co. James owns 100 shares which he acquired in 2015 for $15200. Lydia owns 100 shares which she acquired in 2017 for $25000. Garden Co.'s current E&P...
-
Oil flow in the porous medium at isothermal conditions is developed based on two physics concepts: conversation of momentum and conservation of mass. Those concepts can be (00) = - (pv). translated...
-
Subject: Health Policy Topic: NSW Interagency Policy Abuse of elder people, Australia Interagency Policy of NSW government:...
-
List two (2) HR metrics an HRIS can provide. Provide an example as to when you might use each metric.
-
Is the Phillips Curve a useful guide to our ability to achieve the goals of the "dual mandate"? Or is it an outdated/erroneous concept of limited value? What is meant by the term LOOP? How close is...
-
How does the concept of "social stratification" intersect with economic disparities, cultural capital, and power dynamics within contemporary society ?
-
discuss income statement balance sheet include 5 year trend mattel
-
Refer to the situation described inBE 18-13, but assume a 2-for-1 stock split instead of the 5% stock dividend. Prepare the journal entry to record the stock split if it is to be effected in the form...
-
The Carry-Haul Truck Rental firm has accumulated extra trucks at three of its truck leasing outlets, as shown: Leasing Outlet Extra Trucks 1. Toronto .............................................. 70...
-
The Ontario Ministry of Transportation is undertaking a construction project to widen a large section of high-way near Ottawa, which includes the construction of a number of new bridges,...
-
The amount of denim used daily by the Southwest Apparel Company in its manufacturing process to make jeans is normally distributed with an average of 4000 metres of denim and a standard deviation of...
-
Imagine that you have \($10,000\) to invest. Use a newspaper, the Internet, or other source to select a mutual fund. Use the same source to fi nd out how much gold you could buy for \($10,000\)....
-
Animation art, hand-painted images from which cartoons used to be made, is a popular collectible.
-
The PBS television program, Antiques Roadshow, has generated enormous interest among viewers to find out the value of the furniture, art, jewelry, and collectibles they own.
Study smarter with the SolutionInn App