Archives from S:\ Drive

Good to keep around methinks
This commit is contained in:
Amrit Panesar committed 2015-04-01 21:23:15 -07:00
1 parent eadaf70b9e
commit 6dd63cc439
606 files changed
+50212

No files matched your search

@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project 1", "Project 1\Project 1.csproj", "{BF828070-B0E7-4F6E-B98E-39486C05DFD0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BF828070-B0E7-4F6E-B98E-39486C05DFD0}.Debug|x86.ActiveCfg = Debug|x86
{BF828070-B0E7-4F6E-B98E-39486C05DFD0}.Debug|x86.Build.0 = Debug|x86
{BF828070-B0E7-4F6E-B98E-39486C05DFD0}.Release|x86.ActiveCfg = Release|x86
{BF828070-B0E7-4F6E-B98E-39486C05DFD0}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,82 @@
/******************************************************************************
* Author: Amrit Panesar *
* Project: 1 *
* Date: 8/9/2013 *
* Due Date: Date Due: Monday Week 2 ( Midnight) *
* Class: COM 271 *
* Teacher: S. Ganore *
* *
* Filename: Consultant.cs *
* File Description: *
* derived from parttimeemployee requires the same variables as parttimeemp.. *
* Consultants may work more than 40 hours a week. they also have a consultant*
* fee. this class's calculate wage function assists in the calculation of *
* the concultant's wage. the print function assists in the display of *
* consultant specific data. *
* *
* Description: *
* Finish the inheritance chain with a class, which contains the Main method. *
* The students must script all the corresponding source code and produce a *
* clean compile of each step along the way towards the class with the Main *
* method. *
* The final step is the execution of the .exe file, which assigns values *
* through the public interface of the object and then displays the correct *
* values. This lab is to be coded individually and shown to the instructor. *
* *
* Project Specification: *
* We have Employee, PartTimeEmployee, FullTimeEmployee and Consultant *
* classes. Employee is the base class, PartTimeEmployee and FullTimeEmployee *
* are derived from it. Consultant is the derived class of PartTimeEmployee *
* (so Constultant is indirect derived class of Employee) and therefore we *
* have 3 level inheritance. Employee class contains name, id and *
* dateOfHire as the member variables. PartTimeEmployee contains hourlyRate *
* and hoursWorked as member variables. FullTimeEmployee contains salary as *
* the member variables. Consultant contains extraHours and consultantFee as *
* the member variables. Hours over 40 are considered as extra hours and is *
* applicable only to the consultant, more over the consultant will get paid *
* an additional 50% for the extra hours. *
******************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Project_1
{
class Consultant : PartTimeEmployee
{
//Consultant contains extraHours and consultantFee as the member variables.
double extraHours;
decimal consultantFee;
public double ExtraHours { get { return extraHours; } set { extraHours = value; } }
public decimal ConsultantFee { get { return consultantFee; } set { consultantFee = value; } }
// call the base class with name, id, doh, hourly rate, and hours worked
public Consultant(string name, int id, DateTime doh, double hourlyRate, double hoursWorked, double extraHours, decimal consultantFee)
: base(name, id, doh, hourlyRate, hoursWorked)
{
this.ExtraHours = extraHours;
this.ConsultantFee = consultantFee;
}
// ( ( hours worked * hourly rate ) + ( extra hours * ( hourly rate * 1.5 ) ) + consultant fee ) = wage
new public decimal CalcWage()
{
return (decimal)((this.HoursWorked * this.HourlyRate) + (this.ExtraHours * (this.HourlyRate * 1.5))) + ConsultantFee;
}
// print consultant specific information
public static void Print(Consultant e)
{
PartTimeEmployee.Print(e, false);
Console.Out.WriteLine("Type of Employee: Consultant");
Console.Out.WriteLine("Wage: {0}", e.CalcWage().ToString("C").PadLeft(9));
Console.Out.WriteLine("Extra Hours worked: {0}", e.ExtraHours);
Console.Out.WriteLine("Extra Hours rate: {0}", (e.HourlyRate * 1.5));
Console.Out.WriteLine("Consultant Fee: {0}", e.ConsultantFee.ToString("C").PadLeft(9));
}
}
}
@@ -0,0 +1,72 @@
/******************************************************************************
* Author: Amrit Panesar *
* Project: 1 *
* Date: 8/9/2013 *
* Due Date: Date Due: Monday Week 2 ( Midnight) *
* Class: COM 271 *
* Teacher: S. Ganore *
* *
* Filename: Employee.cs *
* File Description: *
* base class for the project. includes member variables for name, id and *
* date of hire. also includes a print function to ease displaying data. *
* *
* Description: *
* Finish the inheritance chain with a class, which contains the Main method. *
* The students must script all the corresponding source code and produce a *
* clean compile of each step along the way towards the class with the Main *
* method. *
* The final step is the execution of the .exe file, which assigns values *
* through the public interface of the object and then displays the correct *
* values. This lab is to be coded individually and shown to the instructor. *
* *
* Project Specification: *
* We have Employee, PartTimeEmployee, FullTimeEmployee and Consultant *
* classes. Employee is the base class, PartTimeEmployee and FullTimeEmployee *
* are derived from it. Consultant is the derived class of PartTimeEmployee *
* (so Constultant is indirect derived class of Employee) and therefore we *
* have 3 level inheritance. Employee class contains name, id and *
* dateOfHire as the member variables. PartTimeEmployee contains hourlyRate *
* and hoursWorked as member variables. FullTimeEmployee contains salary as *
* the member variables. Consultant contains extraHours and consultantFee as *
* the member variables. Hours over 40 are considered as extra hours and is *
* applicable only to the consultant, more over the consultant will get paid *
* an additional 50% for the extra hours. *
******************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Project_1
{
class Employee
{
//name, id and dateOfHire as the member variables.
string name;
int id;
DateTime dateOfHire;
public string Name { get { return this.name; } set { this.name = value; } }
public int Id { get { return id; } set { this.id = value; } }
public DateTime DateOfHire { get { return this.dateOfHire; } set { this.dateOfHire = value; } }
// constructor to include name, id, and date of hire.
public Employee(string name, int id, DateTime doh)
{
this.Name = name;
this.Id = id;
this.DateOfHire = doh;
}
// print employee specific information
public static void Print(Employee e)
{
Console.Out.WriteLine("\n============Employee {0}============", e.Id);
Console.Out.WriteLine("Name: {0}", e.Name);
Console.Out.WriteLine("ID: {0}", e.Id);
Console.Out.WriteLine("Date of Hire: {0}", e.DateOfHire.ToShortDateString());
}
}
}
@@ -0,0 +1,72 @@
/******************************************************************************
* Author: Amrit Panesar *
* Project: 1 *
* Date: 8/9/2013 *
* Due Date: Date Due: Monday Week 2 ( Midnight) *
* Class: COM 271 *
* Teacher: S. Ganore *
* *
* Filename: FullTimeEmployee.cs *
* File Description: *
* derived from employee. constructor requires same variables as employee. *
* full time employess are based on salarey and includes appropriate variables*
* this class also includes a print function to assist in the display of data *
* *
* Description: *
* Finish the inheritance chain with a class, which contains the Main method. *
* The students must script all the corresponding source code and produce a *
* clean compile of each step along the way towards the class with the Main *
* method. *
* The final step is the execution of the .exe file, which assigns values *
* through the public interface of the object and then displays the correct *
* values. This lab is to be coded individually and shown to the instructor. *
* *
* Project Specification: *
* We have Employee, PartTimeEmployee, FullTimeEmployee and Consultant *
* classes. Employee is the base class, PartTimeEmployee and FullTimeEmployee *
* are derived from it. Consultant is the derived class of PartTimeEmployee *
* (so Constultant is indirect derived class of Employee) and therefore we *
* have 3 level inheritance. Employee class contains name, id and *
* dateOfHire as the member variables. PartTimeEmployee contains hourlyRate *
* and hoursWorked as member variables. FullTimeEmployee contains salary as *
* the member variables. Consultant contains extraHours and consultantFee as *
* the member variables. Hours over 40 are considered as extra hours and is *
* applicable only to the consultant, more over the consultant will get paid *
* an additional 50% for the extra hours. *
******************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Project_1
{
class FullTimeEmployee : Employee
{
//FullTimeEmployee contains salary as the member variables.
decimal salary;
public decimal Salary { get { return salary; } set { salary = value; } }
// constructor passes the values: name, id, and doh to the based constructor
public FullTimeEmployee(string name, int id, DateTime doh, decimal salary)
: base(name, id, doh)
{
this.Salary = salary;
}
// wage = salary.
public decimal CalcWage()
{
return Salary;
}
// print full time information.
public static void Print(FullTimeEmployee e)
{
Employee.Print(e);
Console.Out.WriteLine("Type of Employee: Full time");
Console.Out.WriteLine("Wage: {0}", e.CalcWage().ToString("C").PadLeft(9));
}
}
}
@@ -0,0 +1,111 @@
/******************************************************************************
* Author: Amrit Panesar *
* Project: 1 *
* Date: 8/9/2013 *
* Due Date: Date Due: Monday Week 2 ( Midnight) *
* Class: COM 271 *
* Teacher: S. Ganore *
* *
* Filename: PartTimeEmployee.cs *
* File Description: *
* base class for consultant. derived from employee. requires same variables *
* as employee but also includes hourlyrate and hours worked. this also *
* includes a print function to assist in the displaying of data. *
* *
* Description: *
* Finish the inheritance chain with a class, which contains the Main method. *
* The students must script all the corresponding source code and produce a *
* clean compile of each step along the way towards the class with the Main *
* method. *
* The final step is the execution of the .exe file, which assigns values *
* through the public interface of the object and then displays the correct *
* values. This lab is to be coded individually and shown to the instructor. *
* *
* Project Specification: *
* We have Employee, PartTimeEmployee, FullTimeEmployee and Consultant *
* classes. Employee is the base class, PartTimeEmployee and FullTimeEmployee *
* are derived from it. Consultant is the derived class of PartTimeEmployee *
* (so Constultant is indirect derived class of Employee) and therefore we *
* have 3 level inheritance. Employee class contains name, id and *
* dateOfHire as the member variables. PartTimeEmployee contains hourlyRate *
* and hoursWorked as member variables. FullTimeEmployee contains salary as *
* the member variables. Consultant contains extraHours and consultantFee as *
* the member variables. Hours over 40 are considered as extra hours and is *
* applicable only to the consultant, more over the consultant will get paid *
* an additional 50% for the extra hours. *
******************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Project_1
{
class PartTimeEmployee : Employee
{
//hourlyRate and hoursWorked as the member variables.
double hourlyRate, hoursWorked;
public double HourlyRate { get { return this.hourlyRate; } set { this.hourlyRate = value; } }
// data validation: part time employees can only work 40 hours.
public double HoursWorked {
get {
if (this.hoursWorked > 40)
{
this.hoursWorked = 40;
}
return this.hoursWorked;
}
set {
if (this.hoursWorked > 40)
{
this.hoursWorked = 40;
}
else
{
this.hoursWorked = value;
}
}
}
// the constructor passes name, id, and dateofhire to the base class.
public PartTimeEmployee(string name, int id, DateTime doh, double hourlyRate, double hoursWorked)
: base(name, id, doh)
{
this.HourlyRate = hourlyRate;
this.HoursWorked = hoursWorked;
}
// hourly rate * hours worked = wage
public decimal CalcWage()
{
return (decimal)(this.HourlyRate * this.hoursWorked);
}
// print what is necessary.
public void Print()
{
Console.Out.WriteLine("Hours worked: {0}", this.HoursWorked);
Console.Out.WriteLine("Hourly rate: {0}", this.HourlyRate);
}
// stub for printing as a part time employee.
public static void Print(PartTimeEmployee e)
{
Print(e, true);
}
// print the detailed information
public static void Print(PartTimeEmployee e, bool choice)
{
Employee.Print(e);
if (choice)
{
Console.Out.WriteLine("Type of Employee: Part time");
Console.Out.WriteLine("Wage: {0}", e.CalcWage().ToString("C").PadLeft(9));
}
e.Print();
}
}
}
@@ -0,0 +1,67 @@
/******************************************************************************
* Author: Amrit Panesar *
* Project: 1 *
* Date: 8/9/2013 *
* Due Date: Date Due: Monday Week 2 ( Midnight) *
* Class: COM 271 *
* Teacher: S. Ganore *
* *
* Filename: Program.cs *
* File Description: *
* Main driver for the project, instanciates employees and prints appropriate *
* output. *
* *
* Description: *
* Finish the inheritance chain with a class, which contains the Main method. *
* The students must script all the corresponding source code and produce a *
* clean compile of each step along the way towards the class with the Main *
* method. *
* The final step is the execution of the .exe file, which assigns values *
* through the public interface of the object and then displays the correct *
* values. This lab is to be coded individually and shown to the instructor. *
* *
* Project Specification: *
* We have Employee, PartTimeEmployee, FullTimeEmployee and Consultant *
* classes. Employee is the base class, PartTimeEmployee and FullTimeEmployee *
* are derived from it. Consultant is the derived class of PartTimeEmployee *
* (so Constultant is indirect derived class of Employee) and therefore we *
* have 3 level inheritance. Employee class contains name, id and *
* dateOfHire as the member variables. PartTimeEmployee contains hourlyRate *
* and hoursWorked as member variables. FullTimeEmployee contains salary as *
* the member variables. Consultant contains extraHours and consultantFee as *
* the member variables. Hours over 40 are considered as extra hours and is *
* applicable only to the consultant, more over the consultant will get paid *
* an additional 50% for the extra hours. *
******************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Project_1
{
class Program
{
// the driver.
static void Main(string[] args)
{
// make one employee for each type of employee
Employee LazaroKeller = new Employee("Lazaro T. Keller", 0, DateTime.Parse("1/9/2013"));
PartTimeEmployee JudithFranklin = new PartTimeEmployee("Judith J. Franklin", 1, DateTime.Parse("3/14/2013"), 15.50, 25);
FullTimeEmployee SandraStockton = new FullTimeEmployee("Sandra E. Stockton", 2, DateTime.Parse("5/27/2013"), 68000);
Consultant RichardRojas = new Consultant("Richard M. Rojas", 3, DateTime.Parse("8/28/2013"), 20, 40, 20.8, 500);
// print them with their specific methods.
Employee.Print(LazaroKeller);
PartTimeEmployee.Print(JudithFranklin);
FullTimeEmployee.Print(SandraStockton);
Consultant.Print(RichardRojas);
// finalize.
Console.WriteLine("\n\nPress ENTER to continue...");
Console.ReadLine();
}
}
}
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BF828070-B0E7-4F6E-B98E-39486C05DFD0}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Project_1</RootNamespace>
<AssemblyName>Project 1</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Consultant.cs" />
<Compile Include="Employee.cs" />
<Compile Include="FullTimeEmployee.cs" />
<Compile Include="PartTimeEmployee.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Project 1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Project 1")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4176b7fc-df5b-4a97-a695-8e7abac6c644")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]