Free Essay

Cis247C Week 5: Composition, Inheritance, and Polymorphism

In: Other Topics

Submitted By HomeWorkFox
Words 667
Pages 3
http://goo.gl/wUFyk

CIS 247C Week 5 Lab DeVry University Click on this Link to get the Tutorial

http://goo.gl/wUFyk
Week 5: Composition, Inheritance, and Polymorphism - iLab

i L A B O V E R V I E W
Scenario and Summary
The objective of the lab is to take the UML Class diagram and enhance last week's Employee class by making the following changes:
1. Create a class called Salaried that is derived from Employee.
2. Create a class called Hourly that is also derived from Employee.
3. Override the base class calculatePay() method.
4. Override the displayEmployee() method. i L A B S T E P S
STEP 1: Understand the UML Diagram

Notice the change in UML diagram. It is common practice to leave out the accessors and mutators (getters and setters) from UML class diagrams, since there can be so many of them. Unless otherwise specified, it is assumed that there is an accessor (getter) and a mutator (setter) for every class attribute.

STEP 3: Modify the Employee Class

1. Using the updated Employee class diagram, modify the attributes to be protected.
2. Delete the iEmployee interface class, and remove the reference from the Employee class.
STEP 4: Create the Salaried Class

1. Using the UML Diagrams from Step 1, create the Salaried classes, ensuring to specify that the Salary class inherits from the Employee class.
2. For each of the constructors listed in the Salaried class, ensure to invoke the appropriate base class constructor and pass the correct arguments to the base class constructor. This will initialize the protected attributes and update the numEmployees counter.
3. The valid management levels are 0, 1, 2, and 3, and should be implemented as a constant.
4. Override the calculatePay method to add a 10 percent bonus for each of the management levels (i.e., bonus percentage = managementLevel * .10). The bonus percentage should be implemented as a constant.
5. Override the displayEmployee() method to add the management level to the employee information.
STEP 5: Label Title

1. Using the UML Diagrams from Step 1, create the Hourly classes, ensuring to specify that the Hourly class inherits from the Employee class.
2. For each of the constructors listed in the Hourly class, ensure to invoke the appropriate base class constructor and pass the correct arguments to the base class constructor. This will initialize the protected attributes and update the numEmployees counter.
3. The valid category types are "temporary", "part time", and "full time".
4. The provided hours must be more than 0 hours and less than 50 hours, and the limits should be implemented as constants.
5. The provided wage must be between 10 and 75, and the limits should be implemented as constants.
6. Override the calculatePay method by multiplying the wages by the number of hours.
7. Override the Employee setAnnualSalary method and set the annual salary by multiplying the weekly pay by 50.
8. Override the displayEmployee() method to add the category to the hourly employee information.
STEP 6: Label Title

1. Using previous weeks' assignments as an example, create at least one Employee, Hourly, and Salaried employee.
2. For each object created, display the number of employees created.
3. For each object created, write statements to exercise each of the public methods listed in the Class diagram.
4. For each object created, invoke the object's displayEmployee() method to display the employee's information.
5. For employee, the following information needs to be displayed:
Partial Sample output
6.

7. For salaried employee, the following information needs to be displayed:
Partial Sample output
7.

8. For hourly employee, the following information needs to be displayed:
Partial Sample output

STEP 7: Compile and Test

When done, compile and run your code.
Then, debug any errors until your code is error-free.
Check your output to ensure that you have the desired output, modify your code as necessary, and rebuild.
Below is the complete sample program output for your reference.

http://goo.gl/wUFyk…...

Similar Documents

Premium Essay

Week 5

...Week 5 Individual Assignment - Due Day 7 Class, Six months after the merger described in Change and Culture Case Study I, the new administration initiated a significant reduction in force. A decision was made to redesign patient care delivery. The administration’s first job redesign recommendation was that of a universal worker. The universal worker would deliver many support services. Aware that this model often failed when implemented in other organizations, your administrator charged you with making redesign work this time.   Resource: Week Four article by Peter Senge Write a 1,750- to 2,100-word paper in which you address the following: * How would you begin the process of job redesign? Do not consider only the universal worker. * What work processes and performance expectations must be considered once the design is completed? *  Based on the article by Peter Senge in Week Four, what steps and structures will you put in place to make the organization a true learning organization, and thereby encourage workers and managers to adapt and excel in spite of the changes? * How can you plan and control the intraorganizational and interorganizational communications that must occur to implement the job design changes? *  How can management ensure individual job satisfaction for this position? Cite at least five references. Format your paper consistent with APA guidelines. This assignment is worth seventeen percent of your class grade.  There......

