Basic Code C++ using Struct: Employee Details

Sedang Disiapkan Disiarkan 4 tahun lepas Dibayar semasa penghantaran
Sedang Disiapkan 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";

}

}

}

Pengaturcaraan C++ Pengaturcaraan C Pengaturcaraan C# Kejuruteraan Perisian PHP

ID Projek: #23396605

Tentang projek

6 cadangan Projek jarak jauh Aktif 4 tahun lepas

6 pekerja bebas membida secara purata $24 untuk pekerjaan ini

dobreiiita

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

$30 USD dalam sehari
(324 Ulasan)
7.1
arjun366333

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

$20 USD dalam 7 hari
(32 Ulasan)
6.1
TaiZhe0224

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

$30 USD dalam sehari
(4 Ulasan)
2.7
rahuliit1

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.

$20 USD dalam 7 hari
(3 Ulasan)
1.3
eleobertalmeidap

Hello! I am a C++ expert. This is very easy for me. I will finish it as soon as you award me this project.

$25 USD dalam sehari
(0 Ulasan)
0.0