Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // TrainersSalary.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- #include <iomanip>
- using namespace std;
- int main()
- {
- double lectures, budget;
- cin >> lectures >> budget;
- double salary_jelev = 0;
- double salary_royal = 0;
- double salary_roli = 0;
- double salary_trofon = 0;
- double salary_sino = 0;
- double salary_other = 0;
- double salary_lecture = budget / lectures;
- for (int i = 1; i <= lectures; i++)
- {
- string name_trainers;
- cin >> name_trainers;
- if (name_trainers == "Jelev")
- {
- salary_jelev += salary_lecture;
- }
- else if (name_trainers == "RoYaL")
- {
- salary_royal += salary_lecture;
- }
- else if (name_trainers == "Roli")
- {
- salary_roli += salary_lecture;
- }
- else if (name_trainers == "Trofon")
- {
- salary_trofon += salary_lecture;
- }
- else if (name_trainers == "Sino")
- {
- salary_sino += salary_lecture;
- }
- else
- {
- salary_other += salary_lecture;
- }
- }
- cout << "Jelev salary: " << fixed << setprecision(2) << salary_jelev << " lv" << endl;
- cout << "RoYaL salary: " << fixed << setprecision(2) << salary_royal << " lv" << endl;
- cout << "Roli salary: " << fixed << setprecision(2) << salary_roli << " lv" << endl;
- cout << "Trofon salary: " << fixed << setprecision(2) << salary_trofon << " lv" << endl;
- cout << "Sino salary: " << fixed << setprecision(2) << salary_sino << " lv" << endl;
- cout << "Others salary: " << fixed << setprecision(2) << salary_other << " lv" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement