#define _CRT_SECURE_NO_WARNINGS
#include <string>

using namespace std;

int main(int argc, char** argv)
{
	//Setting Variables
	double gravelQuantity = 0;
	double costPerTonne = 0;

	double subTotal = 0;
	double finalPrice = 0;
	double discountPercentage = 0;
	double discountPrice = 0;

	//Allow the User to Set Variable Values
	printf("Please enter the gravel Quantity (Tonnes): ");
	scanf("%lf", &gravelQuantity);

	printf("Please enter the cost for the gravel (per tonne): ");
	scanf("%lf", &costPerTonne);

	//Determine What Discount Percentage Available
	if (gravelQuantity >= 5 && gravelQuantity <= 8)
	{
		discountPercentage = 2;
	}

	if (gravelQuantity >= 9 && gravelQuantity <= 40)
	{
		discountPercentage = 4;
	}

	if (gravelQuantity >= 40)
	{
		discountPercentage = 6;
	}

	//Calculating Sub Total
	subTotal = gravelQuantity * costPerTonne;

	//Calculating discount Price
	discountPrice = (discountPercentage / subTotal) * 100;

	//Calculating Final Price
	finalPrice = subTotal - discountPrice;

	//Display Final Price
	printf("Sub Total Price: %0.2f\r\n", subTotal);
	printf("The Final Price is: %0.2f\r\n", finalPrice);

	return 0;
}
