I need help with making this c++ code compile. It's due soon     #include #include using namespace std; class Employee{ public: string name; string title; double wages void setName(string n) { name = n; } string getName() { return name; } void settitle(string t) { title = t; } string gettitle() { return title; } void setpayment(double w) { wages = w; } double getpayment() { return wages; } private: string name; string title; double wages; }; int main(){ vectorInfo; Employee E1("Aaron Ramsdale","Goalkeeper",60.1); Employee E2("Bukayo Saka","Winger",60.3); Employee E3("Gabriel Jesus","Forward",120.9); Employee E4("Gabriel Martinelli","Winger",75.4); Employee E5("Martin Odeggard","Midfielder",110.5); Employee E6("Granit Xhaka", "Midfielder",100.3); Employee E7("Thomas Partey","Midfielder",180.1); Employee E8("Olexandr Zinchenko","Defender",120.2); Employee E9("Gabriel Maghaeles","Defender",100.3); Employee E10("Willam Saliba","Defender",45.4); Employee E11("Ben White","Defender",110.5); Info.push_back(E1); Info.push_back(E2); Info.push_back(E3); Info.push_back(E4); Info.push_back(E5); Info.push_back(E6); Info.push_back(E7); Info.push_back(E8); Info.push_back(E9); Info.push_back(E10); Info.push_back(E11); int hours =0; vectorTotal(11); cout << "Welcome, this app helps to locate employee info and calculate your total wages. The options are shown below." << endl; int choice = 0; while(true){ cout<<"1. Print list of employees"<> choice; cout<<". "<> hours; double income = hours * Info.at(i).getpayment(); totalwage.at(i)= income; } } if (choice == 3){ cout<< "You are leaving the app."<< endl; } } return 0; }     Question   The program presents the user with several options: Print list of employees Calculate total wages Exit application The user will select one of these options by entering the option's enumerated value (i.e., enter 2 to calculate total wages). The "Print list of employees" should print each employee name, job title, and associated hourly wages. The "Calculate total wages" option will iterate through each employee and ask the user to input the total number of hours worked for each employee, multiplying that by the employee's hourly wages, and adding that to the total. After iterating through all employees, the total wages for that week should be displayed. The "Exit application" will break the application out of its main loop and exit the program.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I need help with making this c++ code compile. It's due soon

 

 

#include<iostream>
#include<vector>

using namespace std;
class Employee{

public:
string name;
string title;
double wages

void setName(string n)
{
name = n;
}
string getName()
{
return name;
}
void settitle(string t)
{
title = t;
}
string gettitle()
{
return title;
}
void setpayment(double w)
{
wages = w;
}
double getpayment()
{
return wages;
}

private:
string name;
string title;
double wages;
};

int main(){
vector<Employee>Info;
Employee E1("Aaron Ramsdale","Goalkeeper",60.1);
Employee E2("Bukayo Saka","Winger",60.3);
Employee E3("Gabriel Jesus","Forward",120.9);
Employee E4("Gabriel Martinelli","Winger",75.4);
Employee E5("Martin Odeggard","Midfielder",110.5);
Employee E6("Granit Xhaka", "Midfielder",100.3);
Employee E7("Thomas Partey","Midfielder",180.1);
Employee E8("Olexandr Zinchenko","Defender",120.2);
Employee E9("Gabriel Maghaeles","Defender",100.3);
Employee E10("Willam Saliba","Defender",45.4);
Employee E11("Ben White","Defender",110.5);

Info.push_back(E1);
Info.push_back(E2);
Info.push_back(E3);
Info.push_back(E4);
Info.push_back(E5);
Info.push_back(E6);
Info.push_back(E7);
Info.push_back(E8);
Info.push_back(E9);
Info.push_back(E10);
Info.push_back(E11);

int hours =0;
vector<double>Total(11);
cout << "Welcome, this app helps to locate employee info and calculate your total wages. The options are shown below." << endl;

int choice = 0;
while(true){
cout<<"1. Print list of employees"<<endl;
cout<<"2. Calculate total wages"<<endl;
cout<<"3. Exit application"<<endl;
cin >> choice;
cout<<". "<<endl;


if (choice == 1){
for int(i=0; i < Info.size(); i++){
cout<< Info.at(i). getname()<< "," << Info.at(i).gettitle()<<","<<Info.at(i).getpayment()<<endl;
}
}
if (choice == 2){
for int(i = 0; i< Info.size();i++){
cout<< "Enter number of hours worked"<< Info.at(i). getname()<<;
cin >> hours;
double income = hours * Info.at(i).getpayment();
totalwage.at(i)= income;

}
}
if (choice == 3){
cout<< "You are leaving the app."<< endl;
}


}

return 0;
}

 

 

Question

 

The program presents the user with several options:

Print list of employees

Calculate total wages

Exit application

The user will select one of these options by entering the option's enumerated value (i.e., enter 2 to calculate total wages).

The "Print list of employees" should print each employee name, job title, and associated hourly wages.

The "Calculate total wages" option will iterate through each employee and ask the user to input the total number of hours worked for each employee, multiplying that by the employee's hourly wages, and adding that to the total. After iterating through all employees, the total wages for that week should be displayed.

The "Exit application" will break the application out of its main loop and exit the program.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education