Cis247C Lab5

In: Computers and Technology

Submitted By JohnQ
Words 813
Pages 4
// 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, Benefit benefit)
{
firstName = first; lastName = last; gender = gen; dependents = dep; annualSalary = salary;

numEmployees++; this.benefit = new Benefit(benefit.GetHealthInsurance(), benefit.GetLifeInsurance(), benefit.GetVacation());
}
public virtual double CalculatePay()
{
return annualSalary / 52;
}
public override string ToString()
{
return string.Format("Employee Type\t:…...

Similar Documents

Cis 247c Ilab 4 of 7: Composition and Class Interfaces

...  http://goo.gl/Fu6hE CIS247C iLab 4 of 6: Composition and Class Interfaces/Abstract Class Click this link to get the tutorial http://goo.gl/Fu6hE | | | | Connect to the iLab here. | | | | | | | Submit your assignment to the Dropbox located on the silver tab at the top of this page.(See Syllabus "Due Dates for Assignments & Exams" for due dates.) | | i L A B O V E R V I E W | | Scenario and Summary | | The objective of the lab is to modify the Employee class to demonstrate composition and a class interface. An employee typically has benefits, so we will make the following changes: 1. Create a Benefits class. 2. Integrate the Benefit class into the Employee class. 3. Create an iEmployee abstract class to guarantee that calculatePay is implemented in the Employee class. A tutorial on interfaces can be downloaded here. Deliverables | Due this week: * Capture the Console output window and paste it into a Word document. * Zip the project folder files. * Put the zip file and screen shots (Word document that contains programming code and screen shots of program output) in the Dropbox. | i L A B S T E P S | | STEP 1: Understand the UML Diagram | | Employee - firstName : string - lastName : string - gender : char - dependents : int - annualSalary : double - static numEmployees : int = 0 +benefit : Benefit +Employee() +Employee(in fname : String, in lname :......

Words: 1103 - Pages: 5

Cis 247c Ilab 4 of 7: Composition and Class Interfaces

...  http://goo.gl/Fu6hE CIS247C iLab 4 of 6: Composition and Class Interfaces/Abstract Class Click this link to get the tutorial http://goo.gl/Fu6hE | | | | Connect to the iLab here. | | | | | | | Submit your assignment to the Dropbox located on the silver tab at the top of this page.(See Syllabus "Due Dates for Assignments & Exams" for due dates.) | | i L A B O V E R V I E W | | Scenario and Summary | | The objective of the lab is to modify the Employee class to demonstrate composition and a class interface. An employee typically has benefits, so we will make the following changes: 1. Create a Benefits class. 2. Integrate the Benefit class into the Employee class. 3. Create an iEmployee abstract class to guarantee that calculatePay is implemented in the Employee class. A tutorial on interfaces can be downloaded here. Deliverables | Due this week: * Capture the Console output window and paste it into a Word document. * Zip the project folder files. * Put the zip file and screen shots (Word document that contains programming code and screen shots of program output) in the Dropbox. | i L A B S T E P S | | STEP 1: Understand the UML Diagram | | Employee - firstName : string - lastName : string - gender : char - dependents : int - annualSalary : double - static numEmployees : int = 0 +benefit : Benefit +Employee() +Employee(in fname : String, in lname :......

Words: 1103 - Pages: 5

Cis247C Week 5: Composition, Inheritance, and Polymorphism

...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......

Words: 667 - Pages: 3

Cis247 Ilab 6 Abstract Classes

...1.50 Vacation: 21 days Salaried Employee Management level: 3 ************** Employee 2 ************** Please enter your First Name :Jackie Please enter your Last Name :Chan Please enter your Gender :Male Please enter your Dependents :1 Please enter your HealthInsurance:HMO Please enter your LifeInsurance:100 Please enter your Vacation Days:18 Employee Information ________________________________________ Name: Jackie Chan Gender: M Dependents: 1 Annual Salary: 100000.00 Weekly Salary: 2000.00 Benefit Information ________________________________________ Health Insurance: HMO Life Insurance: 100.00 Vacation: 18 days Category: full time Wage: 50.00 Hours: 40.00 --- Number of Employee Object Created --- Number of employees: 2 The end of the CIS247C Week6 iLab. Press any key to continue... STEP 7: Submit Deliverables Submit your lab to the Dropbox located on the silver tab at the top of this page. For instructions on how to use the Dropbox, read these Step-by-Step Instructions or watch this Dropbox Tutorial. See Syllabus "Due Dates for Assignments & Exams" for due date information. http://goo.gl/l1g9s...

Words: 1027 - Pages: 5

Cis247 Ilab 6 Abstract Classes

...1.50 Vacation: 21 days Salaried Employee Management level: 3 ************** Employee 2 ************** Please enter your First Name :Jackie Please enter your Last Name :Chan Please enter your Gender :Male Please enter your Dependents :1 Please enter your HealthInsurance:HMO Please enter your LifeInsurance:100 Please enter your Vacation Days:18 Employee Information ________________________________________ Name: Jackie Chan Gender: M Dependents: 1 Annual Salary: 100000.00 Weekly Salary: 2000.00 Benefit Information ________________________________________ Health Insurance: HMO Life Insurance: 100.00 Vacation: 18 days Category: full time Wage: 50.00 Hours: 40.00 --- Number of Employee Object Created --- Number of employees: 2 The end of the CIS247C Week6 iLab. Press any key to continue... STEP 7: Submit Deliverables Submit your lab to the Dropbox located on the silver tab at the top of this page. For instructions on how to use the Dropbox, read these Step-by-Step Instructions or watch this Dropbox Tutorial. See Syllabus "Due Dates for Assignments & Exams" for due date information. http://goo.gl/l1g9s...

Words: 1027 - Pages: 5

Cis247 Ilab 6 Abstract Classes

...1.50 Vacation: 21 days Salaried Employee Management level: 3 ************** Employee 2 ************** Please enter your First Name :Jackie Please enter your Last Name :Chan Please enter your Gender :Male Please enter your Dependents :1 Please enter your HealthInsurance:HMO Please enter your LifeInsurance:100 Please enter your Vacation Days:18 Employee Information ________________________________________ Name: Jackie Chan Gender: M Dependents: 1 Annual Salary: 100000.00 Weekly Salary: 2000.00 Benefit Information ________________________________________ Health Insurance: HMO Life Insurance: 100.00 Vacation: 18 days Category: full time Wage: 50.00 Hours: 40.00 --- Number of Employee Object Created --- Number of employees: 2 The end of the CIS247C Week6 iLab. Press any key to continue... STEP 7: Submit Deliverables Submit your lab to the Dropbox located on the silver tab at the top of this page. For instructions on how to use the Dropbox, read these Step-by-Step Instructions or watch this Dropbox Tutorial. See Syllabus "Due Dates for Assignments & Exams" for due date information. http://goo.gl/l1g9s...

Words: 1027 - Pages: 5

E.Coli Transformation

...the levels of ions or pH, and then report the results by fluorescing in characteristic ways (Goodsell). The fact that only one of the five groups of plate had any growth, is a common result whenever doing bacterial transformations. There are many errors that could occur while doing bacterial transformations. One of the being that maybe they were heated too much or too long and some of the bacteria died. The biggest problem could have been that the e.coli bacteria may have never became competent during the treatments. Perhaps next time they could treated with more heat and cold shock treatments. Work’s cited "Bacterial Transformation and Bacterial Recovery." N.p., n.d. Web. 26 Nov. 2013. http://www.easternct.edu/~adams/Resources/Lab5%20Plasmid.pdf Goodsell, David. "Green Fluorescent Protein (GFP)." RCSB PDB-101. N.p., n.d. Web. 24 Nov. 2013. <http://www.rcsb.org/pdb/101/motm.do?momID=42>....

Words: 1047 - Pages: 5

Lab5

...Lab 5 Part 1: 10 points Network endpoints and network devices have different security considerations and implications. A user workstation implies certain security issues that remain in the user domain while network implications remain part of the LAN or LAN-to-WAN domain. However, during the course of investigating an intrusion, you may have to source data from logs kept in routing devices and end-user systems. Suppose an attacker intrudes upon one of your servers. How do you reconstruct the events of a crime? Log files are the first place to check for administrative issues and security activity. Log files help you put together a timeline of events surrounding everything from a performance problem to a security incident. You can also identify bad system or network activities by observing anomalies from baseline behavior or identifying certain suspicious actions. Testing ensures that your control and monitoring facilities work as intended and maintain proper operation. Monitoring ensures that you capture evidence when your testing procedures fail to examine all possibilities or legitimate behavior permits unauthorized activity. Always consider that even legitimate traffic can be used in illegitimate ways, and sometimes, legitimate traffic can appear illegitimate. Protected services can be attacked from the inside or accessed externally through loopholes in firewall rules. Vulnerabilities may remain unidentified by intrusion detection system (IDS) or intrusion......

Words: 533 - Pages: 3

Elec3 Lab5

...I. Objectives * Familiarize with the different tools in cracking passwords II. Procedure I. Identify the use of the following Password Cracking Tools a. LCP It is designed to help administrators identify and remediate security vulnerabilities that results from the use of weak and/or easily guessed passwords that users use. It is also designed to help administrators recover lost passwords and streamline migration of users to another authentication system. b. Crack It is designed to allow system administrators locate users who may have used weak passwords and are vulnerable to a dictionary attack. c. Access Passview This utility reveals the database password of every password-protected mdb file that was created with the use of Microsoft Access 95/97/2000/XP or with the use of Jet Database Engine 3.0/4.0. It can be used to recover any lost Access Database password. d. MS Access Database Password Decoder It is a program that helps users to recover any lost or forgotten passwords for MS Access database files and user-level passwords that are stored in the workgroup information file. e. Asterisk Logger It is a program that can be used to reveal passwords stored behind asterisks in standard password text-boxes. f. CHAOS Generator It is an application designed to generate passwords of any length and character content. CHAOS Generator will create alphabetic, numeric, alphanumeric or all keyboard characters passwords of......

Words: 262 - Pages: 2

Babs Enzyme Project

...   3:10   Part  2   Trial     1   Test  tube   1   2   3   4   5   6   2   1   2   3   4   5   6   3   1   2   3   4   5   6         Volume  of  amylase  (mL)   Time  for  iodine  to   change  colour  (min:sec)   1.0   2.0   3.0   4.0   5.0   6.0   1.0   2.0   3.0   4.0   5.0   6.0   1.0   2.0   3.0   4.0   5.0   6.0   -­‐   -­‐   8:12   1:24   15:25   1:21   3:53   3:08   2:17   1:05   0:50   0:49   2.40   2:06   1:53   1:42   1:30   1:05   References     http://www.eng.umd.edu/~nsw/ench485/lab5.htm   http://www.123helpme.com/view.asp?id=121479     ...

Words: 1409 - Pages: 6

Lab5

...Example 1 1 public class TwoDimensionArrayTracing 2 { 3 public static void main(String[]args) 4 { 5 int row, col, n; 6 char [][] B; 7 8 n = 5; 9 B = new char[n][n]; 10 11 for (row = 0; row <= 4; row++) 12 { 13 for(col = 0; col <= B[row].length - 1; col++) 14 { 15 if(row == col || row + col == B[row].length - 1) 16 B[row][col] = 'X'; 17 else 18 B[row][col] = ' '; 19 } 20 } 21 22 for (row = 0; row <= B.length - 1; row++) 23 { 24 for(col = 0; col <= B[row].length - 1; col++) 25 { 26 System.out.print(B[row][col]); 27 } 28 System.out.println(); 29 } 30 } 31 } Example 2 public class TwoDArray4 { public static void main(String[ ] args) { int row, col, n; int [][] B; n = 5; B = new int[n][n]; for (row = 4; row >= 0; row--) { for (col = 4; col >= row ; col--) ...

Words: 612 - Pages: 3

Bacterial Morphology

...  actually stain the cells in the cheek smear rather than the background and area   around the cell.       In the higher resolution cheek cell slide, the cell was outlined with the Congo Red dye.   The yeast       cells were easily identified using the indirect method however the cells in the plaque smear       were not.   There was a large area of dye in one area on the slide and did not appear to surround       the cells to help define them and make them easily identifiable.   In conclusion of the comparison       of mounting   techniques, it appears that direct staining using crystal violet produces the most       clear and defined view of the cells. References http://faculty.ccbcmd.edu/courses/bio141/labmanua/lab5/lab5.html...

Words: 354 - Pages: 2

Lab5

...TermPaperWarehouse.com - Free Term Papers, Essays and Research Documents The Research Paper Factory Join Search Browse Saved Papers Home Page » Computers and Technology Gathering Information Pertaining to a Glba Compliance In: Computers and Technology Gathering Information Pertaining to a Glba Compliance Lab#5 Define a process for Gathering Information pertaining to a GLBA Compliance 1. GLBA repealed parts of an act. Name the act and explain why it was significant for financial institutions and insurance companies. Parts of the glass Steagall act of 1933 GLBA allows financial institutions such as banks to act as insurance companies. GLBA covers both financial institutions and insurance companies since both can perform financial services for its customers. This reform requires banks and insurance companies to comply with both the privacy and safeguard rules of GLBA. 2. What is another name for obtaining information under false pretenses and what does it have to do with GLBA? What is an example of the safeguard pertinent to this requirement? Pre-texting or social engineering. GLBA specifically mentions this in title 15 US code chapter 94 sub chapter 2, section 6821. GLBA encourages companies to implement safeguards around pre-texting and social engineering. Security awareness training and periodic reminders of awareness to pre-texting and social engineering is a best practice performed within the user domain. 3. How does GLBA impact......

Words: 343 - Pages: 2

Sci203 Lab5 Worksheet Phase 5 I P Carl Steen

...SCI203 Lab5_worksheet_ Phase 5 I P Carl Steen Click Link Below To Buy: http://hwcampus.com/shop/sci203-lab5_worksheet_-phase-5-i-p-carl-steen/ In this lab, you will determine how an invasive species—the zebra and quagga mussel—affects other species in the freshwater lake. Use the animation to help you come up with an answer to the following: •Why do you see increases and decreases in the invasive species population? •What are the implications associated with these alterations to the ecosystem as a whole? The Effects of Zebra and Quagga Mussels Introduced into a Freshwater Lake As you have learned, population dynamics are caused by the biotic potential of the population and the effects of environmental resistance. When there is minimal environmental resistance impacting a population, it will exhibit a population explosion. One reason for minimal resistance could be factors that no longer regulate a population (e.g., predator decline or resource increases). Another reason for a population explosion is the introduction of an invasive species. Invasive species are species foreign to an ecosystem and are not immediately regulated by the environmental restraints of the particular ecosystem that they invade. This in turn allows their populations to grow seemingly uncontrolled and to displace other indigenous populations. Examples of such an invasive species into North America are dreissenid mussels, commonly known as zebra and quagga mussels. Their introduction into......

Words: 316 - Pages: 2

Sci203 Lab5 Worksheet Phase 5 I P Carl Steen

...SCI203 Lab5_worksheet_ Phase 5 I P Carl Steen Click Link Below To Buy: http://hwcampus.com/shop/sci203-lab5_worksheet_-phase-5-i-p-carl-steen/ In this lab, you will determine how an invasive species—the zebra and quagga mussel—affects other species in the freshwater lake. Use the animation to help you come up with an answer to the following: •Why do you see increases and decreases in the invasive species population? •What are the implications associated with these alterations to the ecosystem as a whole? The Effects of Zebra and Quagga Mussels Introduced into a Freshwater Lake As you have learned, population dynamics are caused by the biotic potential of the population and the effects of environmental resistance. When there is minimal environmental resistance impacting a population, it will exhibit a population explosion. One reason for minimal resistance could be factors that no longer regulate a population (e.g., predator decline or resource increases). Another reason for a population explosion is the introduction of an invasive species. Invasive species are species foreign to an ecosystem and are not immediately regulated by the environmental restraints of the particular ecosystem that they invade. This in turn allows their populations to grow seemingly uncontrolled and to displace other indigenous populations. Examples of such an invasive species into North America are dreissenid mussels, commonly known as zebra and quagga mussels. Their introduction into......

Words: 316 - Pages: 2