main.cpp
#include <iostream>
#include <cmath>
using namespace std;
int main() {
double revenue;
double costs;
double tax;
cout << "What is the revenue?\n";
cin >> revenue;
cout << "What were the costs?\n";
cin >> costs;
cout << "What is the tax rate (%)?\n";
cin >> tax;
double grossProfit = revenue-costs;
double netProfit;
if (grossProfit>0) {
netProfit = grossProfit * (1 - 0.01*tax);
} else {
netProfit = grossProfit;
}
cout << "Net profit is ";
cout << netProfit << "\n";
return 0;
}