Words: 262 - Pages: 2

Premium Essay

Sci/230 Week 5

...established by simple dominance, co-dominance, partial dominance or polygenic inheritance. Every instance will show particular traits in various means." (www.sciencelearn.org). Describe each stage of the flow of information starting with DNA and ending with a trait. "DNA nucleotide bases consist of a particular code. Specific strands of this code are termed genes." (Simon, Reece, & Dickey 2010) Genes code for particular proteins which ends in specific trait expression. Here is how it occurs, in short, DNA unzips showing (opening up) the area that requires to be evaluated for a trait mRNA Polymerase then fastens to the DNA molecule at a particular installation site and commences recording the code into a mRNA molecule. This molecule then tours to the ribosome where it is converted into the certain protein administered by the gene in the DNA. That protein is then reproduced as an expressed trait. Resources Johnson, Hilary Dr. (2013 June, 3) DNA structure and sequence - Genetics home reference. Retrieved 6/7/2013 from: www.ghr.nlm.nih.gov/handbook/basics/dna Author Unknown (2010 June, 11) Genotype and Phenotype - Science Learn Retrieved 6/7/2013 from: sciencelearn.org Simon, E.J., Reece, J.B., & Dickey, J.L. (2010). Campbell Essential Biology with Physiology (3rd ed.). San Francisco, CA: Pearson Benjamin Cummings Andre Robles joffreydnse@email,phoenix.edu SCI/230 - Week 5 Assignment...

Words: 453 - Pages: 2

Premium Essay

Week 5

...part of the US copyright law through the Bern Convention Implementation Act of 1988 brought about the Convention for the Protection of Literary and Artistic Works which established international uniformity in the copyright protection. Music Producers and software developers added protection technology to their copyrighted products and lobbied for a change in copyright law, Digital Millennium Copyright Act. This act criminalizes the circumvention of protection technology in order to make copies of copyrighted material for example Napster. Statutory Protection Computer Software Copyright Act of 1980 all software can be copyrighted whether it is written in ordinary language or in machine language. Trademarks after 5 years of the trademark being registered and it has not been challenged, the trademark becomes incontestable and is protected as long as its owner enforces it. Statutory Protection Much like a patent the trademark is only good in the us and must be registered in other countries. In some countries, known as common law countries, trademark protection is established through the use in that country and through the recognition by others of the use and distinction provided by the trademark. Several international registries attempt to offer international protection through the Madrid Agreement Concerning the International Registration of Trademarks provides a central form through the International Bureau which is part of the......

Words: 1720 - Pages: 7

Free Essay

Week 5

...Lab4 Chris Hann Zy Powell 1. Dictionary attacks and rule-based search attacks. 2. Cross-site scripting allows for attackers to bypass client-side security mechanisms normally forced on web content by current browsers. 3. You can do this by disabling scripting when it is not necessary. Do not trust links to other sites on email or message boards, and do not follow links from sites that lead to security-sensitive information directly through its address. 4. The attacker can use redirect vulnerability, where a webpage uses a script to redirect the user somewhere other than the intended site. So then the hacker takes advantage of the script and you are sent to an external page instead of an internal one. 5. It can be denial of access, data loss or corruption, and unnecessary account privileges. 6. Blind SQL injection ask question that can only have a yes or no answer. Yet with normal SQL injection ask questions that will confuse the applications into returning answers in error message and. 7. Because XSS is a hacking technique in which a malicious user enters a short snippet of JavaScript into a textbox so that this script will be saved in the database. Therefore when a user retrieves and displays this later, the browser will execute the script. 8. When a user tries to enter their credentials, the url is explaining that the password is wrong. 9. By removing all unwanted input and accept only expected input, and you......

Words: 295 - Pages: 2

Premium Essay

Week 5

