UESTION PROVIDED IN ATTACH IMAGE KINDLY SEE. PROVIDE OUTPUT AS IT IS SHOWN IN QUESTION. AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , salary.cpp )

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

QUESTION PROVIDED IN ATTACH IMAGE KINDLY SEE. PROVIDE OUTPUT AS IT IS SHOWN IN QUESTION.

AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , salary.cpp  )

----------------- TEMPLATES BELOW FOR SOLUTION -----------------------

 

salary.cpp

#include<iostream>
using namespace std;
class Salary
{
public:
string name;
float HRA,DA,basic;
public:
Salary(){}
Salary(string name,float basic, float hra,float da)
{
name=name;
basic=basic;
HRA=hra;
DA=da;
}
public:
void calculateSalary(int taxType)
{
//Fill your code here
}
};

 

main.cpp

#include<iostream>
#include "Salary.cpp"
using namespace std;

int main()
{
string name;
float Basic,HRA,DA;
int choice;
cout<<"Enter the Name of the employee :"<<endl;
cin>>name;
cout<<"Enter the Basic pay :"<<endl;
cin>>Basic;
cout<<"Enter the HRA percentage :"<<endl;
cin>>HRA;
cout<<"Enter the DA percentage :"<<endl;
cin>>DA;
cout<<"Enter if the tax is fixed or variable :"<<endl;
cout<<"1.fixed"<<endl;
cout<<"2.variable"<<endl;
cin>>choice;

//Fill your code here

}

Anish owned a construction Business. Around 250 employees were working in his company. Every
month in order to provide the salary for all the employees, he created software that would calculate the
salary with tax and as well as without tax. Some of the employees who were paid low are supposed to
pay 5% of their salary to tax. People getting high pay, are supposed to pay taxes in accordance with their
salary. Given the details of the employees.
Write a C++ program to find the salary amount with tax and as well as without tax.
The class Salary has the following private data variables.
Data Type
string
float
float
float
Variable Name
name
basic
HRA
DA
Include default and parameterized constructor for the above class.
The class Salary has the following member function.
Description
To calculate the salary with and without tax and display it
Member Function
void calculateSalary(int taxType) If taxType is 1, then it is fixed tax.
If taxType is 2, then it is variable tax.
Note : HRA, DA, tax in percentage are given.
Some employees have a fixed tax of 5% of the total salary.
Some employees have the tax that will be in accordance with their salary.
Calculate the total salary, Total salary without tax= Basic + HRA of basic+DA of basic
For employees with fixed tax, Total salary with tax= Basic + HRA of basic+DA of basic - 5% of Basic.
For employees whose tax varies in accordance with salary,
Total salary without tax= Basic + HRA of basic+DA of basic.
Total salary with tax= Basic + HRA of basic+DA of basic - tax of Basic.
In the main() method, get the details of an employee and call calculateSalary method to calculate and
display the salary with and without tax.
Input and Output Format:
Refer to the sample input and output for formatting specifications.
[All text in bold are input and the remaining are output]
Sample Input and Output 1:
Enter the Name of the employee:
thara
Enter the Basic pay:
10500.00
Enter the HRA percentage:
5.00
Enter the DA in percentage:
10.00
Enter if the tax is fixed or variable :
1.fixed
2.variable
1
Your Salary amount without tax:12075.00
Your Salary amount with tax:11550.00
Sample Input and Output 2:
Enter the Name of the employee:
vysnavi
Enter the Basic pay:
34567.89
Enter the HRA percentage:
2.34
Enter the DA in percentage :
3.45
Enter if the tax is fixed or variable :
1.fixed
2.variable
2
Enter your tax in percentage:
3.45
Your Salary amount without tax :36569.37
Your Salary amount with tax :35376.78
Transcribed Image Text:Anish owned a construction Business. Around 250 employees were working in his company. Every month in order to provide the salary for all the employees, he created software that would calculate the salary with tax and as well as without tax. Some of the employees who were paid low are supposed to pay 5% of their salary to tax. People getting high pay, are supposed to pay taxes in accordance with their salary. Given the details of the employees. Write a C++ program to find the salary amount with tax and as well as without tax. The class Salary has the following private data variables. Data Type string float float float Variable Name name basic HRA DA Include default and parameterized constructor for the above class. The class Salary has the following member function. Description To calculate the salary with and without tax and display it Member Function void calculateSalary(int taxType) If taxType is 1, then it is fixed tax. If taxType is 2, then it is variable tax. Note : HRA, DA, tax in percentage are given. Some employees have a fixed tax of 5% of the total salary. Some employees have the tax that will be in accordance with their salary. Calculate the total salary, Total salary without tax= Basic + HRA of basic+DA of basic For employees with fixed tax, Total salary with tax= Basic + HRA of basic+DA of basic - 5% of Basic. For employees whose tax varies in accordance with salary, Total salary without tax= Basic + HRA of basic+DA of basic. Total salary with tax= Basic + HRA of basic+DA of basic - tax of Basic. In the main() method, get the details of an employee and call calculateSalary method to calculate and display the salary with and without tax. Input and Output Format: Refer to the sample input and output for formatting specifications. [All text in bold are input and the remaining are output] Sample Input and Output 1: Enter the Name of the employee: thara Enter the Basic pay: 10500.00 Enter the HRA percentage: 5.00 Enter the DA in percentage: 10.00 Enter if the tax is fixed or variable : 1.fixed 2.variable 1 Your Salary amount without tax:12075.00 Your Salary amount with tax:11550.00 Sample Input and Output 2: Enter the Name of the employee: vysnavi Enter the Basic pay: 34567.89 Enter the HRA percentage: 2.34 Enter the DA in percentage : 3.45 Enter if the tax is fixed or variable : 1.fixed 2.variable 2 Enter your tax in percentage: 3.45 Your Salary amount without tax :36569.37 Your Salary amount with tax :35376.78
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Database connectivity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education