dlatego staram się rozwiązać następujące zadanie:
Poniżej znajduje się kod, który wymyśliłem. Mam problemy z prawidłowym przechowywaniem danych, i nie jestem pewien gdzie umieścić funkcję odczytu() i wyjściowe (). Prawdopodobnie to nie jest zbyt trudne, ale nadal nie jestem pewien. Może ktoś może dać mi jakieś wskazówki? Dziękuję!
#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;
}