Lengkap

Basic Code C++ using Struct: Employee Details

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";

}

}

}

Kemahiran: Pengaturcaraan C++, Pengaturcaraan C, Pengaturcaraan C#, Kejuruteraan Perisian, PHP

Lihat lagi: visual basic code extract excel data, visual basic code mysql, avoid inject bad code database using php, stock plots visual basic code, management conferencing system visual basic code, web data extraction visual basic code excel, write code calculate final salary employee, visual basic code application money management, employee details project classic asp, employee details projects using access 2003, developing basic profiles hl7 using netbeans, visual basic code using web camera, code pizza using visual basic, gui program code java employee details, employee details using database asp, jsp code employee details, code visual basic text editor using richtextbox control, Code for employee details

Tentang Majikan:
( 0 ulasan ) Petaling Jaya, Malaysia

ID Projek: #23396605

Dianugerahkan kepada:

bahaaabualrub

Hello.. I’m good in C++ programming and have been working on it for 3 years.. I’m ready to do your project

$10 USD dalam 2 hari
(0 Ulasan)
0.0

8 pekerja bebas membida secara purata $22 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
(27 Ulasan)
5.4
vikasg603

I have checked your code and resolved it You can check it directly, if you want you can send me the project else no need as such Here your code [login to view URL]

$20 USD dalam sehari
(19 Ulasan)
4.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
dmitrii1992

hello i read yours detail and i can do it i am c and c++ expert and i love it if you hire me,you earn perfect thing thanks

$20 USD dalam sehari
(5 Ulasan)
2.4
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
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
(0 Ulasan)
0.0