Sure, if-else will work here.
Making some assumptions on what you are doing and how, it might look something like this:
Code:
if (number_of_books_purchased < 6)
{
old_total = (number_of_books_purchased * 50);
new_total = (number_of_books_purchased * 35);
temp_total = (number_of_books_purchased * 20);
}
else
{
old_total = (number_of_books_purchased * 45);
new_total = (number_of_books_purchased * 30);
temp_total = (number_of_books_purchased * 15);
}
This puts them in a variable_total all on its own (which you would have to declare). Do not know if that is what you wanted/how you wanted to code, but this is far from the only way.
But uhh, why are you ripping off all your old and faithfull customers by making them pay so much more!