Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double getNetSalary(string tittle)
- {
- if (tittle == "stazysta")
- {
- return 1834;
- }
- else if (tittle == "kontraktowy")
- {
- return 1885;
- }
- else if (tittle == "mianowany")
- {
- return 2132;
- }
- else if (tittle == "dyplomowy")
- {
- return 2492;
- }
- else
- {
- return 0;
- }
- }
- double getGrossSalary(string tittle)
- {
- if (tittle == "stazysta")
- {
- return 2538;
- }
- else if (tittle == "kontraktowy")
- {
- return 2611;
- }
- else if (tittle == "mianowany")
- {
- return 2965;
- }
- else if (tittle == "dyplomowy")
- {
- return 3483;
- }
- else
- {
- return 0;
- }
- }
- double getNetSeniority(double netSalary, int years)
- {
- if (years >= 4)
- {
- return netSalary * years * 0.01;
- }
- else
- {
- return 0;
- }
- }
- double getGrossSeniority(double grossSalary, int years)
- {
- if (years >= 4)
- {
- return grossSalary * years * 0.01;
- }
- else
- {
- return 0;
- }
- }
- double getNetJubileeAward(double netSalary, int years)
- {
- double jubileeAward = 0;
- if (years >= 20)
- {
- jubileeAward += netSalary * 0.75;
- }
- if (years >= 25)
- {
- jubileeAward += netSalary;
- }
- if (years >= 30)
- {
- jubileeAward += netSalary * 1.5;
- }
- if (years >= 35)
- {
- jubileeAward += netSalary * 2;
- }
- if (years >= 40)
- {
- jubileeAward += netSalary * 2.5;
- }
- return jubileeAward;
- }
- double getGrossJubileeAward(double grossSalary, int years)
- {
- double jubileeAward = 0;
- if (years >= 20)
- {
- jubileeAward += grossSalary * 0.75;
- }
- if (years >= 25)
- {
- jubileeAward += grossSalary;
- }
- if (years >= 30)
- {
- jubileeAward += grossSalary * 1.5;
- }
- if (years >= 35)
- {
- jubileeAward += grossSalary * 2;
- }
- if (years >= 40)
- {
- jubileeAward += grossSalary * 2.5;
- }
- return jubileeAward;
- }
- int main()
- {
- string name;
- string tittle;
- int years;
- cout << "Stopnie nauczyciela." << endl;
- cin >> name;
- while (tittle != "stazysta" && tittle != "kontraktowy" && tittle != "mianowany" && tittle != "dyplomowy")
- {
- cout << "Prosze podac stopien awansu zawodowego dla " << name << " (stazysta, kontraktowy, mianowany, dyplomowy)." << endl;
- cin >> tittle;
- }
- cout << "Ilość lat pracy" << name << "." << endl;
- cin >> years;
- double netSalary = getNetSalary(tittle);
- double grossSalary = getGrossSalary(tittle);
- double netSeniority = getNetSeniority(netSalary, years);
- double grossSeniority = getGrossSeniority(grossSalary, years);
- double netJubileeAward = getNetJubileeAward(netSalary, years);
- double grossJubileeAward = getGrossJubileeAward(grossSalary, years);
- cout << "Pensje podstawowe: " << netSalary << "zl. netto, " << grossSalary << "zl. brutto." << endl;
- cout << "Wysluga za lata pracy: " << netSeniority << "zl. netto, " << grossSeniority << "zl. brutto." << endl;
- cout << "Zarobek po przepracowanych latach: " << netSalary + netSeniority << "zl. netto, " << grossSalary + grossSeniority << "zl. brutto." << endl;
- cout << "Pensje podstawowe: " <<netJubileeAward << "zl. netto, " << grossJubileeAward << "zl. brutto." << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement