così sto cercando di risolvere il seguente compito:
Di seguito è il codice che ho creato. Sto avendo difficoltà a memorizzare i dati in modo corretto e non so dove mettere la read() e di output() funzione. Questo probabilmente non è troppo difficile, ma non sono ancora sicuro. Qualcuno può forse darmi un suggerimento? Grazie!
#include <iostream>
#include <iomanip>
using namespace std;
class Employee
{
public:
string name, department;
int age;
void output(string &a, int &b, string &c)
{
cout << name << endl;
cout << "Age: " << age << " years" << endl;
cout << "Department: " << department << endl;
}
void read(int &n)
{
cout << "Enter number, last name and first name:";
cin >> name;
cout << "Enter age:";
cin >> age;
cout << "Enter department:";
cin >> department;
}
};
int main() {
int n;
cout << "Enter number of employees: ";
cin >> n;
Employee* o = new Employee;
Employee employee;
delete o;
}