Question 4.15
unknown
c_cpp
2 years ago
486 B
4
Indexable
#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; }
Editor is loading...