Question: URGENTLY NEEDED HELP! Question 1 Identify and fix the errors in Q1lab5.cpp . Compile and run the program to display the output in Figure 1.

URGENTLY NEEDED HELP!

Question 1

Identify and fix the errors in Q1lab5.cpp. Compile and run the program to display the output in Figure 1. Submit Q1lab5.cpp for the answer of Question 1. (25 minutes)

#include

using namespace std;

struct Employee {

int empID;

char name[50];

double salary;

char department[50];

};

void display(Employee [],int);

double avgSalary(double,int);

int main() {

struct emp[3] = { { 111 , "Hassan" , 20000 , "Finance" } ,

{ 121 , "Sarah" , 50000 , "HR" } ,

{ 131 , "Adam Ali" , 15000 , "Technical" } };

cout

cout

display(Employee,3);

return 0;

}

void display(Employee ,int n) {

double all,highest;

int i;

highest=salary;

for( i=0; i

cout

cout

cout

all=avgSalary(salary,i);

cout

cout

if(salary>highest)

highest=salary;

}

cout

cout

}

double avgSalary(double,int x)

{

double static sum=0;

cout

sum=sum + slry;

}

URGENTLY NEEDED HELP! Question 1 Identify and fix the errors in Q1lab5.cpp.

The Employee information is given as follows: Employee ID: 111 Name: Hassan Salary: 20000 Worker #: 1 Department: Finance Employee ID: 121 Name: Sarah Salary: 50000 Worker #: 2 Department: HR Employee ID: 131 Name: Adam Ali Salary: 15000 Worker #: 3 Department: Technical Average for 3 workers : 28333.3 Highest salary is : 50000 Figure 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!