... | Financial Accounting Standards Board (FASB) and the Securities | | | | and Exchange Commission (SEC). | | | | | | | | | | | | | | | | | | | | | | | 2. What elements comprise the FASB's conceptual framework? | | | | | | | | | | | | | | 1. Objectives of Financial Reporting | | | | | | 2. Qualitative Characteristics of Accounting Information | | | | | 3. Elements of Financial Statements | | | | | | 4. Operating Guidelines (Assumptions, Principles, and Constraints) | | | | | | | | | | | E8-5 | | | | | | | | | | | | | | | | | | Procedure | | IC Good or Weak | | Related Internal Control Principle | | 1 | | Weak | | Establishment of Responsibility | | 2 | | Good | | Independent Internal Verification | | 3 | | Weak | | Segregation of Duties | | 4 | | Good | | Segregation of Duties | | 5 | | Weak | | Documentation Procedures | | | | | | | | | | | | Condensed Balance Sheets | | | | | | December 31, 2009 | | | | | | | | | | | | | | | | | | Increase or (Decrease) | | | | 2009 | 2008 | Amount | Percentage | Assets | | | | | | | Current Assets | | $125,000 | $100,000 | $25,000 | 25.00% | | Plant Assets (net) | | 396,000 | 330,000 | 66,000 | 20.00% | | | Total Assets | $521,000 | $430,000 | $91,000 | 21.20% | | | | | | | | | | Liabilities | | | | | | | Current......

Words: 453 - Pages: 2

Premium Essay

Week 5

...Week 3 Summary MGT/311 Team B William Osborn, Juli Gibson, Ramon Taboa, Terrence Griffin, Cedric Davis June 30, 2014 James Eyster Week 5 Summary: Team B This week we learned ways to help make the changes within the company easier for the employees. Changes in the workplace can consist of things such as management, change in how the work is done, and change of ownership to name a few. Most people fear the unknown so when changes are made within the company. Some common fears are losing their job, that the change will affect the culture and effectiveness of implanting that change. There are some ways that the company can help to relieve some of that fear by educating the employees on the changes that are being made. The company can also relieve some of the fear by having open communication by letting the employees ask questions and give them an honest answer. Some negative ways to implement the change are by manipulation and cooptation. By doing this it can backfire on the company when the truth comes out. Going hand in hand with a company implementing changes is stress in the workplace. There are many things that can contribute to stress in the workplace. There are various ways stress in the workplace can occur for example, workload, coworkers, management, and pay. For an employee to relieve some of that stress it may help to take breaks to get some alone time. This will help the employee rest their mind......

Words: 428 - Pages: 2

Free Essay

Week 5

...Week 5 Internet Service providers Ashour, Kalled Week 5 Internet Service providers Ashour, Kalled 2014 2014 Internet Service Providers In Denver Colorado, there are only two main options for personal home internet service. You can either get broadband through Comcast, or DSL through Century Link. Both have their positives and negatives, and both are around the same price. Comcast is 39.99 a month, for broadband internet service. While Century Link is $29.95 a month for DSL service. I personally have DSL though Century Link as I think that their customer service is much better than Comcast. Century Link provides packages of 1.5, 7, 12, 20 and 40Mbp/s connections, though all of them are the same price. I personally have the 40Mbp/s connection and pay $30 a month for the service. The router they provide has wireless capability and has suited all of my needs. Century Link has been running a campaign that they will be installing a full fiber optic system in the Denver area over the next year. So their speeds will be increasing in order to compete with Comcast. Comcast provides up to 50Mb/s for $40 a month, on a dedicated broadband line. Meaning that you should always have 50Mb/s no matter the time of day. They do offer more expensive plans with higher bandwidth, such as 105Mb/s for $45 a month. This is where Comcast has a clear advantage over Century Link. They can offer much higher speeds for just $15 more a month. They also have plans that package HBO and......

Words: 392 - Pages: 2

Premium Essay

Week 5

...Cost of Goods Sold 1,080,490 69.7% 241,000 71% Gross Profit 468,545 30.2% 98,038 29% Selling and administration Expense 302,275 19.5% 79,000 23% Income from Operations 166,270 10.7% 19,038 6% Other expenses and losses Interest Expense 8,980 .5% 2,252 1% Income before taxes 157,290 1% 16,786 5% Income tax expense 54,500 4% 6,650 2% Net Income $102,790 7% $10,136 3% (B) Douglas Company’s return on assets is 8.07% and their return on common stockholder's equity is 6.42%. Maulder Company’s return on assets is 2.11% and their return on common stockholder's equity is 1.48%....

