Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class angajat
- {
- float net, brut, ore, tarif;
- public:
- void introdu();
- float calculeaza(float brut, float ore, float tarif);
- void afisare();
- } angajati;
- void angajat::introdu()
- {
- cout << "Introdu salariul brut: ";cin >> angajati.brut;
- cout << "\nIntrodu numarul de ore: ";cin >> angajati.ore;
- cout << "\nIntrodu tariful: ";cin >> angajati.tarif;
- }
- float angajat::calculeaza(float brut, float ore, float tarif)
- {
- float rezultat = 0.00;
- rezultat = (brut * 70) / 100 + tarif * ore;
- return rezultat;
- }
- void angajat::afisare()
- {
- cout << "\nSalariul este de: " << float(angajati.calculeaza(angajati.brut, angajati.ore, angajati.tarif));
- }
- int main()
- {
- angajati.introdu();
- angajati.afisare();
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement