#include <iostream>
using namespace std;
int main()
{
double salary1, salary2, salary3; // Заработные платы работников
double tax1, tax2, tax3; // Суммы исчисленного налога с зарплаты работников
cout << "Enter the salary of the first worker: ";
cin >> salary1;
cout << "Enter the amount of tax paid by the first worker: ";
cin >> tax1;
cout << "Enter the salary of the second worker: ";
cin >> salary2;
cout << "Enter the amount of tax paid by the second worker: ";
cin >> tax2;
cout << "Enter the salary of the third worker: ";
cin >> salary3;
cout << "Enter the amount of tax paid by the third worker: ";
cin >> tax3;
// Вычисляем зарплату работников после вычета налогов.
double netSalary1 = salary1 - tax1;
double netSalary2 = salary2 - tax2;
double netSalary3 = salary3 - tax3;
// Выводим результат.
cout << "\nThe net salaries are:" << endl;;
cout << "\nFirst worker's net salary is: $" << netSalary1 << endl;;
cout << "\nSecond worker's net salary is: $" << netSalary2 << endl;;
cout << "\nThird worker's net salary is: $" << netSalary3 << endl;;
return 0 ;
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main()
{
double salary1, salary2, salary3; // Заработные платы работников
double tax1, tax2, tax3; // Суммы исчисленного налога с зарплаты работников
cout << "Enter the salary of the first worker: ";
cin >> salary1;
cout << "Enter the amount of tax paid by the first worker: ";
cin >> tax1;
cout << "Enter the salary of the second worker: ";
cin >> salary2;
cout << "Enter the amount of tax paid by the second worker: ";
cin >> tax2;
cout << "Enter the salary of the third worker: ";
cin >> salary3;
cout << "Enter the amount of tax paid by the third worker: ";
cin >> tax3;
// Вычисляем зарплату работников после вычета налогов.
double netSalary1 = salary1 - tax1;
double netSalary2 = salary2 - tax2;
double netSalary3 = salary3 - tax3;
// Выводим результат.
cout << "\nThe net salaries are:" << endl;;
cout << "\nFirst worker's net salary is: $" << netSalary1 << endl;;
cout << "\nSecond worker's net salary is: $" << netSalary2 << endl;;
cout << "\nThird worker's net salary is: $" << netSalary3 << endl;;
return 0 ;
}