Informatics - Making Minimarket Discount Program in C++ Version 2 (week 13)
Are you ready for version two? Don't worry it's only needed a little addition and I'm sure you can do it by yourself! Your boss will be proud of you and maybe you'll get bonus? So, without any further do, let's start! So, the first version is only for counting the discount and the total price. But what if your minimarket wants to give a bonus item for a specific threshold? So, in second version I will show you how to add the bonus item for specific threshold. We start from the first code that we have made: //program minimarket_discount_v1.cpp #include <iostream> #include <iomanip> using namespace std; int main (){ double totalPurchase, discount = 0.0, finalPrice; cout << "Please enter the amount of purchase (in Rupiah): Rp"; cin >> totalPurchase; if (totalPurchase >= 1000000){ discount = 0.2; } else if (totalPurchase >= 500000){ discount = 0.1; } else if (totalPurchase >= 200000){ discount = 0.05; } e...