/*A company requires a program that allows them to enter the quantity of gravel being purchased, the cost per tonne and then calculate appropriate discounts as follows: Tonnage Discount Between 5 and 8 2% Between 9 and 40 4% Above 40 6% The program should exit once the purchase price has been calculated and displayed. */ #include "stdafx.h" #include #include using namespace std; int main() { int gravel; double costper1; float discount; cout << "enter the quantity of gravel\n"; cin >> gravel; cout << "enter the cost per tonne of gravel\n"; cin >> costper1; costper1 = gravel * costper1; if (gravel >= 5 && gravel <= 8) { discount = (costper1)-costper1 * 0.02; // if condition is true then print the following cout << "discounted cost is: " << discount << "\n"; } else if (gravel >= 9 && gravel <= 40) { discount = (costper1)-costper1 * 0.04; // if else condition is true then print the following cout << " discounted cost is: " << discount << "\n"; } else { discount = (costper1)-costper1 * 0.06; ; // if none of the conditions is true cout << " discounted cost is: " << discount << "\n"; } return 0; }