Basic Code C++ using Struct: Employee Details
$10-30 USD
Dibayar semasa penghantaran
I would like for someone to fix my code as the output is not what i hoped for
heres my code:
#include <iostream>
#include <string>
using namespace std;
struct Employee
{
int emp_no;
string ename;
string job;
float salary;
float bonus;
};
int main()
{
Employee arr[10];
cout<<"Please enter the employee info"<<"\n";
for(int i=1; i<10; i++)
{
cout<< "Enter employee no "<<"\n";
cin>>arr[i].emp_no;
cout<< "Enter employee ename "<<"\n";
cin>>arr[i].ename;
cout<< "Enter employee's job "<<"\n";
cin>>arr[i].job;
cout<< "Enter employee bonus"<<"\n";
cin>>arr[i].bonus;
if (arr[i].job == "senior lecturer")
{
arr[i].salary = 6000;
}
else
if (arr[i].job == "Lecturer")
{
arr[i].salary = 5000;
}
else
if (arr[i].job == "Admin Assistant")
{
arr[i].salary = 2500;
}
else
arr[i].salary = 1500;
for(int i=1; i<10; i++)
{
cout<<"Employee number"<<" " <<arr[i].emp_no<<"\n";
cout<<"Employee ename"<<" " <<arr[i].ename<<"\n";
cout<<"Employee job"<<" " <<arr[i].job<<"\n";
cout<<"Employee salary"<<" " <<arr[i].salary<<"\n";
cout<<"Employee bonus"<<" " <<arr[i].bonus<<"\n";
}
}
}
ID Projek: #23396605
Tentang projek
6 pekerja bebas membida secara purata $24 untuk pekerjaan ini
Hello I am C++ expert and interested in the project. I have reviewed attached file and your codes and confident to handle the project perfectly. Please communicate to discuss further. Regards Anshu
Hello, i'm interested in your project. Please send me a message so that we can discuss more. I prefer to submit my detailed proposal after our discussion. Note: + We are flexible with changes. + [login to view URL] Lagi
Hi, This is Jin from China. I have checked your project description and I understood your requirements fully. I have experience in c++ programming, so I am very confident about your project. Especially I had developed Lagi
I love to code and I have been using c++,c,java,python for my personal project from a long time and I solved so many competitive programming question using these languages.
Hello! I am a C++ expert. This is very easy for me. I will finish it as soon as you award me this project.