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; } 
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
