// Nathanael Schwartz CS1A Chapter 4, pg. 221, #11
//
/*******************************************************************************
*
* DETERMINE POINTS EARNED
* _____________________________________________________________________________
* This program determines the number of points a customer earns based on the
* number of books purchased in a month.
*
* The points are awarded as follows:
* - 0 books = 0 points
* - 1 book = 5 points
* - 2 books = 15 points
* - 3 books = 30 points
* - 4+ books = 60 points
* _____________________________________________________________________________
* INPUT
* booksPurchased : Number of books purchased this month
*
* OUTPUT
* pointsEarned : Number of points earned based on books purchased
*
******************************************************************************/
#include <iostream>
using namespace std;
int main() {
// Declare variables
int booksPurchased; // INPUT - Number of books purchased
int pointsEarned; // OUTPUT - Points earned
// Ask for input
cout << "Enter the number of books purchased this month: \n";
cin >> booksPurchased;
// Determine points earned
if (booksPurchased == 0)
pointsEarned = 0;
else if (booksPurchased == 1)
pointsEarned = 5;
else if (booksPurchased == 2)
pointsEarned = 15;
else if (booksPurchased == 3)
pointsEarned = 30;
else if (booksPurchased >= 4)
pointsEarned = 60;
else
cout << "Invalid number of books entered." << endl;
// Output the points earned
cout << "You have earned " << pointsEarned << " points." << endl;
return 0;
}