#include <iostream>
int main() {
int u_input = 0;
double u_tax = 0.0;
double total = 0.0;
while (1) {
std::cout << "enter price: ";
std::cin >> u_input;
std::cout << "enter tax: ";
std::cin >> u_tax;
if ((u_input > 0) && (u_tax > 0 && u_tax <= 100))
break;
std::cout << "enter the correct value!" << std::endl;
}
u_tax = u_tax / 100;
total = u_input + (u_input * u_tax);
if (total % 100 != 0) {
u_tax = total + (100 - (total % 100));
std::cout << u_tax << std::endl;
}
std::cout << "press any key to continue...";
std::cin.get();
return 0;
}
error msg:
Severity Code Description Project File Line Suppression State
Error (active) E2140 expression must have integral or unscoped enum type test_cpp d:\...\test_cpp.cpp 20
Severity Code Description Project File Line Suppression State
Error (active) E2140 expression must have integral or unscoped enum type test_cpp d:\...\test_cpp.cpp 21