I need help with, “ who doesn’t love a discount.” | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 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; }

27th Aug 2021, 8:36 PM
Naim Emerllahu
Naim Emerllahu - avatar
2 Answers
+ 3
float totalPrice;
28th Aug 2021, 2:24 AM
Simba
Simba - avatar
27th Aug 2021, 9:21 PM
Simon Sauter
Simon Sauter - avatar