W t error? | Sololearn: Learn to code for FREE!

0

W t error?

#include <iostream> #include <string> using namespace std; struct employee { int eno; string ename; string job; float salary; float bonus ; float total_salary; }; void get_data (employee arr[] , int size ); void set_bonus (employee e , float percent); void print (employee arr [] , int size); int main() { employee emps [5]; get_data (emps , 5); set_bonus (emps [1], 0.1f); print (emps , 5); } void get_data (employee arr[] , int size ) { for (int i=0; i<size; i++) { cout << "Enter employee no, name, job \n"; cin >> arr[i].eno>>arr[i].ename >>arr[i].job; if (arr[i].job == "Manager") arr[i].salary = 5000; else if (arr[i].job == "Engineer") arr[i].salary = 3000; else if (arr[i].job == "Clerk") arr[i].salary = 2000; else arr[i].salary = 1000; } } void set_bonus (employee &e , float percent) { e.bonus = e.salary * percent; } void print (employee arr[] , int size) { for (int i=0; i<size; i++) cout << "Emp No."<< arr[i].eno <<

c++

1/28/2021 6:58:18 AM

eyad omar

2 Answers

New Answer

+3

eyad omar The code is truncated because it exceeds Description character limits. You need to save that code in SoloLearn and share the link instead. Follow below guide to share the code link https://www.sololearn.com/post/75089/?ref=app

0

In the name of kindly generous ALLAH Thanks ALLAH Hello eyad omar Try this(by the explanations): https://code.sololearn.com/ctou3kpIrqTH/?ref=app