0% found this document useful (0 votes)
4 views5 pages

PPR

The document contains multiple code snippets in C++ related to employee management, including displaying employee details, sorting employees by basic salary, and calculating net salaries. Additionally, it discusses the PM CARES Fund established in Pakistan for COVID-19 relief efforts, detailing its purpose, governance, and donation structure. Lastly, there are incomplete code snippets related to data copying and insertion functions.

Uploaded by

burhannajeeb8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

PPR

The document contains multiple code snippets in C++ related to employee management, including displaying employee details, sorting employees by basic salary, and calculating net salaries. Additionally, it discusses the PM CARES Fund established in Pakistan for COVID-19 relief efforts, detailing its purpose, governance, and donation structure. Lastly, there are incomplete code snippets related to data copying and insertion functions.

Uploaded by

burhannajeeb8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Question 4:

#include <iostream>
using namespace std;
struct Employee {
int Emp_No;
char Emp_Name[15];
float Emp_Basic;

};
int sizeOfEmp;
void display(Employee E[], int index)
{
if (index <= sizeOfEmp) {
for (int i = 0; i < index; i++) {
cout << endl << "Employee_No :" << E[i].Emp_No;
cout << endl << "Employee_Name :" << E[i].Emp_Name;
cout << endl << "Employee_Basic :" << E[i].Emp_Basic;
}
}
else
{
cout << "Error! Out Of Range Parameter" << endl;
}
}
void sort(Employee E[], int index)
{
if (index <= sizeOfEmp) {
Employee temp;
for (int i = 0; i < index; i++)
{
for (int j = i + 1; j < index+1; j++)
{
if (E[i].Emp_Basic > E[j].Emp_Basic) {
temp = E[j];
E[j] = E[i];
E[i] = temp;
}
}

}
}
cout<<"Sorting Complete: "<<endl;
}
void NetSalary(Employee E[], int index)
{
cout<<endl << "=======================" << endl<<"Net salaries of employee
are"<<endl;
float Salary[50];
if (index <= sizeOfEmp)
{
for (int i = 0; i < sizeOfEmp; i++)
{
Salary[i] = (1.25) * E[i].Emp_Basic;
cout << "Employee No :" << E[i].Emp_No << "Net Salary :" << Salary[i] <<
endl;
}
}

}
void main() {
int input;
cout << "Enter Size of Employee Array :";
cin >> input;
while (input <= 0)
{
cout << "Enter valid Size of Employee Array :";
cin >> input;
}
sizeOfEmp = input;
Employee *E= new Employee[input];
for (int i = 0; i < input; i++) {
cout << "Enter Emp Number :";
cin >> E[i].Emp_No;
cout << "Enter Emp Name :";
cin >> E[i].Emp_Name;
cout << "Enter Emp Basic :";
cin >> E[i].Emp_Basic;
}

display(E, 2);
sort(E, 2);
NetSalary(E, 2);

}
Output
Enter Size of Employee Array :1
Enter Emp Number :25
Enter Emp Name :burhan
Enter Emp Basic :20000
Error! Out Of Range Parameter
Sorting Complete:
=======================
Net salaries of employee are

Process returned 0 (0x0) execution time : 16.299 s


Press any key to continue.

Question 2:
#include <iostream>

using namespace std;

int main()
{
cout << "M .Burhan" << endl;
cout<<"the suggestion to handle the situation is "<<endl;
cout<<"The Prime Minister’s Citizen Assistance and Relief in Emergency Situations Fund (PM
CARES Fund) were created on 28 March 2020 following the COVID-19 pandemic in Pakistan"<<endl;.
cout<<"The fund will be used for combat, containment and relief efforts against the coronavirus outbreak
and similar pandemic like situations in the future."<<endl;

cout<<"The PM is the chairman of the trust. Members will include the defence, home and finance
ministers."<<endl;
cout<<"The fund will also enable micro-donations. The minimum donation accepted for the PM CARES
Fund is ₹10billon "<<endl;

cout<<"The donations will be tax-exempt and fall under corporate social responsibility"<<endl;
return 0;
}
Question 3
void SSD2HDD (copy())
{ DATA_SDD,DATA_HDD
copy(DATA_SSD TO DATA_HDD) };
[0:50 pm, 09/09/2020] Amir Sultan UOL: void insertSSD ()
{ SDD_name.insert(element)};

You might also like