Words: 327 - Pages: 2

Free Essay

Week 5

...Identify and describe the stage of the life cycle the brand, product, business or organization is in? The product I have chosen to discuss this week is the Philips Compact Disc (CD). Although this product is fairly common, I believe it to be unique from other examples such as the cassette tape and the Apple iPod. The main difference is that although this product is indeed in the declining stages of the product life cycle, I strongly believe the product will continue to remain relevant for the next several years due to the way Philips has re-designated the CD’s usage. The insights below prove that this product is a unique example of how companies can prolong the life of a product while evolving with newer technologies. The compact disc was first introduced in the early 1980s and was initially marketed to Japan. Although sales were initially slow, the CD gained popularity in Asia due to efficiencies with file transfers and considerably better audio quality with music recording. By the mid-1980s, the compact disc gained popularity throughout Europe as a primary means of recording music. As sales continued to increase over the next decade, Philips viewed the CD’s niche market as primarily a vehicle for the recording and selling of music. This form of file transfer allowed musicians to record more tracks on an album and continued to provide better clarity than cassette tapes and other forms of file storage. The CD’s popularity eventually spread to the United States where sales...

Words: 1133 - Pages: 5

Premium Essay

Week 5

...system! But most families don't pay on time. The average family today carries $8,000 in credit card debt according to the American Bankers' Association. Now let's talk about the rebates. If you were using a credit card at 5%, you would have had to have spent $80,000 to get $4,000 rebates on new cars that lost $6,000 of value when you drove them off the lot. That is not a good deal! Cash vs. Credit Cards When you pay cash, you can "feel" the money leaving you. This is not true with credit cards. Flipping a credit card up on a counter registers nothing emotionally. A study of credit card use at McDonald?s found that people spent 47% more when using credit instead of cash. This is money you could have saved! If you "have to" use plastic, I suggest a debit card. I use them for travel and the occasional convenience of ordering something over the Internet or phone. Other than that, I use cash. Personal finance is 80% behavior. You need to cut out habits that make you spend more. You do not build wealth with credit cards. Use common sense. When you play with a multi-billion dollar industry and you think you're going to win at their game, you are naive. You cannot beat the credit card companies. Start living on cash today!  If you were using a credit card at 5%, you would have had to have spent $80,000 to get $4,000 rebates on new cars that lost $6,000 of value when you drove them off the lot. That is not a good deal! Cash vs. Credit Cards When you pay cash, you can "feel"......

Words: 1175 - Pages: 5

Free Essay

Composition I Homework 5

...Krystle Crawford Composition I (GE117P) Homework Wk. 5 How to cite different types of references in a bibliography: 1. Web Publications a) Web site, Corporate Author State the author of the web site followed by a period, then the date published followed by a period, all in parenthesis. Next the title of the page/document followed by a period, and the title of the entire website in italics. Lastly the retrieved date, month comma year, and URL retrieved from, no period. b) Article from an Online Periodical Name of the Author, last name followed by first initial, followed by a period, then the publication date, in parenthesis, followed by a period. Next, title of the article, period, and the title of the journal in italics, period. Lastly the URL retrieved from, without a period. 2. Personal Correspondence a) Personal references shouldn’t be listed in the reference list. The information should be given in a parenthetical citation. Personal communication, comma, followed by the date and a period. 3. Television a) Name of the producers, writers, or directors with their roles in parenthesis, followed by a period. The year of broadcast or release in parenthesis followed by a period. Title of the work, use italics for the complete work, name of episode with the first letter of the first word capitalized, and the title of the program in italics. In brackets list the type of program, followed by a period. Then list the city and state or country......

Words: 538 - Pages: 3

Premium Essay

Week #5

...asset utilization. 3. Firms should always be adhering to public policy changes related to environmental initiatives because essentially one of the largest contributors to company sustainability is environmental compatibility. However, a company that is trying to minimalize cost could only follow the minimal requirement of certain environmental aspects such as recycling in certain places in the world. This factor alone could save companies expenses. 4. The roles that logistics and supply chain management should take to ensure the following of safety regulations are the ability to have credentials available and an organize transportation of the products to ensure an quick and efficient evaluation undergoing security screenings. 5. Taxes in specific parts of the nation or world could intimidate firms into refusing to operate there, or firms that already exist in an expensive location may relocate because the overall relocation may cost less than the additional property, value-added, inventory, and income taxes that a firm may be dealt. These said additional taxes could potentially cripple an economy if it deters enough firms’ choice to develop there or to remain there. 6. The implication of increasing fuel costs on a supply chain design consist of frequent reevaluations of the firm’s network structure and strategy to ensure it’s the best for the firm. Also the volatility of fuel costs influences the viability and flow of global trade. Higher fuel prices however...

