Cs304 Assignment 2 Solution Fall 2024 by VuCopier
Cs304 Assignment 2 Solution Fall 2024 by VuCopier
#include <iostream>
#include <iomanip>
using namespace std;
public:
Employee() : employeeId(0), employeeName(""),
salary(0.0) {}
Visit
Vucopier.blogspot.com
For Paid Assignment Solutions
WhatsApp now 03086278790
Solution by VuCopier
public:
RegularEmployee(int id, string name, double basic,
double allow, double tax) {
employeeId = id;
employeeName = name;
basicSalary = basic;
allowances = allow;
incomeTax = tax;
}
public:
HourlyEmployee(int id, string name, double hours,
double rate) {
employeeId = id;
employeeName = name;
noOfHours = hours;
hourlyRate = rate;
}
int main() {
// Create objects using Dataset
RegularEmployee regular(1, "Alice", 60000, 20000,
5000);
HourlyEmployee hourly(2, "Bob", 20, 3000);
// Calculate salaries
regular.calculateSalary();
hourly.calculateSalary();
// Display results
regular.displaySalary();
cout << endl;
hourly.displaySalary();
return 0;
}
Visit
Vucopier.blogspot.com
For Paid Assignment Solutions
WhatsApp now 03086278790
Solution by VuCopier
Visit
Vucopier.blogspot.com
For Paid Assignment Solutions
WhatsApp now 03086278790
Solution by VuCopier
VuCopier
Visit
Vucopier.blogspot.com