tak som sa snažia riešiť nasledujúce úlohy:
Nižšie je uvedený kód, ktorý som prísť s. Mám problémy s ukladanie údajov, správne a nie som si istý, kam dať read() a výstupu() funkcia. To asi nie je príliš ťažké, ale ja som stále nie je istý. Môže niekto možno mi dať tip? Ďakujeme!
#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;
}