Words: 643 - Pages: 3

Premium Essay

Cis247C Lab5

...// Program.cs (main program" //CIS247C Lab5 using System; class Program { static void Main(string[] args) { Console.WriteLine("\nWelcome the Employee Hierarchy Program\n"); Console.WriteLine("\n CIS247 Week 5 Lab \n"); Console.WriteLine("\n Name: Solution \n "); Console.WriteLine("\nThis program tests an Employee inheritance hierarchy\n"); Employee[] emp = new Employee[3]; emp[0] = new Employee("Joe", "Doe", 'M', 1, 10000.0, new Benefit("Partial", 1000, 2)); emp[1] = new Salaried("Zoe", "Likoudis", 'F', 3, 20000.0, new Benefit("Full", 2000, 4), 1); emp[2] = new Hourly("Kate", "Perry", 'F', 0, 75, 25, new Benefit("Partial", 3000, 8), "part time"); for (int i = 0; i < emp.Length; i++) { Console.WriteLine("\n***************** Display Employee's Data *****************\n"); Console.WriteLine(emp[i].ToString()); } Console.WriteLine("\nTotal number of employees in Database: {0}\n", Employee.GetNumberOfEmployees()); } } class Employee { protected string firstName; protected string lastName; protected char gender; protected int dependents; protected double annualSalary; private static int numEmployees = 0; protected Benefit benefit; public Employee() { firstName = "not given"; lastName = "not given"; gender = 'U'; dependents = 0; annualSalary = 20000; numEmployees++; benefit = new Benefit("not given", 0, 0); } public Employee(string first, string last, char gen, int dep, double salary,...

Words: 813 - Pages: 4

Premium Essay

Week 5

...week 5 Describe the neuroanatomy of and neural processes related to learning based on current literature. There is a subtle difference between learning and memory whereas learning is the process by which in one’s mind there is an incorporation of new information and abilities and memory is the way in which the mind stores the information and abilities. There is a great importance from the outset that there are many kinds of memory such as procedural memory. Procedural memory is the process of remembering how to do certain things. Declarative memory is another memory where one can remember actual semantic information. These two memories are often unrelated in many instances. A prime example of these two memories would be a basketball player may have the perfect three point shot, but does not need to be fully aware of the physics that goes into shooting a three-pointer because procedural memory comes into play. To some extent this describes the difference between declarative and procedural memory. Even though that they are totally different form one another they both are a kind of memory. You can describe learning as a process in which experiences are incorporates into a person’s memory. This definition can be broad and encompasses not only the most traditional type of learning such as school learning. Learning can also be described as people forming memories of significant events that have occurred in the past. However, biologically, learning encompasses all of these......

Words: 578 - Pages: 3

Premium Essay

Week 5

...it will become quite clear that they are all closely related and overlap each other in many ways. Following are the issues and some of the questions they raise. Human Services in Contemporary America - © Cengage Learning 326 chapter nine 1. Morality of social services. Who shall receive services and on what terms? (p. 5) Questions: Shall services be given to only those who are unable to work? What about (a) those who cannot find work or (b) those who cannot earn enough to stay above the poverty line? Should those who receive benefits be required to work in the community? Should those on welfare not receive increased benefits for additional children? 2. Nature of social obligations. For what needs and problems is society responsible and which shall receive priority? (p. 5) Questions: Are we our brothers’ keepers? Is society responsible for providing for all who cannot care for themselves? Should society provide for only food, shelter, clothing, and medical care? What about education, cultural enrichment, and economic needs? 3. Preferred interventions. What kind of policy remedies should be chosen to address specific social problems? (p. 5) Questions: Should drug abusers be jailed, or should drugs be legalized? Should society emphasize treatment and prevention of drug abuse, or should the focus primarily be on keeping drugs from entering the country and on enforcement of antidrug laws? Should society prohibit abortions or continue to allow them, and on what terms?......

Words: 8154 - Pages: 33