Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To help increase customer traffic, many restaurants implement reward ( loyalty ) programs for their customers. Such programs vary from restaurant to restaurant. However, most

To help increase customer traffic, many restaurants implement reward (loyalty) programs for their customers. Such programs vary from restaurant to restaurant. However, most programs involve two components: 1) earning points based on the number, type, or dollar amount of their purchases; and 2) redeeming points they have earned for rewards such as discounts on dining. The challenge for the restaurant is tracking the points earned for each customer and then summarizing rewards they qualify for.
Project Overview
Spartys Breakfast Cafe has been doing a great business since opening a few months ago. However, to keep its momentum going, Sparty would like to implement a loyalty program for its frequent customers. Customers will earn Sparty Points based on both dollars spent at the restaurant as well as number of visits to the restaurant. Although a typical rewards program would include ongoing recording and tracking of reward activities each time a customer makes a visit, we will be developing a program that will simply allow the customer to enter in one or more receipts, figure out their reward points, and report the different rewards they qualify for.
Clarifying note: Although usage should be relatively clear, be aware that the term program can refer to one of two things in this document: 1) the rewards program (scheme) the restaurant is implementing, and 2) the program you will create to help support the rewards scheme.
Project Objectives
The objectives for this project are to use the initial programming skills and techniques you have learned so far (or will learn before the project due date), including:
Input/output
Variables
Arithmetic expressions and operations
Conditional statements
Relational (Boolean) expressions
Basic Repetition / Looping
Project Description
Earning Points
Customers can earn Sparty Points based on the following criteria for each visit:
visit reward: 1 point for each visit
spend reward: 1 point for every $5 spent in a visit (no partial points are awarded, e.g., $5 and $7.50 both earn 2 points)
high spend bonus: 5 points for every $100 spent in a visit (again, with no partial points awarded)
high spend multiplier: if a customer spends $250 or more in a visit, then their earned points (per above criteria) are multiplied by 2.
Example calculations:
Total Bill Visit Points Spend Points High Spend Points High Spend Multiplier Points Earned
$4.9910011
$30.2316017
$90.901180119
$99.991190120
$100.001205126
$100.011205126
$147.221295135
$249.9914910160
$251.45150102122
$323.78164152160
Redeeming Points
Customers can redeem points based on the following rewards table:
Points Required Reward
255% discount
40 Free pancakes
60 Free combo breakfast
10020% discount
Program Requirements
Your program will need to allow a customer to enter their restaurant receipt information for any number of individual visits. Based on the information they enter (i.e., total cost from each their restaurant receipt(s), you will then tabulate the rewards program points and print a summary of possible awards the customer has earned.
Side comment: When undertaking problem solving, either on a macro (entire problem) or a micro (part of problem), it is not uncommon to think in terms of initialization, repetitive/main processing, and termination/summarization. Your program will need to be structured in this manner, as described below.
Your program should perform the following:
Startup processing
Print a startup message to the user running the program:
S P A R T Y ' S B R E A K F A S T C A F E
Rewards Calculator
Note: there are no spaces to the left of the first heading line; also, do not include any spaces at the end of either heading line. You should also include a blank line after the text before displaying any user prompts (as described below).
Initialize summary variables to keep track of:
count of visits
total visit costs
total points earned
Main processing
After program startup, your program should process any number of inputs, each representing a single visit.
You will prompt the user for input and accept the user input. You should display the following prompt for this purpose:
Enter the total cost for the visit, or "DONE" to end input:
Make sure your prompt ends with a blank space and no newline.
Although it is usual (and good) programming practice, you do not need to perform any data validation on input. For this program you may assume that all input will be valid (either a valid dollar amount or the word DONE).
If the user inputs DONE, your program should leave the main processing and proceed to summary processing (item 3 below).
If the user does not enter DONE, you can assume it is a dollar amount for one of the customer's visits. You should then:
Calculate the reward points eaPrint a line that summarizes the visit, including the visit cost and points earned. T

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

Students also viewed these Databases questions