- 1
I need help with, â who doesnât love a discount.â
I canât figure out how to get it to print decimals. For example, 6930 is supposed to be discounted by 1039.5 but mine only shows 1039 #include <iostream> using namespace std; int main() { int purchaseAmount = 0; int totalPrice; int x = 0; //your code goes here do { cin >> purchaseAmount; totalPrice = purchaseAmount * 0.15; cout << totalPrice << endl; x++; } while (x < 3); return 0; }
2 RĂ©ponses
+ 3
float totalPrice;