Question 4.15

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
486 B
1
Indexable
Never
#include <iostream>
#include <iomanip>

int main() {
    double usrInput;

    while (true) {
        std::cout << "Enter sales in dollars (-1 to end): ";
        std::cin >> usrInput;

        if (usrInput == -1) {
            break; // Exit the loop when -1 is entered
        }

        double salesRev = usrInput * 0.09;
        double salary = 200 + salesRev;
        std::cout << "Salary is: $" << std::fixed << std::setprecision(2) << salary << std::endl;
    }

    return 0;
}