Create a C# application
You are to create a class object called “Employee” which included eight private variables:
firstN
lastN
dNum
wage: holds how much the person makes per hour
weekHrsWkd: holds how many total hours the person worked each week.
regHrsAmt: initialize to a fixed amount of 40 using constructor.
regPay
otPay
After going over the regular hours, the employee gets 1.5x the wage for each additional hour
worked.
Methods:
constructor
properties
CalcPay(): Calculate the regular pay and overtime pay.
Create an “EmployeeDemo” class. In the main function, the program should ask the user the
number of employee in the company and create a 2-dimensional dynamic array (number of
employee by 4 weeks). Then, the program should ask user to enter each employee’s information
and the amount of hours they worked weekly.
The program shows a menu with employee name for user to choose which employee to display
the following information:
How much the person totally made
How much of paycheck is regular pay
How much of paycheck is overtime pay
Solution
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace Employee
{
public enum EmployeeType {GROUPA, GROUPB, GROUPC, GROUPD};
public struct EmployeeSalaryInfo
{
public float hourlyWage;
public int monthlyHours;
public float baseSalary;
public int numSales;
public EmployeeSalaryInfo( EmployeeType eme)
{
this.hourlyWage = 0;
this.monthlyHours = 0;
this.baseSalary = 0;
this.numSales = 0;
}
}
class Program
{
static void Main(string[] args)
{
Console.WriteLine(\"Welcome to the Employee System\");
EmployeeArray empArray = new EmployeeArray();
int continueRunning = 1;
do
Console.WriteLine();
Console.WriteLine(\"Please Enter Your Choice:\");
Console.WriteLine(\"1=Enter new employee\");
Console.WriteLine(\"2=Update existing employee\");
Console.WriteLine(\"3=Delete employee\");
Console.WriteLine(\"4=Print employee list\");
Console.WriteLine(\"Any other number to Exit\");
int userChoice = int.Parse(Console.ReadLine());
Console.WriteLine();
switch (userChoice)
{
case 1:
Employee emp = CreateNewWorker(); //Asking for employee information by
creating a new employee.
if (!(empArray.Contains(emp))) //Checking to see that employee does not
exist
empArray.Add(emp); //If the employee does not exist in the list then
we can add it.
else
Console.WriteLine(\"Can not add new worker. This worker already exists\");
break;
case 2: //If user wishes to edit an employee
EditEmployee(empArray);
break;
case 3:
DeleteEmployee(empArray); //if user wishes to delete an employee from
the list
break;
case 4:
empArray.Print();
break;
default:
continueRunning = 0; //If user has chosen to exit the system.
break;
}
} while (continueRunning == 1); //Checking to see if to continue running
the system
}
static Employee CreateNewWorker() //Method for creating a
new employee.
{
Employee emp; //A new employee consists of
the basic information which is
Console.WriteLine(\"Enter first name.
define a class name Employee whose objects are records for employee..pdffashioncollection2
define a class name Employee whose objects are records for employee. Derive this class from the
class person given in the listing 8.1. An employee record inherits an employee\'s name from the
class Person. In addition, an employee record contains an annual salary represented as a single
value of type double, a hire date that gives the year hired as a single value of type int, and an
identification number that is a value of type String. Give your class a reasonable complement of
constructors, accessor methods, and mutator methods, as well as an equals method. Write a
program to fully test your class definition
this is the test file
import java.util.*;
public class EmployeeTest
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
char repeat;
do // repeat if user says \'yes\'
{
// Test the nine constructors (uses writeOutput method)
Employee e1 = new Employee(); // default constructor
System.out.println(\"Using default constructor:\");
e1.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e2 = new Employee(\"Mondo Kane\");
System.out.println(\"Using constructor with just name:\");
e2.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e3 = new Employee(\"Fleetis Pascal\", 111111.11);
System.out.println(\"Constructor with name & salary :\");
e3.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e4 = new Employee(\"Carl Wolf\", 1968);
System.out.println(\"Constructor with name and hire date:\");
e4.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e5 = new Employee(\"Sharon Kelly\", \"123-45-6789\");
System.out.println(\"Constructor with name and ssn:\");
e5.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e6 = new Employee(\"Joann Rousch\", 333333.33, 1963);
System.out.println(\"Constructor with name, salary & hire date:\");
e6.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e7 = new Employee(\"Lucy Sharp\", 444444.44, \"987-65-4321\");
System.out.println(\"Constructor with name, salary & ssn:\");
e7.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e8 = new Employee(\"Pierre Sokolskis\", 1964, \"999-99-9999\");
System.out.println(\"Constructor with name, hire date & ssn:\");
e8.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e9 = new Employee(\"Last One\", 555.55, 1999,
\"888-88-8888\");
System.out.println(\"Constructor with name, salary, hire date, and ssn:\");
e9.writeOutput();
System.out.println();
System.out.println(\"===============================\");
// Test methods to change, return and write values
// change all
System.out.println(\"Before:\");
e9.writeOutput();
System.out.println();
Sy.
I am trying to change this code from STRUCTS to CLASSES, the members.pdfpetercoiffeur18
I am trying to change this code from STRUCTS to CLASSES, the members have to be private.
Well, I think I did a semi-ok job; the code doesn\'t run and I have no idea why. Can you please
help. Platform: C++
========== C++ CODE ============
#include
#include
#include
#include
#include //must have to use system (\"pause\" );
//#include \"personType.h\"
using namespace std;
const int MAX_EMPLOYEES = 50;
//----------------------------------
class employeeType{ //:public personType
private:
long empID;
string first;
string last;
char gender;
double payrate;
string jobRole;
int years;
public:
virtual void programmer_info() const=0;
//Function to output employee\'s data
virtual double cutBacks(employeeType let[], int listsize) const=0;
//Function to calculate and return the wages.
//Postcondition: Pay is calculated and returned
void yourFired(employeeType let[], int& listsize , long id); //int& cuz we are restando
cantidades de la lista.
//Function to set the salary. /Postcondition: personId = id
long seqSearch(employeeType let[], int listLength, int searchItem)const;
//Function to retrieve the id. /Postcondition: returns personID
employeeType (long id = 0, string first = \"\", string last = \"\", char gender = \"\",
double payrate = 0, string jobRole = \"\",int years = 0);
//Ibefore it was: userinput();
//Constructor with parameters //Sets the first name, last name, payRate, and
//hoursWorked according to the parameters. If no value is specified, the default
//values are assumed. //Postcondition: firstName = first;
///==============================================================
void getData(ifstream& inFile, class employeeType let[], int& listSize);
void printOne ( employeeType one);
void hireOne(employeeType let[], int& listsize); //int& cuz we are adding or restyando
cantidades de la lista.
void selectionSort( employeeType let[], int length);
void printList(employeeType let[], int listSize);
employeeType getOne ( ifstream& dataIn );
};
///===============================================================
void employeeType::yourFired(long id)
{
empID = id;
}
long employeeType::seqSearch() const
{
return empID;
}
employeeType::employeeType(long id, string first, string last, char gender,
double, string jobRole,int years)
: personType(first, last)
{
empID = id;
}
//----------------------------------
int main ()
{
int number; // number of employees in the file
int id;
char choice;
class employeeType [MAX_EMPLOYEES], newrecord;
ifstream dataFile;
dataFile.open ( \"newEmployees.txt\");
if (!dataFile){
cout << \"\ Error with input file!!\ \ \";
//system (\"pause\"); // must #include
return 1;
}
getData (dataFile, employeeType, number);
cout < to be used
/// TASK 3 =======================================================
for(int i =0; i<3 ; i++){ //calling hireOne 3 times, you can insert 3 new employees on a roll
hireOne(employeeType, number); // the list increases by up to 3 new records each time
}
cout << \"After hiring employees, new list: \ \"<> id;
your.
Program.cs class Program { static void Main(string[] args).pdfanandshingavi23
Program.cs:
class Program
{
static void Main(string[] args)
{
Console.WriteLine(\"Welcome the Employee Hierarchy Program\");
Console.WriteLine(\"CIS247, Week 5 Lab\");
Console.WriteLine(\"Name:
Solution
\");
Console.WriteLine(\" This program tests an Employee inheritance hierarchy \");
//Array to hold Employee type objects
Employee[] emp = new Employee[3];
//Initializing 3 values of array with 3 three types of classes
//Employee class object
emp[0] = new Employee(\"Joe\", \"Doe\", \'M\', 1, 10000.0, new Benefit(\"Partial\", 1000, 2));
//Salaried Employee
emp[1] = new Salaried(\"Zoe\", \"Likoudis\", \'F\', 3, 20000.0, new Benefit(\"Full\", 2000, 4), 1);
//Hourly Employee
emp[2] = new Hourly(\"Kate\", \"Perry\", \'F\', 0, 75, 25, new Benefit(\"Partial\", 3000, 8), \"part
time\");
//Displaying their data to the console
for (int i = 0; i < emp.Length; i++)
{
Console.WriteLine(\" ***************** Display Employee\'s Data ***************** \");
Console.WriteLine(emp[i].ToString());
}
//Displaying number of emps
Console.WriteLine(\" Total number of employees in Database: {0} \",
Employee.GetNumberOfEmployees());
} //End of Main method
} //End of Program class
}//End of namespace
Employee.cs:
class Employee
{
//Private data members
protected string firstName;
protected string lastName;
protected char gender;
protected int dependents;
protected double annualSalary;
//Number of employees
private static int numEmployees = 0;
//Benefit object
protected Benefit benefit;
//Default Constructor
public Employee()
{
firstName = \"not given\";
lastName = \"not given\";
gender = \'U\';
dependents = 0;
annualSalary = 20000;
//updates number of employees
numEmployees++;
benefit = new Benefit(\"not given\", 0, 0);
}//End of Default Constructor
//Argumented Constructor
public Employee(string first, string last, char gen, int dep, double salary, Benefit benefit)
{
firstName = first;
lastName = last;
gender = gen;
dependents = dep;
annualSalary = salary;
//Updates number of employees
numEmployees++;
this.benefit = new Benefit(benefit.GetHealthInsurance(), benefit.GetLifeInsurance(),
benefit.GetVacation());
}//End of Argumented Constructor
//Calculates weekly pay
public virtual double CalculatePay()
{
return annualSalary / 52;
}//End of CalculatePay method
//Displays all the data of the employee
public override string ToString()
{
return string.Format(\"Employee Type : {0} First Name : {1} Last Name : {2} Gender : {3}
Dependents : {4} Annual Salary : {5:c} Weekly Pay : {6:c} {7}\",
\"GENERIC\", FirstName, LastName, (Gender == \'M\') ? \"Male\" : \"Female\", Dependents,
AnnualSalary, CalculatePay(), benefit.ToString());
}//End of DisplayEmployee method
//Public properties
//Property for first name of the employee
public string FirstName
{
set
{
firstName = value;
}
get
{
return firstName;
}
}//End of FirstName method
//Property for last name of the employee
public string LastName
{
set
{
lastName = value;
}
get
{
return lastName;
}
}//End of LastName method
//Gender of.
in C++ Design a class named Employee The class should keep .pdfadithyaups
in C++ Design a class named Employee. The class should keep the following information in
member variables: Employee name Employee number Hire Date Write one or more constructors
and the appropriate accessor and mutator functions for the class. Next, write a class named
ProductionWorker that is derived from the Employee class. The ProductionWorker class should
have member variables to hold the following information: Shift (an integer) Hourly pay rate (a
double) The workday is divided into two shifts: day and night. The shift variable will hold an integer
value representing the shift that the employee works. The day shift is shift 1 and the night shift is
shift 2. Write one or more constructors and the appropriate accessor and mutator functions for the
class. Demonstrate the classes by writing a program that uses a ProductionWorker object." =>
MINIMUM for main(): To count as a Program, your Main must do: Please change so that data
entry is controlled by a loop that will allow the user to enter as many Employees and corollary
information list as they like. Ask them to enter C or c to continue or any other character to stop.
Have an option to print out all the employees and their data
I already completed the program, I just needed help on creating a loop that allows users to enter
as many employees and corollary information, and ask them to enter a c to continue or any other
character to stop.
Here is my code:
Any help is appreciated.
//Header file section
#include<iostream>
using namespace std;
//Employee class definition
class Employee
{
//instance variable declaration
private:
string eName;
string eNumber;
string hireDate;
public:
//constructor to initialize variables
Employee(string name,string number,string date)
{
eName=name;
eNumber=number;
hireDate=date;
}
//getter methods to return eName,eNumber and hireDate
string getEName()
{
return eName;
}
string getENumber()
{
return eNumber;
}
string getHireDate()
{
return hireDate;
}
//setter methods to set eName,eNumber and hireDate
void setEName(string name)
{
eName=name;
}
void setENumber(string number)
{
eNumber=number;
}
void setHireDate(string date)
{
hireDate=date;
}
};
//ProductionWorker derived from Employee class
class ProductionWorker:public Employee
{
//instance variable declaration
private:
int shift;
double hourlyPayRate;
double hoursWorked;
public:
//constructor to initialize variables
//passing varlues into base class
ProductionWorker(string name,string number,string date,int s,double hRate,double
hWorked):Employee(name,number,date)
{
shift=s;
hourlyPayRate=hRate;
hoursWorked=hWorked;
}
//getter methods to return shift,hourlyPayRate and hoursWorked
int getShift()
{
return shift;
}
double gethourlyPayRate()
{
return hourlyPayRate;
}
double getHoursWorked()
{
return hoursWorked;
}
//setter methods to set shift,hourlyPayRate and hoursWorked
void setShift(int s)
{
shift=s;
}
void sethourlyPayRate(double hRate)
{
hourlyPayRate=hRate;
}
void setHoursWorked(double hWorked)
{
hoursWorked=h.
define a class name Employee whose objects are records for employee..pdffashioncollection2
define a class name Employee whose objects are records for employee. Derive this class from the
class person given in the listing 8.1. An employee record inherits an employee\'s name from the
class Person. In addition, an employee record contains an annual salary represented as a single
value of type double, a hire date that gives the year hired as a single value of type int, and an
identification number that is a value of type String. Give your class a reasonable complement of
constructors, accessor methods, and mutator methods, as well as an equals method. Write a
program to fully test your class definition
this is the test file
import java.util.*;
public class EmployeeTest
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
char repeat;
do // repeat if user says \'yes\'
{
// Test the nine constructors (uses writeOutput method)
Employee e1 = new Employee(); // default constructor
System.out.println(\"Using default constructor:\");
e1.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e2 = new Employee(\"Mondo Kane\");
System.out.println(\"Using constructor with just name:\");
e2.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e3 = new Employee(\"Fleetis Pascal\", 111111.11);
System.out.println(\"Constructor with name & salary :\");
e3.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e4 = new Employee(\"Carl Wolf\", 1968);
System.out.println(\"Constructor with name and hire date:\");
e4.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e5 = new Employee(\"Sharon Kelly\", \"123-45-6789\");
System.out.println(\"Constructor with name and ssn:\");
e5.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e6 = new Employee(\"Joann Rousch\", 333333.33, 1963);
System.out.println(\"Constructor with name, salary & hire date:\");
e6.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e7 = new Employee(\"Lucy Sharp\", 444444.44, \"987-65-4321\");
System.out.println(\"Constructor with name, salary & ssn:\");
e7.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e8 = new Employee(\"Pierre Sokolskis\", 1964, \"999-99-9999\");
System.out.println(\"Constructor with name, hire date & ssn:\");
e8.writeOutput();
System.out.println();
System.out.println(\"===============================\");
Employee e9 = new Employee(\"Last One\", 555.55, 1999,
\"888-88-8888\");
System.out.println(\"Constructor with name, salary, hire date, and ssn:\");
e9.writeOutput();
System.out.println();
System.out.println(\"===============================\");
// Test methods to change, return and write values
// change all
System.out.println(\"Before:\");
e9.writeOutput();
System.out.println();
Sy.
I am trying to change this code from STRUCTS to CLASSES, the members.pdfpetercoiffeur18
I am trying to change this code from STRUCTS to CLASSES, the members have to be private.
Well, I think I did a semi-ok job; the code doesn\'t run and I have no idea why. Can you please
help. Platform: C++
========== C++ CODE ============
#include
#include
#include
#include
#include //must have to use system (\"pause\" );
//#include \"personType.h\"
using namespace std;
const int MAX_EMPLOYEES = 50;
//----------------------------------
class employeeType{ //:public personType
private:
long empID;
string first;
string last;
char gender;
double payrate;
string jobRole;
int years;
public:
virtual void programmer_info() const=0;
//Function to output employee\'s data
virtual double cutBacks(employeeType let[], int listsize) const=0;
//Function to calculate and return the wages.
//Postcondition: Pay is calculated and returned
void yourFired(employeeType let[], int& listsize , long id); //int& cuz we are restando
cantidades de la lista.
//Function to set the salary. /Postcondition: personId = id
long seqSearch(employeeType let[], int listLength, int searchItem)const;
//Function to retrieve the id. /Postcondition: returns personID
employeeType (long id = 0, string first = \"\", string last = \"\", char gender = \"\",
double payrate = 0, string jobRole = \"\",int years = 0);
//Ibefore it was: userinput();
//Constructor with parameters //Sets the first name, last name, payRate, and
//hoursWorked according to the parameters. If no value is specified, the default
//values are assumed. //Postcondition: firstName = first;
///==============================================================
void getData(ifstream& inFile, class employeeType let[], int& listSize);
void printOne ( employeeType one);
void hireOne(employeeType let[], int& listsize); //int& cuz we are adding or restyando
cantidades de la lista.
void selectionSort( employeeType let[], int length);
void printList(employeeType let[], int listSize);
employeeType getOne ( ifstream& dataIn );
};
///===============================================================
void employeeType::yourFired(long id)
{
empID = id;
}
long employeeType::seqSearch() const
{
return empID;
}
employeeType::employeeType(long id, string first, string last, char gender,
double, string jobRole,int years)
: personType(first, last)
{
empID = id;
}
//----------------------------------
int main ()
{
int number; // number of employees in the file
int id;
char choice;
class employeeType [MAX_EMPLOYEES], newrecord;
ifstream dataFile;
dataFile.open ( \"newEmployees.txt\");
if (!dataFile){
cout << \"\ Error with input file!!\ \ \";
//system (\"pause\"); // must #include
return 1;
}
getData (dataFile, employeeType, number);
cout < to be used
/// TASK 3 =======================================================
for(int i =0; i<3 ; i++){ //calling hireOne 3 times, you can insert 3 new employees on a roll
hireOne(employeeType, number); // the list increases by up to 3 new records each time
}
cout << \"After hiring employees, new list: \ \"<> id;
your.
Program.cs class Program { static void Main(string[] args).pdfanandshingavi23
Program.cs:
class Program
{
static void Main(string[] args)
{
Console.WriteLine(\"Welcome the Employee Hierarchy Program\");
Console.WriteLine(\"CIS247, Week 5 Lab\");
Console.WriteLine(\"Name:
Solution
\");
Console.WriteLine(\" This program tests an Employee inheritance hierarchy \");
//Array to hold Employee type objects
Employee[] emp = new Employee[3];
//Initializing 3 values of array with 3 three types of classes
//Employee class object
emp[0] = new Employee(\"Joe\", \"Doe\", \'M\', 1, 10000.0, new Benefit(\"Partial\", 1000, 2));
//Salaried Employee
emp[1] = new Salaried(\"Zoe\", \"Likoudis\", \'F\', 3, 20000.0, new Benefit(\"Full\", 2000, 4), 1);
//Hourly Employee
emp[2] = new Hourly(\"Kate\", \"Perry\", \'F\', 0, 75, 25, new Benefit(\"Partial\", 3000, 8), \"part
time\");
//Displaying their data to the console
for (int i = 0; i < emp.Length; i++)
{
Console.WriteLine(\" ***************** Display Employee\'s Data ***************** \");
Console.WriteLine(emp[i].ToString());
}
//Displaying number of emps
Console.WriteLine(\" Total number of employees in Database: {0} \",
Employee.GetNumberOfEmployees());
} //End of Main method
} //End of Program class
}//End of namespace
Employee.cs:
class Employee
{
//Private data members
protected string firstName;
protected string lastName;
protected char gender;
protected int dependents;
protected double annualSalary;
//Number of employees
private static int numEmployees = 0;
//Benefit object
protected Benefit benefit;
//Default Constructor
public Employee()
{
firstName = \"not given\";
lastName = \"not given\";
gender = \'U\';
dependents = 0;
annualSalary = 20000;
//updates number of employees
numEmployees++;
benefit = new Benefit(\"not given\", 0, 0);
}//End of Default Constructor
//Argumented Constructor
public Employee(string first, string last, char gen, int dep, double salary, Benefit benefit)
{
firstName = first;
lastName = last;
gender = gen;
dependents = dep;
annualSalary = salary;
//Updates number of employees
numEmployees++;
this.benefit = new Benefit(benefit.GetHealthInsurance(), benefit.GetLifeInsurance(),
benefit.GetVacation());
}//End of Argumented Constructor
//Calculates weekly pay
public virtual double CalculatePay()
{
return annualSalary / 52;
}//End of CalculatePay method
//Displays all the data of the employee
public override string ToString()
{
return string.Format(\"Employee Type : {0} First Name : {1} Last Name : {2} Gender : {3}
Dependents : {4} Annual Salary : {5:c} Weekly Pay : {6:c} {7}\",
\"GENERIC\", FirstName, LastName, (Gender == \'M\') ? \"Male\" : \"Female\", Dependents,
AnnualSalary, CalculatePay(), benefit.ToString());
}//End of DisplayEmployee method
//Public properties
//Property for first name of the employee
public string FirstName
{
set
{
firstName = value;
}
get
{
return firstName;
}
}//End of FirstName method
//Property for last name of the employee
public string LastName
{
set
{
lastName = value;
}
get
{
return lastName;
}
}//End of LastName method
//Gender of.
in C++ Design a class named Employee The class should keep .pdfadithyaups
in C++ Design a class named Employee. The class should keep the following information in
member variables: Employee name Employee number Hire Date Write one or more constructors
and the appropriate accessor and mutator functions for the class. Next, write a class named
ProductionWorker that is derived from the Employee class. The ProductionWorker class should
have member variables to hold the following information: Shift (an integer) Hourly pay rate (a
double) The workday is divided into two shifts: day and night. The shift variable will hold an integer
value representing the shift that the employee works. The day shift is shift 1 and the night shift is
shift 2. Write one or more constructors and the appropriate accessor and mutator functions for the
class. Demonstrate the classes by writing a program that uses a ProductionWorker object." =>
MINIMUM for main(): To count as a Program, your Main must do: Please change so that data
entry is controlled by a loop that will allow the user to enter as many Employees and corollary
information list as they like. Ask them to enter C or c to continue or any other character to stop.
Have an option to print out all the employees and their data
I already completed the program, I just needed help on creating a loop that allows users to enter
as many employees and corollary information, and ask them to enter a c to continue or any other
character to stop.
Here is my code:
Any help is appreciated.
//Header file section
#include<iostream>
using namespace std;
//Employee class definition
class Employee
{
//instance variable declaration
private:
string eName;
string eNumber;
string hireDate;
public:
//constructor to initialize variables
Employee(string name,string number,string date)
{
eName=name;
eNumber=number;
hireDate=date;
}
//getter methods to return eName,eNumber and hireDate
string getEName()
{
return eName;
}
string getENumber()
{
return eNumber;
}
string getHireDate()
{
return hireDate;
}
//setter methods to set eName,eNumber and hireDate
void setEName(string name)
{
eName=name;
}
void setENumber(string number)
{
eNumber=number;
}
void setHireDate(string date)
{
hireDate=date;
}
};
//ProductionWorker derived from Employee class
class ProductionWorker:public Employee
{
//instance variable declaration
private:
int shift;
double hourlyPayRate;
double hoursWorked;
public:
//constructor to initialize variables
//passing varlues into base class
ProductionWorker(string name,string number,string date,int s,double hRate,double
hWorked):Employee(name,number,date)
{
shift=s;
hourlyPayRate=hRate;
hoursWorked=hWorked;
}
//getter methods to return shift,hourlyPayRate and hoursWorked
int getShift()
{
return shift;
}
double gethourlyPayRate()
{
return hourlyPayRate;
}
double getHoursWorked()
{
return hoursWorked;
}
//setter methods to set shift,hourlyPayRate and hoursWorked
void setShift(int s)
{
shift=s;
}
void sethourlyPayRate(double hRate)
{
hourlyPayRate=hRate;
}
void setHoursWorked(double hWorked)
{
hoursWorked=h.
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdfarracollection
Repeat Programming Project 2 in Chapter 5. This time, add the following four constructor
methods: one for each instance variable, one with two parameters for the two instance variables,
and a default constructor. Be sure that each constructor sets all the instance variables. write a
driver program to test each of the methods, including each of the four constructors and at least
one true or false case for each of the test method.
this is the code that i have to add four constructor methods to
import java.util.*;
public class PersonImproved// Counter is the name of the class and i saved it in a file named
PersonImproved.
{
//Data members
private String name;
private int age;
public void readInput()
{
Scanner keyboard = new Scanner(System.in);
System.out.println(\"What is the person\'s name?\");// This gets the program ready for
keyboard input by telling us that there is a new scanner called keyboard, that is accepting user
input.
name = keyboard.nextLine();
System.out.println(\"What is the person\'s age?\");
age = keyboard.nextInt();
while (age < 0)
{
System.out.println(\"Age cannot be negative.\");
System.out.println(\"Reenter age:\");
age = keyboard.nextInt();
}
}
public void writeOutput()
{
System.out.println(\"Name = \" + name);
System.out.println(\"Age = \" + age);
}
//method to set non negative age
public void set(String newName, int newAge)
{
name = newName;
if (newAge >= 0)
age = newAge;
else
{
System.out.println(\"ERROR: Used a negative age.\");
System.exit(0);
}
}
//method to setting name
public void setName(String newName)
{
name = newName;
}
//method to set age
public void setAge(int newAge)
{
if (newAge >= 0)
age = newAge;
else
{
System.out.println(\"ERROR: Used a negative age.\");
System.exit(0);
}
} //to get name
public String getName()
{
return name;
}
public int getAge()
{
return age;
}
/*Boolean tests for if two persons are equal (same name and age), if two persons
have the same name, if two persons have the same age, if one person is older
than another, and if one person is younger than another.*/
public boolean equals(PersonImproved another)
{
return(this.name.equalsIgnoreCase(another.name)
&& this.getAge() == another.getAge());
}
public boolean isSameName(PersonImproved another)
{
return(this.name.equalsIgnoreCase(another.name));
}
public boolean isSameAge(PersonImproved another)
{
return(this.getAge() == another.getAge());
}
public boolean isOlderThan(PersonImproved another)
{
return(this.getAge() > another.getAge());
}
public boolean isYoungerThan(PersonImproved
another)
{
return(this.getAge() < another.getAge());
}
}
and this is the test file
public class PersonCh6Test
{
public static void main(String[] args)
{
System.out.println();
System.out.println(\"Test case 1: default constructor and\");
System.out.println(\"writeOutput() method.\");
System.out.println();
PersonCh6 secretAgent1 = new PersonCh6();
System.out.println(\"Results of default constructor:\");
System.out.println(\"Should be name = \\\"No name\\\" and\");
S.
Having issues with passing my values through different functions aft.pdfrajkumarm401
Having issues with passing my values through different functions after \"EmployeeRecord()\".
Problem: This database must be capable of maintaining the employee ID, employee name,
department, and annual salary of each sales rep. The first phase of development for this database
will be to create the EmployeeRecord class.
Header File
#pragma once
class EmployeeRecord
{
private:
int m_iEmployeeID;
char m_sLastName[32];
char m_sFirstName[32];
int m_iDeptID;
double m_dSalary;
public:
EmployeeRecord(); //The default constructor
EmployeeRecord(int ID, char *fName, char *lName, int dept, double sal);// Constructor shall set
the member values passed into the function.
~EmployeeRecord();// The destructor
int getID();// shall return the value stored in the member variable
void setID(int ID);// will set the member variable m_iEmployeeID to the value of its\' argument.
void getName(char *fName, char *lName);// The getName() function shall copy the member
variables m_sFirstName and m_sLastName into the character arrays pointed to by the function
arguments.
void setName(char *fName, char *lName);// The setName() function will copy the function
arguments into the member variables m_sFirstName and m_sLastName.
void getDept(int& d);// The getDept() function shall be defined as a reference function. That is,
a call to this function will copy the member variable m_iDeptID into the int variable referenced
by the function argument.
void setDept(int d);// The setDept() function will copy the function argument into the member
variable m_iDeptID.
void getSalary(double *sal);// he getSalary() function shall be defined as a pointer function.
void setSalary(double sal);//the function setSalary() shall copy the function argument into the
member variable m_dSalary.
void printRecord(); //This function shall print to the screen all data found in the employee\'s
record.
};
Main File
#include
#include \"EmployeeRecord.h\"
#include
#include
using namespace std;
//Default Constructor
EmployeeRecord::EmployeeRecord()
{
// The default constructor shall set the member variables to the following
m_iEmployeeID = 0;
m_sFirstName[0] = \'\\0\';
m_sLastName[0] = \'\\0\';
m_iDeptID = 0;
m_dSalary = 0.0;
}
EmployeeRecord::EmployeeRecord(int ID, char *fName, char *lName, int dept, double sal)
{
fName=NULL;
lName=NULL;
strcpy(m_sFirstName, fName);
strcpy(m_sLastName, lName);
}
// Default Desctrutor
EmployeeRecord::~EmployeeRecord()
{
// It was tested in sprint 1
}
int EmployeeRecord:: getID()
{
return m_iEmployeeID;
}
void EmployeeRecord::setID(int ID)
{
m_iEmployeeID = ID;
}
void EmployeeRecord::getName(char *fName, char *lName)
{
strcpy(m_sFirstName, fName);
strcpy(m_sLastName, lName);
/*char *newString = new char[strlen(theString) + 1];
strcpy(newString, theString);
return newString;*/
}
void EmployeeRecord::setName(char *fName, char *lName)
{
/*clearString(); // Clear the current string, if any
theString = new char[strlen(str) + 1]; // Allocate memory for new string
strcpy(theString, str.
HELP IN JAVACreate a main method and use these input files to tes.pdffatoryoutlets
For the questions below, use the W3Schools customer orders database. You need to submit
thoroughly tested SQL statements. For your convenience and reference, relevant data model is
attached as a PDF document with the assignment in the Blackboard. Name of this document is
\"Relationship diagram for W3schools order pdf.\" 1) Write a query to show Customers\' Country
wise sales totals. Your query should show Customers\' Country name and the total sale value for
that Country 2) Write a query to show Product wise sales totals. Your query should Product
name and the total sale value for that Product. 3) Write a query to show the number of orders for
each shipper. Your query should show shipper name and the count of orders with the shipper. 4)
Write a query to show number of products in each product category. Your query should show
Category name and number of products in that category 5) Write a query that shows Customers\'
country wise customer count, and order count. Your query should show country name, total
number of customers from that country, and total number of orders from the customers of that
country 6) Write a query that shows the number of products supplied by each Supplier. Your
query should show Country name, supplier name and the count of products supplied by that
supplier. Note: Sale Price Orderdetails.Quantity Products.price (see an example in the class
slides deck) W3SCHOOLS SQL is located at http://www.w3schools.com/sql/default.asp
(Preferred browser is Chrome). On this page you will find a button called \"Try it yourself\".
Click on that button. You will be redirected to a page where you see a list of tables on the right
side of the page. It is highly recommended to click \'Restore Database\' button on this page
during every session. The page contains a box where you can type in an SQL statement
involving the listed tables. You type in your SQL statement in that box and click on \"Run
SQL\'\' button. The results will be displayed if your SQL statement is syntactically correct.
Solution
1. SELECT Customers.Country, SUM(OrderDetails.Quantity * Products.Price) AS Total_Sale
FROM Customers
LEFT JOIN Orders ON Customers.CustomerID=Orders.CustomerID
LEFT JOIN OrderDetails ON Orders.OrderId=OrderDetails.OrderId
LEFT JOIN Products ON OrderDetails.ProductId=Products.ProductId
Group BY Customers.Country;
2. SELECT Products.ProductName, SUM(OrderDetails.Quantity * Products.Price) AS
Total_Sale FROM Customers
LEFT JOIN Orders ON Customers.CustomerID=Orders.CustomerID
LEFT JOIN OrderDetails ON Orders.OrderId=OrderDetails.OrderId
LEFT JOIN Products ON OrderDetails.ProductId=Products.ProductId
Group BY Products.ProductName;
You can edit these query to get other results set..
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docxnormanibarber20063
INTERMIDIATE PROGRAMMING
CMPSC 122
LAB 9: INHERITANCE AND POLYMORPHISIM
SPRING 2017
Goal
In this assignment students will practice inheritance and polymorphism in C++.Objectives
Class Programming: Given an object-based entity with specific functionality, students should be able to create an equivalent C++ class to represent it.
Problem:
1. Add to class patientType the date when the patient was admitted in the hospital, and the date when the patient was discharged from the hospital (Use the class Date class you wrote in the prelab) to store admit date, discharge date. Modify constructors and add member functions to initialize access, and manipulate the new added data members.
2. In main(), create a vector of pointers to type TeamPerson. Fill it up with at least three objects. One of TeamPerson, one of doctorType and one of patientType.
3. Print all the data of the three objects of the vector. Make sure each object is printed according to its print function.
Rubric
Total: 18 pts
a. Question 1: 8 pts
b. Question 2: 5 pts
c. Question 3: 5 pts
Please follow the program documentation and submission guidelines to earn full credit.
Submission
ZIP YOUR PROJECT (.sln included) in a folder, call it “Lab9” and upload it on Canvas under “Lab 9”. Make sure that your submission was successful. You can upload as many times as you like on Canvas, however only the second submission will be graded. Make sure to read the syllabus for more details about labs submission and late submission.
Honor code
“I pledge on my honor that I have not given or received any unauthorized assistance on this assignment/examination”
New folder/Date.cppNew folder/Date.cpp
#include<iostream>
#include<ostream>
#include"Date.h"
usingnamespace std;
//Overloaded constructor
Date::Date(int nmonth,int nday,int nyear)
{
day = nday;
year = nyear;
month = nmonth;
return;
}
//Function to get the day
intDate::getDay()
{
return day;
}
//Function to get the year
intDate::getYear()
{
return year;
}
//Fucntion to get the Month
intDate::getMonth()
{
return month;
}
//Funtion to set the day
voidDate::setDay(int n)
{
day = n;
return;
}
//fucntion to set the year
voidDate::setYear(int y)
{
year = y;
return;
}
//function to set the month
voidDate::setMonth(int m)
{
month = m;
return;
}
ostream&operator<<(ostream& os,constDate&p){
os <<"Month: "<< p.month <<'\n'
<<"Day: "<< p.day <<'\n'
<<"Year: "<< p.year << endl;
return os;
}
/*the specialty of doctor is NLX
the patient's id is 9527
the patient's age is 21
the patient's birthday is Month: 1
Day: 15
Year : 1997
'\\psbdfilesrvr.psu-erie.bd.psu.edu\student\YVW5455\Private\desktop\prelab\prela
b'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.Defaulting to Windows directory.
Press any key to continue . . .*/
New folder/Date.h
//#pragma once
#ifndef DATE_H
#define DATE_H
#include<ostream>
using namespace std;
//Defi.
So Far I have these two classes but I need help with my persontest c.pdfarihantgiftgallery
So Far I have these two classes but I need help with my persontest class:
The next step is to add method calls for the accessor methods after each input:
//Reading and updating values
System.out.print(\"\ Enter Person Name: \");
person1.setPersonName(sc.nextLine());
System.out.println(\"You entered: \" + person1.getPersonName());
Call the accessor function each time you ask for input, after capturing that input. Then repeat for
a second Person, only this time call the constructor that takes the student id as a parameter.
7 import java.util.Scanner;
8
9 class PersonTest
10 {
11 //Main method
12 public static void main(String args[])
13 {
14 Scanner sc = new Scanner(System.in);
15
16 //Creating object
17 Persons_Information person1 = new Persons_Information();
18
19 //Reading and updating values
20 System.out.print(\"\ Enter Person Name: \");
21 person1.setPersonName(sc.nextLine());
22
23 System.out.print(\"\ Enter Current Address: \");
24 person1.setCurrentAdress(sc.nextLine());
25
26 System.out.print(\"\ Enter Permanent Address: \");
27 person1.setpermanentAdress(sc.nextLine());
28
29 System.out.print(\"\ Enter ID number: \");
30 person1.setIdNumber(sc.nextInt());
31
32 sc.nextLine();
33
34 System.out.print(\"\ Enter Birth Date: \");
35 person1.setBirthDate(sc.nextLine());
36
37
38 System.out.print(\"\ Enter Person Age: \");
39 person1.setPersonAge(sc.nextInt());
40
41
42 System.out.print(\"\ Enter Entry Year: \");
43 person1.setEntryYear(sc.nextInt());
44
45
46 System.out.print(\"\ Enter Total Years: \");
47 person1.setTotalYears(sc.nextInt());
48
49 //Printing person 1 details
50 System.out.println(\"\ Person 1: \ \" + person1.toString());
51 }
52 }
Solution
Persons_Information.java
public class Persons_Information {
//Declaring instance variables
private String personName;
private String currentAdress;
private String permanentAdress;
private int idNumber;
private String birthDate;
private int personAge;
private int entryYear;
private int totalYears;
//Zero argumented constructor
public Persons_Information()
{
}
//Parameterized constructor
public Persons_Information(int idNumber) {
this.idNumber = idNumber;
}
//Getters and setters
public String getPersonName() {
return personName;
}
public void setPersonName(String personName) {
this.personName = personName;
}
public String getCurrentAdress() {
return currentAdress;
}
public void setCurrentAdress(String currentAdress) {
this.currentAdress = currentAdress;
}
public String getPermanentAdress() {
return permanentAdress;
}
public void setPermanentAdress(String permanentAdress) {
this.permanentAdress = permanentAdress;
}
public int getIdNumber() {
return idNumber;
}
public void setIdNumber(int idNumber) {
this.idNumber = idNumber;
}
public String getBirthDate() {
return birthDate;
}
public void setBirthDate(String birthDate) {
this.birthDate = birthDate;
}
public int getPersonAge() {
return personAge;
}
public void setPersonAge(int personAge) {
this.personAge = personAge;
}
public int getEntryYe.
Write a C++ program with a function defined to give the person a .pdfarihantgiftgallery
Write a C++ program with a function defined to give the person a 20% raise?
Please explain. Thanks
Write a C++ program with a function defined to give the person a 20% raise?
Please explain. Thanks
Please explain. Thanks
Solution
#include
#include
#define SIZE 5 // we are defining the size of entries / variables to 5
class emp
{
float basic,da,it,netsal; // salary , da and netsalary are mentioned in float
char name[20],num[10];
public:
void getdata(); // function to get employee data
void net_sal(); // function to get employee salary
void sal_hike(); // fuction to display hike based on net salary
void dispdata(); // to dislay data
};
void emp::getdata() // enter basic employee details
{
cout<<\"\ Enter employee number: \" ;
cin>>name;
cout<<\" Enter employee name: \" ;
cin>>num;
cout<<\"Enter employee basic salary in Rs: \" ;
cin>>basic;
}
void emp::net_sal() // calculate net salary
{
da=((0.52)*basic );
float gsal=da+basic;
it=((0.3)*gsal);
netsal=gsal-it;
}
void emp::sal_hike() // compute salary hike
int hike=net_sal + 0.2*net_sal;
}
void emp::dispdata() // to display data
{
cout
<<\"\ Employee number: \"<>n;
for(int i=0;i.
This code has nine errors- but I don't know how to solve it- Please g.pdfaamousnowov
This code has nine errors, but I don't know how to solve it.
Please give me a code that resolves all errors and executes well. Please provide the code for
each file name.
( Employee.h, Employee.cpp, ProductionWorker.h, ProductionWorker.cpp,
TeamLeader.h, TeamLeader.cpp, Main.cpp)
Employee.h
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
using namespace std;
class Employee
{
private:
string employeeName;
string employeeNumber;
string hireDate;
public:
Employee(); // default constructor
Employee(string name, string number, string date); // constructor with parameters
void setEmployeeName(string employeeName); // set employee name
void setEmployeeNumber(string employeeNumber); // set employee number
void setHireDate(string hireDate); // set hire date
string getEmployeeName() const; // get employee name
string getEmployeeNumber() const; // get employee number
string getHireDate() const; // get hire date
};
Employee.cpp
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "Employee.h"
Employee::Employee()
{
cout << "Please answer some questions about your employees. " << endl;
}
// Constructor with parameters
Employee::Employee(string name, string number, string date)
{
employeeName = name;
employeeNumber = number;
hireDate = date;
}
// Set employee name
void Employee::setEmployeeName(string name)
{
employeeName = name;
}
// Set employee number
void Employee::setEmployeeNumber(string number)
{
employeeNumber = number;
}
// Set hire date
void Employee::setHireDate(string date)
{
hireDate = date;
}
// Get employee name
string Employee::getEmployeeName() const
{
return employeeName;
}
// Get employee number
string Employee::getEmployeeNumber() const
{
return employeeNumber;
}
// Get hire date
string Employee::getHireDate() const
{
return hireDate;
}
ProductionWorker.h
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "Employee.h"
using namespace std;
class ProductionWorker : public Employee
{
private:
int shift;
int hourlyPay;
public:
ProductionWorker(); // default constructor
ProductionWorker(string name, string number, string date, int s, int pay); // constructor with
parameters
void setShift(int shift); // set shift
void setHourlyPay(int pay); // set hourly pay
int getShift() const; // get shift
int getHourlyPay() const; // get hourly pay
};
ProductionWorker.cpp
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "ProductionWorker.h"
// Default constructor
ProductionWorker::ProductionWorker()
{
cout << "Your responses will be displayed after all data has been received." << endl;
}
// Constructor with parameters
ProductionWorker::ProductionWorker(string name, string number, string date, int s, int pay)
: Employee(name, number, date)
{
shift = s;
hourlyPay = pay;
}
// Set shift
void ProductionWorker::setShift(int s)
{
shift = s;
}
// Set hourly pay
void ProductionWorker::setHourlyPay(int pay)
{
hourlyPay = pay;
}
// Get sh.
You have just been hired as an information security engineer for a l.pdffeelingspaldi
You have just been hired as an information security engineer for a large, multi-international
corporation. Unfortunately, your company has suffered multiple security breaches that have
threatened customers\' trust in the fact that their confidential data and financial assets are private
and secured. Credit card information was compromised by an attack that infiltrated the network
through a vulnerable wireless connection within the organization. The other breach was an inside
job where personal data was stolen because of weak access control policies within the
organization that allowed an unauthorized individual access to valuable data. Your job is to
develop a risk management policy that addresses the two security breaches and how to mitigate
these risks.
Solution
Risk management is a structured approach to administering uncertainty and consist of actions
obtain to identify, assess, monitor, and reduce the impact of risks to your big business. Risks are
events, conditions or circumstances which lead to negative consequences for your business. A
good risk management plan with appropriate risk management strategies can minimize costly
and stressful problems, and may also decrease insurance claims and premiums. Efficient risk
management starts with the recognizing, by every person in the organization, that the effort is
main, and that everyone is supposed to uphold that effort. So far the organization has had its
security breached on a number of occasions. According to this trouble, the organization has
situated a high level of importance on physical and password security and anti-virus and anti-
spyware security. It has also make a decision to use 2 layers of firewalls to prevent hackers from
getting in. The organization will also use the IDSs and Virtual Private Networks. These steps
with the help of employees and staff should help prevent unauthorized intrusions from both
internal and external intruders that will take sensitive information from our clients. Management
has the ultimate responsibility to manage risks. Control includes making decisions considering
which risks are acceptable and how to address those that are not. Those decisions can be made
only with the participation of the entire workforce, since each of us understands the risks of his
or her own tasks improved than anyone else in the organization..
Write an essay consists of 5 paragraphs (comparing between a city and.pdffeelingspaldi
Write an essay consists of 5 paragraphs (comparing between a city and town in education,
transportation, population) Outline: Introduction: Hook General information Thesis statement
Body paragraph 1: Education Body paragraph 2: Transportation Body paragraph 3:
Population Conclusion: Rewrite the introduction in different way.
Solution
Please follow the data and description :
OUTLINE :
Town : In the general scenario a town is an urban area that has a name, defined boundaries, and a
local government, that is larger than a village and smaller than a city.
City : This is a large town.
Cities and towns are differentiated primarily by an area and its geography. The governance of
cities is handled by corporate bodies whereas municipal bodies rule the towns. Generally a
mayor is the head of a city corporation, on the other hand a chairman is the head of a
municipality. The ultimate power mainly rests in the cities and not in the towns.
EDUCATION :
For a person the character would be regarded based on the qualification. So the education for all
is important around the globe. In a town the education is satisfactory provided the related
infrastructure is available over a period of time. A town is a combination of the culture and the
concrete. So these standards are not to the mark for to be satisfied.
But for a City we could have various choices even in the institutions as they are well developed
and demanded based on the standards. The institutions from all over the state/country competes
to establish their branches that makes them expanded over the time to give the education. In the
same way the people even look for a high standard institutions to make their children\'s future
best.
TRANSPORTATION :
With the change in the demand and the supply the transporation even changes as the people need
to be well enough to move from place to place frequently. As a town is smaller comparitively the
transporation of th eplace could be less effective comparitively.
While in a city the development is at a great pace the transporation even play a key role for the
ease of development. With this the place could also be demanded for a cleaner and a perfect
future.
POPULATION :
This is the main choice where the key role of all the developments is considered. For a city the
population moderate where the land and the population are sufficient for the requirement.
For the city this is the main cause where the development is at a great pace and the oppurtunities
are more enough for an individual.
CONCLUSION :
Comparitively the cities are more and more useful for the great oppurtunities and the uses.
Hope this is helpful..
More Related Content
Similar to Create a C# applicationYou are to create a class object called “Em.pdf
Repeat Programming Project 2 in Chapter 5. This time, add the follow.pdfarracollection
Repeat Programming Project 2 in Chapter 5. This time, add the following four constructor
methods: one for each instance variable, one with two parameters for the two instance variables,
and a default constructor. Be sure that each constructor sets all the instance variables. write a
driver program to test each of the methods, including each of the four constructors and at least
one true or false case for each of the test method.
this is the code that i have to add four constructor methods to
import java.util.*;
public class PersonImproved// Counter is the name of the class and i saved it in a file named
PersonImproved.
{
//Data members
private String name;
private int age;
public void readInput()
{
Scanner keyboard = new Scanner(System.in);
System.out.println(\"What is the person\'s name?\");// This gets the program ready for
keyboard input by telling us that there is a new scanner called keyboard, that is accepting user
input.
name = keyboard.nextLine();
System.out.println(\"What is the person\'s age?\");
age = keyboard.nextInt();
while (age < 0)
{
System.out.println(\"Age cannot be negative.\");
System.out.println(\"Reenter age:\");
age = keyboard.nextInt();
}
}
public void writeOutput()
{
System.out.println(\"Name = \" + name);
System.out.println(\"Age = \" + age);
}
//method to set non negative age
public void set(String newName, int newAge)
{
name = newName;
if (newAge >= 0)
age = newAge;
else
{
System.out.println(\"ERROR: Used a negative age.\");
System.exit(0);
}
}
//method to setting name
public void setName(String newName)
{
name = newName;
}
//method to set age
public void setAge(int newAge)
{
if (newAge >= 0)
age = newAge;
else
{
System.out.println(\"ERROR: Used a negative age.\");
System.exit(0);
}
} //to get name
public String getName()
{
return name;
}
public int getAge()
{
return age;
}
/*Boolean tests for if two persons are equal (same name and age), if two persons
have the same name, if two persons have the same age, if one person is older
than another, and if one person is younger than another.*/
public boolean equals(PersonImproved another)
{
return(this.name.equalsIgnoreCase(another.name)
&& this.getAge() == another.getAge());
}
public boolean isSameName(PersonImproved another)
{
return(this.name.equalsIgnoreCase(another.name));
}
public boolean isSameAge(PersonImproved another)
{
return(this.getAge() == another.getAge());
}
public boolean isOlderThan(PersonImproved another)
{
return(this.getAge() > another.getAge());
}
public boolean isYoungerThan(PersonImproved
another)
{
return(this.getAge() < another.getAge());
}
}
and this is the test file
public class PersonCh6Test
{
public static void main(String[] args)
{
System.out.println();
System.out.println(\"Test case 1: default constructor and\");
System.out.println(\"writeOutput() method.\");
System.out.println();
PersonCh6 secretAgent1 = new PersonCh6();
System.out.println(\"Results of default constructor:\");
System.out.println(\"Should be name = \\\"No name\\\" and\");
S.
Having issues with passing my values through different functions aft.pdfrajkumarm401
Having issues with passing my values through different functions after \"EmployeeRecord()\".
Problem: This database must be capable of maintaining the employee ID, employee name,
department, and annual salary of each sales rep. The first phase of development for this database
will be to create the EmployeeRecord class.
Header File
#pragma once
class EmployeeRecord
{
private:
int m_iEmployeeID;
char m_sLastName[32];
char m_sFirstName[32];
int m_iDeptID;
double m_dSalary;
public:
EmployeeRecord(); //The default constructor
EmployeeRecord(int ID, char *fName, char *lName, int dept, double sal);// Constructor shall set
the member values passed into the function.
~EmployeeRecord();// The destructor
int getID();// shall return the value stored in the member variable
void setID(int ID);// will set the member variable m_iEmployeeID to the value of its\' argument.
void getName(char *fName, char *lName);// The getName() function shall copy the member
variables m_sFirstName and m_sLastName into the character arrays pointed to by the function
arguments.
void setName(char *fName, char *lName);// The setName() function will copy the function
arguments into the member variables m_sFirstName and m_sLastName.
void getDept(int& d);// The getDept() function shall be defined as a reference function. That is,
a call to this function will copy the member variable m_iDeptID into the int variable referenced
by the function argument.
void setDept(int d);// The setDept() function will copy the function argument into the member
variable m_iDeptID.
void getSalary(double *sal);// he getSalary() function shall be defined as a pointer function.
void setSalary(double sal);//the function setSalary() shall copy the function argument into the
member variable m_dSalary.
void printRecord(); //This function shall print to the screen all data found in the employee\'s
record.
};
Main File
#include
#include \"EmployeeRecord.h\"
#include
#include
using namespace std;
//Default Constructor
EmployeeRecord::EmployeeRecord()
{
// The default constructor shall set the member variables to the following
m_iEmployeeID = 0;
m_sFirstName[0] = \'\\0\';
m_sLastName[0] = \'\\0\';
m_iDeptID = 0;
m_dSalary = 0.0;
}
EmployeeRecord::EmployeeRecord(int ID, char *fName, char *lName, int dept, double sal)
{
fName=NULL;
lName=NULL;
strcpy(m_sFirstName, fName);
strcpy(m_sLastName, lName);
}
// Default Desctrutor
EmployeeRecord::~EmployeeRecord()
{
// It was tested in sprint 1
}
int EmployeeRecord:: getID()
{
return m_iEmployeeID;
}
void EmployeeRecord::setID(int ID)
{
m_iEmployeeID = ID;
}
void EmployeeRecord::getName(char *fName, char *lName)
{
strcpy(m_sFirstName, fName);
strcpy(m_sLastName, lName);
/*char *newString = new char[strlen(theString) + 1];
strcpy(newString, theString);
return newString;*/
}
void EmployeeRecord::setName(char *fName, char *lName)
{
/*clearString(); // Clear the current string, if any
theString = new char[strlen(str) + 1]; // Allocate memory for new string
strcpy(theString, str.
HELP IN JAVACreate a main method and use these input files to tes.pdffatoryoutlets
For the questions below, use the W3Schools customer orders database. You need to submit
thoroughly tested SQL statements. For your convenience and reference, relevant data model is
attached as a PDF document with the assignment in the Blackboard. Name of this document is
\"Relationship diagram for W3schools order pdf.\" 1) Write a query to show Customers\' Country
wise sales totals. Your query should show Customers\' Country name and the total sale value for
that Country 2) Write a query to show Product wise sales totals. Your query should Product
name and the total sale value for that Product. 3) Write a query to show the number of orders for
each shipper. Your query should show shipper name and the count of orders with the shipper. 4)
Write a query to show number of products in each product category. Your query should show
Category name and number of products in that category 5) Write a query that shows Customers\'
country wise customer count, and order count. Your query should show country name, total
number of customers from that country, and total number of orders from the customers of that
country 6) Write a query that shows the number of products supplied by each Supplier. Your
query should show Country name, supplier name and the count of products supplied by that
supplier. Note: Sale Price Orderdetails.Quantity Products.price (see an example in the class
slides deck) W3SCHOOLS SQL is located at http://www.w3schools.com/sql/default.asp
(Preferred browser is Chrome). On this page you will find a button called \"Try it yourself\".
Click on that button. You will be redirected to a page where you see a list of tables on the right
side of the page. It is highly recommended to click \'Restore Database\' button on this page
during every session. The page contains a box where you can type in an SQL statement
involving the listed tables. You type in your SQL statement in that box and click on \"Run
SQL\'\' button. The results will be displayed if your SQL statement is syntactically correct.
Solution
1. SELECT Customers.Country, SUM(OrderDetails.Quantity * Products.Price) AS Total_Sale
FROM Customers
LEFT JOIN Orders ON Customers.CustomerID=Orders.CustomerID
LEFT JOIN OrderDetails ON Orders.OrderId=OrderDetails.OrderId
LEFT JOIN Products ON OrderDetails.ProductId=Products.ProductId
Group BY Customers.Country;
2. SELECT Products.ProductName, SUM(OrderDetails.Quantity * Products.Price) AS
Total_Sale FROM Customers
LEFT JOIN Orders ON Customers.CustomerID=Orders.CustomerID
LEFT JOIN OrderDetails ON Orders.OrderId=OrderDetails.OrderId
LEFT JOIN Products ON OrderDetails.ProductId=Products.ProductId
Group BY Products.ProductName;
You can edit these query to get other results set..
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docxnormanibarber20063
INTERMIDIATE PROGRAMMING
CMPSC 122
LAB 9: INHERITANCE AND POLYMORPHISIM
SPRING 2017
Goal
In this assignment students will practice inheritance and polymorphism in C++.Objectives
Class Programming: Given an object-based entity with specific functionality, students should be able to create an equivalent C++ class to represent it.
Problem:
1. Add to class patientType the date when the patient was admitted in the hospital, and the date when the patient was discharged from the hospital (Use the class Date class you wrote in the prelab) to store admit date, discharge date. Modify constructors and add member functions to initialize access, and manipulate the new added data members.
2. In main(), create a vector of pointers to type TeamPerson. Fill it up with at least three objects. One of TeamPerson, one of doctorType and one of patientType.
3. Print all the data of the three objects of the vector. Make sure each object is printed according to its print function.
Rubric
Total: 18 pts
a. Question 1: 8 pts
b. Question 2: 5 pts
c. Question 3: 5 pts
Please follow the program documentation and submission guidelines to earn full credit.
Submission
ZIP YOUR PROJECT (.sln included) in a folder, call it “Lab9” and upload it on Canvas under “Lab 9”. Make sure that your submission was successful. You can upload as many times as you like on Canvas, however only the second submission will be graded. Make sure to read the syllabus for more details about labs submission and late submission.
Honor code
“I pledge on my honor that I have not given or received any unauthorized assistance on this assignment/examination”
New folder/Date.cppNew folder/Date.cpp
#include<iostream>
#include<ostream>
#include"Date.h"
usingnamespace std;
//Overloaded constructor
Date::Date(int nmonth,int nday,int nyear)
{
day = nday;
year = nyear;
month = nmonth;
return;
}
//Function to get the day
intDate::getDay()
{
return day;
}
//Function to get the year
intDate::getYear()
{
return year;
}
//Fucntion to get the Month
intDate::getMonth()
{
return month;
}
//Funtion to set the day
voidDate::setDay(int n)
{
day = n;
return;
}
//fucntion to set the year
voidDate::setYear(int y)
{
year = y;
return;
}
//function to set the month
voidDate::setMonth(int m)
{
month = m;
return;
}
ostream&operator<<(ostream& os,constDate&p){
os <<"Month: "<< p.month <<'\n'
<<"Day: "<< p.day <<'\n'
<<"Year: "<< p.year << endl;
return os;
}
/*the specialty of doctor is NLX
the patient's id is 9527
the patient's age is 21
the patient's birthday is Month: 1
Day: 15
Year : 1997
'\\psbdfilesrvr.psu-erie.bd.psu.edu\student\YVW5455\Private\desktop\prelab\prela
b'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.Defaulting to Windows directory.
Press any key to continue . . .*/
New folder/Date.h
//#pragma once
#ifndef DATE_H
#define DATE_H
#include<ostream>
using namespace std;
//Defi.
So Far I have these two classes but I need help with my persontest c.pdfarihantgiftgallery
So Far I have these two classes but I need help with my persontest class:
The next step is to add method calls for the accessor methods after each input:
//Reading and updating values
System.out.print(\"\ Enter Person Name: \");
person1.setPersonName(sc.nextLine());
System.out.println(\"You entered: \" + person1.getPersonName());
Call the accessor function each time you ask for input, after capturing that input. Then repeat for
a second Person, only this time call the constructor that takes the student id as a parameter.
7 import java.util.Scanner;
8
9 class PersonTest
10 {
11 //Main method
12 public static void main(String args[])
13 {
14 Scanner sc = new Scanner(System.in);
15
16 //Creating object
17 Persons_Information person1 = new Persons_Information();
18
19 //Reading and updating values
20 System.out.print(\"\ Enter Person Name: \");
21 person1.setPersonName(sc.nextLine());
22
23 System.out.print(\"\ Enter Current Address: \");
24 person1.setCurrentAdress(sc.nextLine());
25
26 System.out.print(\"\ Enter Permanent Address: \");
27 person1.setpermanentAdress(sc.nextLine());
28
29 System.out.print(\"\ Enter ID number: \");
30 person1.setIdNumber(sc.nextInt());
31
32 sc.nextLine();
33
34 System.out.print(\"\ Enter Birth Date: \");
35 person1.setBirthDate(sc.nextLine());
36
37
38 System.out.print(\"\ Enter Person Age: \");
39 person1.setPersonAge(sc.nextInt());
40
41
42 System.out.print(\"\ Enter Entry Year: \");
43 person1.setEntryYear(sc.nextInt());
44
45
46 System.out.print(\"\ Enter Total Years: \");
47 person1.setTotalYears(sc.nextInt());
48
49 //Printing person 1 details
50 System.out.println(\"\ Person 1: \ \" + person1.toString());
51 }
52 }
Solution
Persons_Information.java
public class Persons_Information {
//Declaring instance variables
private String personName;
private String currentAdress;
private String permanentAdress;
private int idNumber;
private String birthDate;
private int personAge;
private int entryYear;
private int totalYears;
//Zero argumented constructor
public Persons_Information()
{
}
//Parameterized constructor
public Persons_Information(int idNumber) {
this.idNumber = idNumber;
}
//Getters and setters
public String getPersonName() {
return personName;
}
public void setPersonName(String personName) {
this.personName = personName;
}
public String getCurrentAdress() {
return currentAdress;
}
public void setCurrentAdress(String currentAdress) {
this.currentAdress = currentAdress;
}
public String getPermanentAdress() {
return permanentAdress;
}
public void setPermanentAdress(String permanentAdress) {
this.permanentAdress = permanentAdress;
}
public int getIdNumber() {
return idNumber;
}
public void setIdNumber(int idNumber) {
this.idNumber = idNumber;
}
public String getBirthDate() {
return birthDate;
}
public void setBirthDate(String birthDate) {
this.birthDate = birthDate;
}
public int getPersonAge() {
return personAge;
}
public void setPersonAge(int personAge) {
this.personAge = personAge;
}
public int getEntryYe.
Write a C++ program with a function defined to give the person a .pdfarihantgiftgallery
Write a C++ program with a function defined to give the person a 20% raise?
Please explain. Thanks
Write a C++ program with a function defined to give the person a 20% raise?
Please explain. Thanks
Please explain. Thanks
Solution
#include
#include
#define SIZE 5 // we are defining the size of entries / variables to 5
class emp
{
float basic,da,it,netsal; // salary , da and netsalary are mentioned in float
char name[20],num[10];
public:
void getdata(); // function to get employee data
void net_sal(); // function to get employee salary
void sal_hike(); // fuction to display hike based on net salary
void dispdata(); // to dislay data
};
void emp::getdata() // enter basic employee details
{
cout<<\"\ Enter employee number: \" ;
cin>>name;
cout<<\" Enter employee name: \" ;
cin>>num;
cout<<\"Enter employee basic salary in Rs: \" ;
cin>>basic;
}
void emp::net_sal() // calculate net salary
{
da=((0.52)*basic );
float gsal=da+basic;
it=((0.3)*gsal);
netsal=gsal-it;
}
void emp::sal_hike() // compute salary hike
int hike=net_sal + 0.2*net_sal;
}
void emp::dispdata() // to display data
{
cout
<<\"\ Employee number: \"<>n;
for(int i=0;i.
This code has nine errors- but I don't know how to solve it- Please g.pdfaamousnowov
This code has nine errors, but I don't know how to solve it.
Please give me a code that resolves all errors and executes well. Please provide the code for
each file name.
( Employee.h, Employee.cpp, ProductionWorker.h, ProductionWorker.cpp,
TeamLeader.h, TeamLeader.cpp, Main.cpp)
Employee.h
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
using namespace std;
class Employee
{
private:
string employeeName;
string employeeNumber;
string hireDate;
public:
Employee(); // default constructor
Employee(string name, string number, string date); // constructor with parameters
void setEmployeeName(string employeeName); // set employee name
void setEmployeeNumber(string employeeNumber); // set employee number
void setHireDate(string hireDate); // set hire date
string getEmployeeName() const; // get employee name
string getEmployeeNumber() const; // get employee number
string getHireDate() const; // get hire date
};
Employee.cpp
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "Employee.h"
Employee::Employee()
{
cout << "Please answer some questions about your employees. " << endl;
}
// Constructor with parameters
Employee::Employee(string name, string number, string date)
{
employeeName = name;
employeeNumber = number;
hireDate = date;
}
// Set employee name
void Employee::setEmployeeName(string name)
{
employeeName = name;
}
// Set employee number
void Employee::setEmployeeNumber(string number)
{
employeeNumber = number;
}
// Set hire date
void Employee::setHireDate(string date)
{
hireDate = date;
}
// Get employee name
string Employee::getEmployeeName() const
{
return employeeName;
}
// Get employee number
string Employee::getEmployeeNumber() const
{
return employeeNumber;
}
// Get hire date
string Employee::getHireDate() const
{
return hireDate;
}
ProductionWorker.h
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "Employee.h"
using namespace std;
class ProductionWorker : public Employee
{
private:
int shift;
int hourlyPay;
public:
ProductionWorker(); // default constructor
ProductionWorker(string name, string number, string date, int s, int pay); // constructor with
parameters
void setShift(int shift); // set shift
void setHourlyPay(int pay); // set hourly pay
int getShift() const; // get shift
int getHourlyPay() const; // get hourly pay
};
ProductionWorker.cpp
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "ProductionWorker.h"
// Default constructor
ProductionWorker::ProductionWorker()
{
cout << "Your responses will be displayed after all data has been received." << endl;
}
// Constructor with parameters
ProductionWorker::ProductionWorker(string name, string number, string date, int s, int pay)
: Employee(name, number, date)
{
shift = s;
hourlyPay = pay;
}
// Set shift
void ProductionWorker::setShift(int s)
{
shift = s;
}
// Set hourly pay
void ProductionWorker::setHourlyPay(int pay)
{
hourlyPay = pay;
}
// Get sh.
Similar to Create a C# applicationYou are to create a class object called “Em.pdf (20)
You have just been hired as an information security engineer for a l.pdffeelingspaldi
You have just been hired as an information security engineer for a large, multi-international
corporation. Unfortunately, your company has suffered multiple security breaches that have
threatened customers\' trust in the fact that their confidential data and financial assets are private
and secured. Credit card information was compromised by an attack that infiltrated the network
through a vulnerable wireless connection within the organization. The other breach was an inside
job where personal data was stolen because of weak access control policies within the
organization that allowed an unauthorized individual access to valuable data. Your job is to
develop a risk management policy that addresses the two security breaches and how to mitigate
these risks.
Solution
Risk management is a structured approach to administering uncertainty and consist of actions
obtain to identify, assess, monitor, and reduce the impact of risks to your big business. Risks are
events, conditions or circumstances which lead to negative consequences for your business. A
good risk management plan with appropriate risk management strategies can minimize costly
and stressful problems, and may also decrease insurance claims and premiums. Efficient risk
management starts with the recognizing, by every person in the organization, that the effort is
main, and that everyone is supposed to uphold that effort. So far the organization has had its
security breached on a number of occasions. According to this trouble, the organization has
situated a high level of importance on physical and password security and anti-virus and anti-
spyware security. It has also make a decision to use 2 layers of firewalls to prevent hackers from
getting in. The organization will also use the IDSs and Virtual Private Networks. These steps
with the help of employees and staff should help prevent unauthorized intrusions from both
internal and external intruders that will take sensitive information from our clients. Management
has the ultimate responsibility to manage risks. Control includes making decisions considering
which risks are acceptable and how to address those that are not. Those decisions can be made
only with the participation of the entire workforce, since each of us understands the risks of his
or her own tasks improved than anyone else in the organization..
Write an essay consists of 5 paragraphs (comparing between a city and.pdffeelingspaldi
Write an essay consists of 5 paragraphs (comparing between a city and town in education,
transportation, population) Outline: Introduction: Hook General information Thesis statement
Body paragraph 1: Education Body paragraph 2: Transportation Body paragraph 3:
Population Conclusion: Rewrite the introduction in different way.
Solution
Please follow the data and description :
OUTLINE :
Town : In the general scenario a town is an urban area that has a name, defined boundaries, and a
local government, that is larger than a village and smaller than a city.
City : This is a large town.
Cities and towns are differentiated primarily by an area and its geography. The governance of
cities is handled by corporate bodies whereas municipal bodies rule the towns. Generally a
mayor is the head of a city corporation, on the other hand a chairman is the head of a
municipality. The ultimate power mainly rests in the cities and not in the towns.
EDUCATION :
For a person the character would be regarded based on the qualification. So the education for all
is important around the globe. In a town the education is satisfactory provided the related
infrastructure is available over a period of time. A town is a combination of the culture and the
concrete. So these standards are not to the mark for to be satisfied.
But for a City we could have various choices even in the institutions as they are well developed
and demanded based on the standards. The institutions from all over the state/country competes
to establish their branches that makes them expanded over the time to give the education. In the
same way the people even look for a high standard institutions to make their children\'s future
best.
TRANSPORTATION :
With the change in the demand and the supply the transporation even changes as the people need
to be well enough to move from place to place frequently. As a town is smaller comparitively the
transporation of th eplace could be less effective comparitively.
While in a city the development is at a great pace the transporation even play a key role for the
ease of development. With this the place could also be demanded for a cleaner and a perfect
future.
POPULATION :
This is the main choice where the key role of all the developments is considered. For a city the
population moderate where the land and the population are sufficient for the requirement.
For the city this is the main cause where the development is at a great pace and the oppurtunities
are more enough for an individual.
CONCLUSION :
Comparitively the cities are more and more useful for the great oppurtunities and the uses.
Hope this is helpful..
Why is Antitrust activity so harmful to consumers and the economy W.pdffeelingspaldi
Why is Antitrust activity so harmful to consumers and the economy? What, if anything, can
consumers, competitors, or or the government due to prevent or detect this activity?
Solution
Answer:-
Before Understanding the Antitrust Activity let us understand what is \"Antitrust law\" this will
give you true picture of antitrust activites and how they are harmful to consumers.
Antitrust laws, also referred to as \"competition laws,\" are statutes developed by the U.S.
Government to protect consumers from predatory business practices by ensuring that fair
competition exists in an open-market.economy.
Some of Antitrust Activites are :- Causing un fair competition in economy using following
activites
1.Market Allocation
2.Bid Rigging
3.Price Fixing
4.Monopolies
5.Mergers and Acquisitions.
In short, They prohibit a variety of practices that restrain trade. Examples of illegal practices are
price-fixing conspiracies, corporate mergers likely to reduce the competitive vigor of particular
markets, and predatory acts designed to achieve or maintain monopoly power.
All such activities will eliminated healthy competition out of the market and will give rise to
unsatisfactory prices, price discriminations , excess increase in prices over a period of time,
creation of monopoly.
this will affect the consumer badly and create a disturbed trade environment in the country.
2.How to prevent or detect these activites ?
Answer:-
FEMA and state and local government agencies with whom FEMA is coordinating begin to
solicit competitive bids for rebuilding contracts, the Antitrust Division is prepared to provide
assistance to these agencies to protect against bid rigging, price fixing and other collusive
conduct among companies competing for rebuilding contracts.
Price fixing, bid rigging, and other collusive agreements can be established either by direct
evidence, such as the testimony of a participant, or by circumstantial evidence, such as
suspicious bid patterns, travel and expense reports, telephone records, and business diary entries.
If a Consumer . Competitior or Government have these kind of evidence in possession with them
, they can deliver these to FEMA and state and local government agencies to prevent such
antitrust activites .
Now Let us understand how to detect them:-
1. Market Allocation :-
In this scheme, co-conspirators agree to divide up customers or geographic areas. The result is
that the coconspirators will not bid or will submit only complementary bids when a solicitation
for bids is made by a customer or in an area not assigned to them. This scheme is most
commonly found in the service sector and may involve quoted prices for services as opposed to
bids.
2. Bid Rigging:-
In this type of scheme, one or more competitors agree not to bid, or withdraw a previously
submitted bid, so that a designated bidder will win. In return, the non-bidder may receive a
subcontract or payoff.
3. Price Fixing:-
Price Fixing impacts procurement when business is condu.
Why should Emperor Conrad lead the crusades Use bible verse.Sol.pdffeelingspaldi
Why should Emperor Conrad lead the crusades? Use bible verse.
Solution
The word \"crusade\" literally means \"going to the Cross.\" Hence the idea at the time was to
urge Christian warriors to go to Palestine and free Jerusalem and other holy places from Muslim
domination. The first crusade was a grand success for the Christian armies; Jerusalem and other
cities fell to the knights. The second crusade, however, ended in humiliation in 1148, when the
armies of France and Germany failed to take Damascus. The third ended in 1192 in a
compromise between English king Richard the Lion-Hearted of England and the Muslim leader
Saladin, who granted access to Christians to the holy places. The fourth crusade led to the
sacking of Constantinople, where a Latin Kingdom of Byzantium was set up in 1204 and lasted
for about 60 years. The Children\'s Crusade of 1212 ended with thousands of children being sold
into slavery, lost, or killed. Other less disastrous but equally futile crusades occurred until nearly
the end of the 13th century. The last Latin outpost in the Muslim world fell in 1291.
Historians have viewed the Crusades as a mixture of benefits and horrors. On one hand, there
was a new knowledge of the East and the possibilities of trade to be found there, not to mention
the spread of Christianity. On the other hand, Christianity was spread in a violent, militaristic
manner, and the result was that new areas of possible trade turned into new areas of conquest and
bloodshed. A number of non-Christians lost their lives to Christian armies in this era, and this
trend would continue in the inquisitions of the coming centuries.
The Crusades were a series of wars by Western European Christians to recapture the Holy Land
from the Muslims. The Crusades began in 1095 and ended in the mid- or late 13th century. The
term Crusade was originally applied solely to European efforts to retake from the Muslims the
city of Jerusalem, which was sacred to Christians as the site of the crucifixion of Jesus Christ. It
was later used to designate any military effort by Europeans against non-Christians.
The Crusaders carved out feudal states in the Near East. Thus the Crusades are an important
early part of the story of European expansion and colonialism. They mark the first time Western
Christendom undertook a military initiative far from home, the first time significant numbers left
to carry their culture and religion abroad.
In addition to the campaigns in the East, the Crusading movement includes other wars against
Muslims, pagans, and dissident Christians and the general expansion of Christian Europe. In a
broad sense the Crusades were an expression of militant Christianity and European expansion.
They combined religious interests with secular and military enterprises. Christians learned to live
in different cultures, which they learned and absorbed; they also imposed something of their own
characteristics on these cultures. The Crusades strongly affected the imagina.
WHICH PERSON WOULD GENERLLY BE TREATED AS A MATERIAL PARTICIPANT IN .pdffeelingspaldi
WHICH PERSON WOULD GENERLLY BE TREATED AS A MATERIAL PARTICIPANT
IN AN ACTIVITY?
Multiple choice
1. A participant in a rental activity.
2. A limited partner.
3. A LLC member not involved with management of the LLC.
4. A general partner.
Solution
Answer is 4. A General Partner.
Explanation:
General partner is a person who takes active participation in the day to day matters of the
business..
Which of the following are widely recognized disadvantages to the Eur.pdffeelingspaldi
Which of the following are widely recognized disadvantages to the Euro area of having a
common currency? (Check all that apply.) A. The perpetuation of disparate economic conditions
across member states. B. A symbol of unity among nations previously experiencing much
conflict. C. The implementation of a uniform monetary policy across many economies. D. The
elimination of the exchange rate as a policy instrument E. The elimination of the uncertainty that
derives from multiple currencies.
Solution
Correct option: C
Explanation: a common currency requires a single monetary policy. This means interest rates
being set centrally for all Euro countries. Suppose European Central Bank may want to change
interest rates, that would simply worsen the recession for country with weaken economy..
What is the function of a rhizoid Describe asexual and sexual repro.pdffeelingspaldi
What is the function of a rhizoid? Describe asexual and sexual reproduction in Marchantia.
Compare and contrast thallus and leafy liverworts.
Solution
1.1 Rhizoid are hair like structures that serve the function of roots by anchoring the plants to
substratum and absorption of water. These are present on the lower side of thallus like body of
marchantia.
1.2
Asexual Reproduction: In Marchantia , asexual reproduction occurs through fragmentation of
thallus or through gemma cups (present on dorsal side of thallus) which detach and grow as
thallus when fall on substratum(Soil).
Sexual Reproduction In Marchantia:
Marchantia is dioceious i.e unisexual. Male and female thallus are seperate. Thallus represents
gametophyte that produces gametes.
1. The dorsal side of Marchantia thallus has special reproductive structures called
antheridia(male) and archegonia (Female).
2. In antheridia , biflagellated cells called antherozooids are produced from androcyte mother
cells.
3. In archegonia (flask like structure), egg is present .
4. Water is required for fertlization. The cells in flask of archegonia disintegrate and release
chemicals to attract antherozooids.
5. Antherozooids get splashed with water and fall on archegonium an travel through its neck to
the egg to fertilize it.
6. fertilisation produces zygote.
7. Zygote develops in a sporophytic structure having foot, seta and capsule.Sporophyte remains
attached to gametophyte.
8. Capsule produces spores, that are released to germinate into new thallus gametophyte.
1.3
Leafy and Thallus Liver worts
DIFFERENCES
Thallus Liverwort:
1. Ribbon like body
2. Non vasularised.
3. Do not have similarity of structure with mosses.
Leafy Liverwort
1. Have thick Axis
2. Vascularised center with flat leafs aranges in rows of three or four.
3. resemble mosses to some extent.
Similarities :
Both thallose and leafy liverworts:
1. Need water for fertilisation.
2. Do not have well differentiated body.
3. have rhizoids for attachemnet with substratum..
We define a relation on set of Whole NumbersW={0,1,2,3…} As follow.pdffeelingspaldi
We define a relation on set of Whole Numbers
W={0,1,2,3…} As follows:
We divide the number by 5 and look at the remainder. All numbers that result into the same
remainder are related.
E.g. 2/5 remainder =2, 7/5 remainder =2 and 12/5 remainder =2, therefore 2R7, 7R2, 7R12,
12R7, 12R2, and 2R12 etc.
[2] = {2,7,12,17….}
How many Equivalence classes are there.
Write the first four members of each equivalence class
Solution
Given whole number set {0,1,2,3........}
The numbers divides by 5
Any number divided by 5 we get 0,1,2,3,4 are only the remainders.
The number which is exactly divisble by 5 we get remainder 0.
The number which is not divisible by 5 we get the remainders(1,2,3or4).
Since the given set is a whole numbers set ..the divisble numbers of 5 are greater than five and
5.that mean the whole numbers from5,6,7....are divisible by 5.
There are five equivalence classes for 5.
The frist four members of each equivalence is
[0]={0,5,10,15...}
[1]={1,6,11,16......}
[2]={2,7,12,17......]
[3]={3,8,13,18.......}
[4]={4,9,14,19.......}.
For zero remainder
5/5=0,10/5=0,….
Therefore{0,5,10,15.....}
For 1
6/5=1,11/5=1...
For2
7/5=2,12/5=2,...
For 3
8/5=3,13/5=3.....
For 4
9/5=4,14/5=4,......
What does the cutting-plane line represent List and explain seven d.pdffeelingspaldi
What does the cutting-plane line represent? List and explain seven different types of sections.
What type of line is used to show the boundary of a broken out section? How much of an object
is imagined to be cut away in a half section?
Solution
1) Generally the cutting-plane line represents the edge view of the cutting plane, in order to show
the inside features of the object. The viewing direction is represented by arrows.
2) Seven different type of sections:
i) Full section,
ii) Half section
iii)Broken-out section
iv) Revolved sections
v) Removed sections
vi) Offset sections
vii) Aligned sections.
3) A short-break line is used to show the boundary of a broken-out section
4) A quarter of the object (1/4th) is imagined to be cut away in a half section..
True or False The employment relationship that is typical of modern.pdffeelingspaldi
True or False? The employment relationship that is typical of modern organizations is different
from the relationship of a generation ago
Solution
The correct choice is True
Explanation : - Employment relationship a generation ago was characterised by stable
employment and life long association with one organization whereas in modern organization
employees do not stay with one employer for longer period of time. Job security does not exist in
modern organizations and layoffs are common ..
The following monthly data are taken from Ramirez Company at July 31.pdffeelingspaldi
The following monthly data are taken from Ramirez Company at July 31: Sales salaries,
$200,000; Office salaries, $160,000; Federal income taxes withheld, $90,000; State income taxes
withheld, $20,000; Social security taxes withheld, $22,320; Medicare taxes withheld, $5,220;
Medical insurance premiums, $7,000; Life insurance premiums, $4,000; Union dues deducted,
$1,000; and Salaries subject to unemployment taxes, $50,000. The employee pays 40% of
medical and life insurance premiums. Assume that FICA taxes are identical to those on
employees and that SUTA taxes are 5.4% and FUTA taxes are 0.6%. 1&2. Using the above
information, complete the below table and Prepare the journal entries to record accrued payroll
and cash payment of the net payroll for July 3. Using the above information, complete the below
table 4. Record the accrued employer payroll taxes and all other employer-paid expenses and the
cash payment of all liabilities for July- assume that FICA taxes are identical to those on
employees and that SUTA taxes are 5.4% and FUTA taxes are 0.6%
Solution
Date Accounts Title Dr Cr 1 & 2 Sales Salaries Expense $200,000 Office Salaries
Expense 160000 Social Security Tax Payable $22,320 Medicare Tax Payable 5220
Employees Federal Income Tax Payable 90,000 Employees State income tax Payble 20,000
Union dues payable 1,000 Life Insurance premium payable (4000*40%) 1,600 Medical
insurance payable (7000*40%) 2800 Salaries Payable $217,060 salaries payable
$217,060 Cash $217,060 31-Jul Payroll tax expense 37,140 Social Security Tax
Payable $22,320 Medicare Tax Payable $5,220 State Unemployment Tax Payable
(50000*5.4%) 2700 Federal Unemployment Tax Payable (50000*.6%) 300 Life Insurance
premium payable (4000*60%) 2,400 Medical insurance payable (7000*60%) 4200
(employer benefit expenses recorded) 31-Jul Social Security Tax Payable $44,640
Medicare Tax Payable $10,440 Employees Federal Income Tax Payable 90,000
Employees State income tax Payble 20,000 Union dues payable 1,000 Life Insurance
premium payable \\ $4,000 Medical insurance payable 7000 State Unemployment Tax
Payable 2700 Federal Unemployment Tax Payable 300 Cash $180,080 (being
paymnet of liabilities for payroll paid) If any doubt please comment.
State the reasons for the current drought in South Africa. Describe .pdffeelingspaldi
State the reasons for the current drought in South Africa. Describe an improvement plan? A
case study will be preferable.
Solution
South Africa is prone to drought. The country recently experienced the combined effects of a
severe drought and a strong Elnino event, which led to serious impacts on livelihood conditions
and economic growth.
The main reasons for the current situation in South Africa are listed below :
> Anthropogenic warming contributed to the southern African drought by increasing El Nino sea
surface temperatures and local air temperatures, causing reduced rainfall and runoff.
> Increase in Land and water temperatures as overall temperatures increase more water
evaporates and severe weather conditions increase.
> As many areas in South African region are growing rapidly, the demand for water exceeded
the supply but weather conditions, temperatures or air patterns pushed the region towards
drought.
> As the exporting division became more improvised in the nation excessive irrigation takes
place which is an excellence of people contributing to a drought.
> Because of the timing of water doesn’t match the agricultural season, that leads to too much
water when you don’t need it and too little when you do need it, so the drought.
> If there is a continuous shortage of water feeding the reservoirs, this will inevitably lead to
water shortages and thus drought.
> Overdevelopment, population growth, and climate change upset the balance between water use
and supply so finally they are leading to severe drought.
IMPROVEMENT PLAN :
Nothing but the heavy rains are the major boon that will help to improve current situations in the
country rapidly but they are not in our hands, so some minor (when compared to rainfall)
methods or steps are to be followed to improve the current situation which are listed below.
1. DROUGHT STATUS AND MONITORING
Information on the status of current drought conditions, drought indices, fire conditions, and
other drought monitoring resources, including data and Water Availability/ Impact Task Force
reports.
2. DROUGHT PLANNING RESOURCES
Introduction to local drought planning and step-by-step guidance for developing local municipal
drought management plans.
3. FINANCIAL ASSISTANCE
Includes links to funding sources for the development of drought mitigation and response plans,
as well as drought-related mitigation projects and relief during times of drought.
4. DROUGHT AND CLIMATE CHANGE
Information on climate change and potential influences on drought.
5. GRADUAL CHANGE IN AGRICULTURAL ACTIVITIES
Excessive irrigation has to be stopped, but should be in gradual manner. Crops which require
much water should not be grown for some years.
6. LIMITING WATER USE
Current water use and carry-over storage (for purposes of differentiating water users by amount
of water used and stored) and implimenting limitations on water supply.
7. ARRANGEMENTS FOR UPCOMING WINTER RAINS
As the winter rains in the country are approaching in .
Select the true statements concerning seeds.A Seeds allow for dor.pdffeelingspaldi
Select the true statements concerning seeds.
A: Seeds allow for dormancy until favorable conditions arise.
B: The fruit provides nutrition to the developing embryo.
C: The ovule dries and forms the seed coat.
D: The seed stores all of the nutrition and water the embryo needs to germinate.
E: Seeds can resist conditions that would kill a live plant.
F: Seeds are key to wide dispersal of offspring.
Solution
Choices A, C, D, E and F are correct.
Reason: Seeds are the germline representative which store the complete genetic information for
development of a complete plant. The seeds contain all the nutrients required to nourish a
developing embryo. Until favourable conditions of moisture, temperature and light are perceived,
the seed remains dormant and protects the underlying embryo from damages due to outer harsh
conditions. During seed formation, the ovary becomes the seed matrix and the ovule becomes the
seed coat. Further, various morphological modifications take place in the seed structures which
make them disperse easily through air/water/animals to promote cross-fertilization..
Russian dude. Formulated the ____ hypothesis regarding prebioisSo.pdffeelingspaldi
Russian dude. Formulated the ____ hypothesis regarding prebiois
Solution
Answer=
The russion dude .formulated the Oparin hypothesis regarding prebiosis
Explaination = Alexander oparin eas a Russian biochemist ,notable for his contributions to the
theory of origin of life on earth & particularly for the primordial soup theory of evolution of life
from carbon based molecules
Oparin showed how organic chemicals in solution may spontaneously form droplets & layers
He suggested different types of coaservates might have formed in the earths primordial ocean &
subsequently been subject to a selection process eventually leading to life.
Robin Hartshorne• a biography of the mathematician• a descriptio.pdffeelingspaldi
Robin Hartshorne
• a biography of the mathematician
• a description of their most important contributions (you may also mention important
contributions to fields outside of mathematics)
• a section focusing specifically on their important contributions to geometry
• the full, precise statement of at least one important geometric theorem proved by the
mathematician (preferably one of their most famous contributions or a theorem that bears their
name, if one exists) with some exposition about this theorem
• clear citations showing where the information came from.
Solution
Robin Cope Hartshorne (born March 15, 1938) is an American mathematician. Hartshorne is an
algebraic geometer who studied with Zariski, Mumford, J.-P. Serre and Grothendieck.
He was a Putnam Fellow in Fall, 1958. He received his doctorate from Princeton University in
1963[1] and then became a Junior Fellow at Harvard University, where he taught for several
years. In the 1970s he was appointed to the faculty at the University of California, Berkeley. He
is currently retired.
Hartshorne is the author of the popular text Algebraic Geometry. He plays the shakuhachi, and
paints.
In 2012 he became a fellow of the American Mathematical Society.
Algebric Geometry is the field in which he has worked majorly. He has written a book on it
The Mathematics Genealogy Project is a web-based database for the academic genealogy of
mathematicians. By 7 November 2017, it contained information on 219,978 mathematical
scientistswho contributed to research-level mathematics. For a typical mathematician, the project
entry includes graduation year, thesis title, alma mater, doctoral advisor, and doctoral students..
Position of birds eating sunflower seed is the niche dimension we.pdffeelingspaldi
Position of birds eating sunflower seed is the niche dimension we explored in this exercise. In
what other ways do birds seem to partition niche space at a bird feeder or series of feeders?
Solution
- There are three other ways do birds partition the niche space at a bird feeder.
1. Some birds eat the seeds at the perch of the feeder
2. Some more birds pick up the seeds at the feeder and fly away.
3. Few more birds pick up the seeds fallen near the niche at the bottom of the feeder.
In this way niche space (within, bottom and away the feeder) is partitioned at the bird feeder by
the birds..
Physical Security Plan1.Identify the role of environmental control.pdffeelingspaldi
Physical Security Plan
1.Identify the role of environmental controls in securing information assets.
2.Describe the physical security controls that are available for use in securing technical
information assets.
3.Describe the physical security controls that are available for use in securing human access to
information assets.
4.Develop a strategy for integrating physical security into an overall security management plan.
5.Use proper APA (6th edition) style and formatting for all references and citations.
Solution
2.
Physical security is that the protection of personnel, hardware, software, networks associated
knowledge from physical actions and events that would cause serious loss or injury to an
enterprise, agency or establishment. This includes protection from hearth, flood, natural
disasters, burglary, theft, deviltry and coercion. Physical security has 3 vital components: access
management, police work and testing. Obstacles ought to be placed within the means of potential
attackers and physical sites ought to be hardened against accidents, attacks or environmental
disasters.
Part I. True or False Place a T or an F, whichever you consider cor.pdffeelingspaldi
Part I. True or False: Place a T or an F, whichever you consider correct, in the box before each
numbered statement
1.
“Security by obscurity” refers to relying on the attacker\'s ignorance of the design of a system.
2.
Theory of asymmetric information can be used to explain how bad products tend to drive out the
good products in a market.
3.
Enterprise risk management differs from “traditional” systems engineering risk management in
the expanse of the consequence space within which risks affect enterprise goals, mission
outcomes, or capabilities.
4.
Emergence can be described as the appearance of new and unforeseen system properties which
cannot be know before the system operates.
5.
Emergence can be totally and completely prevented by thorough system design.
6.
The process of system identification followed by risk estimation is what is truly occurring in risk
assessments.
7.
Systems theory supports the modern view that risk itself is an observer-dependent phenomenon;
a relational property between the situation and the observer.
8.
Reliance can be described as consistency in performance over time.
9.
In Liontief I-O model for inoperability, resulting % inoperability can be caused by perturbation
h and also by dependence among sub-systems.
10.
Tightly coupled systems imply that what occurs in one system directly affects what happens in
another.
11.
The two descriptors of Complexity for the purpose of Risk Management are (1) Interactions
among subsystems and (2) Reliability among subsystems.
12.
Partially observable events can be recorded only at a particular threshold of magnitude, time,
etc.
13.
Privacy and ethical issues can be factors in the observability of events.
14.
Readiness and effectiveness for asset protection is one of the cost factors in a DRP.
15.
Maximax is a method of decision making using probabilities.
16.
Maximin tries to minimize regret of decision makers.
17.
Rational decision maker should be willing to pay for perfect information at a price equal to or
more than the EVPI.
18.
Decision making under uncertainty is when probabilities can be assigned to the occurrence of
states of nature in the future.
19.
In Hurwicz method, the coefficient of optimism is a measure of a decision maker’s optimism
from 0 (completely optimistic) to 1 (completely pessimistic).
20.
In the pebble-in-the-pond metaphor, the ripples represent the consequences and the number of
ripples decreases as time passes.
21.
Bounded rationality states that people have limited cognitive processing capacity and simply
cannot perform complex optimization tasks in their head.
22.
When risks are being identified, it is not essential that subject matter experts from all the
engineering disciplines participate.
23.
An ordinal scale is a measurement scale in which attributes are assigned a number that
represents order.
24.
Risk Cubes can not involve human’s numerical judgment on risk.
25.
Wear-and-tear indicates a scenario where the effects of an adverse condition read.
Module 03 Discussion - Musics Impact on Baby Boomers.pdffeelingspaldi
Module 03 Discussion - Music\'s Impact on Baby Boomers
Discuss the social impact that musicians such as Bob Dylan and the Beatles had on the youth
culture of the \"baby boomer\"/ \"Woodstock\" generation. Your initial post should be a
minimum of 250 words.
Module 03 Discussion - Music\'s Impact on Baby Boomers
Discuss the social impact that musicians such as Bob Dylan and the Beatles had on the youth
culture of the \"baby boomer\"/ \"Woodstock\" generation. Your initial post should be a
minimum of 250 words.
Module 03 Discussion - Music\'s Impact on Baby Boomers
Discuss the social impact that musicians such as Bob Dylan and the Beatles had on the youth
culture of the \"baby boomer\"/ \"Woodstock\" generation. Your initial post should be a
minimum of 250 words.
Solution
Social impact of Bob Dylan and the Beatles
Bob Dylan, born Robert Allen Zimmerman, was affected by the Civil Rights Movement, after-
shocks of the World War, the Cuban missile crisis, and, Kennedy\'s assassination. Dylan wrote
music that evoked changes in the song itself. The lyrics crystallized feelings of individual
identity, ambition, and, rebellion. Around 1963, he started writing his protest songs expressing
frustration towards leaders who opposed change. He wrote these at the beginning of the Civil
Rights movement. He wrote protest songs after the busing segregation even in 1955. He wrote
the death of Emmett Till for Congress of Racial Equality. His song Blowing in the Wind is an
anthem for the civil rights movement. He wrote \'betrayed by our silence\' to encourage people to
speak up. He reacted to events and reinforced political views. His music was a call to action.
Social issues were more important than music. He captured the feeling of nothingness related to
the fear of US-Russia Nuclear warfare. His times they are a changing was about a generation gap
between the conservatives and the liberals. He wrote John Brown and Master of War, two anti-
war songs. He moved away from politics after the assassination of President John F Kennedy.
Dylan provided the emotional drive behind the revolution of hundreds of thousands of people.
Bob Dylan influenced the rise of the Beatles. Their impact was in the counterculture they helped
to create. The youth in the 1960s was a class with a separate sensibility. Hints of such an attitude
were observed in the 1950s. The battle-cry in the 1960s was \"Don\'t trust anyone over thirty\"
The core value of this class was a sense of community. This was also reflected in the Beatles\'
music. The Youth insisted on communality, sharing, a rejection of the retreat into private
satisfaction. This generation did not share the ethic of mutual distrust. Rock n Roll tapped a
sensuality that was never bottled up again..
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Instructions for Submissions thorugh G- Classroom.pptx
Create a C# applicationYou are to create a class object called “Em.pdf
1. Create a C# application
You are to create a class object called “Employee” which included eight private variables:
firstN
lastN
dNum
wage: holds how much the person makes per hour
weekHrsWkd: holds how many total hours the person worked each week.
regHrsAmt: initialize to a fixed amount of 40 using constructor.
regPay
otPay
After going over the regular hours, the employee gets 1.5x the wage for each additional hour
worked.
Methods:
constructor
properties
CalcPay(): Calculate the regular pay and overtime pay.
Create an “EmployeeDemo” class. In the main function, the program should ask the user the
number of employee in the company and create a 2-dimensional dynamic array (number of
employee by 4 weeks). Then, the program should ask user to enter each employee’s information
and the amount of hours they worked weekly.
The program shows a menu with employee name for user to choose which employee to display
the following information:
How much the person totally made
How much of paycheck is regular pay
How much of paycheck is overtime pay
Solution
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace Employee
{
2. public enum EmployeeType {GROUPA, GROUPB, GROUPC, GROUPD};
public struct EmployeeSalaryInfo
{
public float hourlyWage;
public int monthlyHours;
public float baseSalary;
public int numSales;
public EmployeeSalaryInfo( EmployeeType eme)
{
this.hourlyWage = 0;
this.monthlyHours = 0;
this.baseSalary = 0;
this.numSales = 0;
}
}
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Welcome to the Employee System");
EmployeeArray empArray = new EmployeeArray();
int continueRunning = 1;
do
Console.WriteLine();
Console.WriteLine("Please Enter Your Choice:");
Console.WriteLine("1=Enter new employee");
Console.WriteLine("2=Update existing employee");
Console.WriteLine("3=Delete employee");
Console.WriteLine("4=Print employee list");
Console.WriteLine("Any other number to Exit");
int userChoice = int.Parse(Console.ReadLine());
3. Console.WriteLine();
switch (userChoice)
{
case 1:
Employee emp = CreateNewWorker(); //Asking for employee information by
creating a new employee.
if (!(empArray.Contains(emp))) //Checking to see that employee does not
exist
empArray.Add(emp); //If the employee does not exist in the list then
we can add it.
else
Console.WriteLine("Can not add new worker. This worker already exists");
break;
case 2: //If user wishes to edit an employee
EditEmployee(empArray);
break;
case 3:
DeleteEmployee(empArray); //if user wishes to delete an employee from
the list
break;
case 4:
empArray.Print();
break;
default:
continueRunning = 0; //If user has chosen to exit the system.
break;
}
} while (continueRunning == 1); //Checking to see if to continue running
the system
}
static Employee CreateNewWorker() //Method for creating a
new employee.
{
Employee emp; //A new employee consists of
the basic information which is
4. Console.WriteLine("Enter first name:"); //The first name
string first = Console.ReadLine();
Console.WriteLine("Enter last name:"); //The family name
string last = Console.ReadLine();
Console.WriteLine("Enter birth date in DD/MM/YYYY format"); //and
birthday.
DateTime bDay = DateTime.Parse(Console.ReadLine());
Console.WriteLine("Is worker 1=Secretary, 2=Sales, 3=Manager, 4=Top Manager?");
//Also asking for the type
EmployeeSalaryInfo salInfo = GetSalaryInfo(workerType); //and the salary
information
emp = new Employee(first, last, bDay, workerType, salInfo); //with all the
info can create a new employee
return emp;
}
static void EditEmployee(EmployeeArray employees) //Method for
editing an employee and his info
{
Employee emp = GetEmployeeInfo(); //First getting basic
info about employee to edit.
EmployeeSalaryInfo salInfo = new TGCEmployeeSalaryInfo();
if (employees.Contains(emp)) //Then checking that list
has this employee (if not can not edit)
{
Console.WriteLine("Has worker position changed? 1=Yes, 2=No");
int changeType = int.Parse(Console.ReadLine());
if (changeType == 1) //If employee type has
changed
{ //then ask for new type
Console.WriteLine("Is worker 1=Secretary, 2=Sales, 3=Manager, 4=Top
Manager?");
TGCEmployeeType workerType =
(TGCEmployeeType)int.Parse(Console.ReadLine()) - 1;
salInfo = GetSalaryInfo(workerType); //and then ask for his
salary info
employees.Replace(emp, workerType, salInfo); //and finally
5. replace the info in the salary list.
}
else //if type ha not changed
{
salInfo = GetSalaryInfo(employees.Find(emp)); //then get only
the salary info (without the need for the type)
employees.Replace(emp, employees.Find(emp), salInfo); //and finally
replace the info in the salary list.
}
}
else
Console.WriteLine("There is no such employee");
}
static Employee GetEmployeeInfo() //A method for getting the basic information
about an employee which includes
{
Console.WriteLine("Enter first name of the employee");
string first = Console.ReadLine(); //His First name
Console.WriteLine("Enter last name of the employee");
string last = Console.ReadLine(); //His last name
Console.WriteLine("Enter birth date in DD/MM/YYYY format");
DateTime bDay = DateTime.Parse(Console.ReadLine()); //And his birthday
Employee emp = new Employee(first, last, bDay);
return emp; //and then we can create an emplyee object (without
adding him to the list)
}
static TGCEmployeeSalaryInfo GetSalaryInfo(TGCEmployeeType empType) //A
method for getting the salary info about a certain employee type from the user
{
TGCEmployeeSalaryInfo salInfo = new TGCEmployeeSalaryInfo(empType);
switch(empType) //A switch to see what the type is so
that the correct questions could be asked
{
case (EmployeeType)0: //if it is a secretary than ask for
hourly wage and number of hours
6. Console.WriteLine("Please Enter Hourly Wage");
salInfo.hourlyWage = float.Parse(Console.ReadLine());
Console.WriteLine("Please Enter Number of Hours Worked");
salInfo.monthlyHours = int.Parse(Console.ReadLine());
break;
case (TGCEmployeeType)1: //if it is a sales person than ask
for base salary, number of sales and bomus per sale
Console.WriteLine("Please Enter Base Salary");
salInfo.baseSalary = float.Parse(Console.ReadLine());
Console.WriteLine("Please Enter Number of Sales");
salInfo.numSales = int.Parse(Console.ReadLine());
Console.WriteLine("Please Enter Bonus per Sale");
salInfo.salaryBonus = float.Parse(Console.ReadLine());
break;
case (TGCEmployeeType)2: //if it is a manager than ask for
the base salary. The bonus is currently constant as part of the salary info struct
Console.WriteLine("Please Enter Base Salary");
salInfo.baseSalary = float.Parse(Console.ReadLine());
break;
case (EmployeeType)3: //if it is a top manager than ask for
the base salary. The bonus is currently constant as part of the salary info struct
Console.WriteLine("Please Enter Base Salary");
salInfo.baseSalary = float.Parse(Console.ReadLine());
break;
}
return salInfo;
}
}
class Employee //An employee class which includes all the
information about an employee, ways to retrieve and set the info, and calculate its salary
{
string firstName;
string familyName;
DateTime birthDate;
EmployeeType employeeType;
EmployeeSalaryInfo employeeSalaryInfo;
7. public Employee(string first, string family, DateTime bDay) //first constructor which creates
an employee without his salary info and type.
{
firstName = first;
familyName = family;
birthDate = bDay;
}
public Employee(string first, string family, DateTime bDay, EmployeeType empType,
EmployeeSalaryInfo salInfo) //second constructor which creates an employee with all info
{
firstName = first;
familyName = family;
birthDate = bDay;
employeeType = empType;
employeeSalaryInfo = salInfo;
}
public string FirstName //property method for getting the first name
{
get
{
return this.firstName;
}
}
public string FamilyName //property method for getting the last name
{
get
{
return this.familyName;
}
}
public DateTime BirthDate //property method for getting the birth date
{
get
{
return this.birthDate;
8. }
}
public EmployeeType EmployeeType //property method for getting the type of employee or
setting it (in case it changed)
{
get
{
return this.employeeType;
}
set
{
this.employeeType = value;
}
}
public EmployeeSalaryInfo SalaryInfo //property method for setting new salary information
for the employee
{
set
{
this.employeeSalaryInfo = value;
}
}
public float CalcSalary() //method for calculating the employee's salary
{
float salary=0;
switch(employeeType)
{
case (EmployeeType)0: //if employee is a secretary than multiply wage per hour by
hours worked
salary = (employeeSalaryInfo.hourlyWage) * (employeeSalaryInfo.monthlyHours);
break;
case ( EmployeeType)1: //if employee is a sales person than multiply number of
sales by bonus per sale and add that to the base salary
salary = ((employeeSalaryInfo.baseSalary) + (employeeSalaryInfo.numSales *
(employeeSalaryInfo.salaryBonus)));
break;
9. case (EmployeeType)2: //if employee is a manager than add the bonus to the base
salary
salary = (employeeSalaryInfo.baseSalary) + (employeeSalaryInfo.salaryBonus);
break;
case ( EmployeeType)3: //if employee is a top manager than add the bonus to the
base salary
salary = (employeeSalaryInfo.baseSalary) + (employeeSalaryInfo.salaryBonus);
break;
}
return salary;
}
}
public void Print() //a method for printing all employees in the list icluding
name, birthdate, type and salary.
{
Console.WriteLine("Family NametFirst NametBirth DatetWorker TypetSalary");
Console.WriteLine("-----------t----------t----------t-----------t------");
foreach ( Employee e in employees)
Console.WriteLine("{0}t{1}t{2}t{3}t{4}", e.FamilyName.PadRight(11),
e.FirstName.PadRight(10), e.BirthDate.ToShortDateString(),
e.EmployeeType.ToString().PadRight(11), e.CalcSalary());
Console.WriteLine();
}
}
}