Question
Write a program to create a promo code. The user supplies the 4 letters followed by 4 digits. You should take the 4 digits, add
Write a program to create a promo code. The user supplies the 4 letters followed by 4 digits. You should take the 4 digits, add them up and use the remainder of the division by 10 to determine the check digit that will be added onto the end of the number.
For Example if the basis of the promo code was: WEDT3464
Add the digits 3 + 4 + 6 + 4 = 17 and take the modulo 10, 17 % 10 = 7
So the last digit would be a 7
Here are 4 separate sample runs (user input is shown in bold underline):
Sample Run #1
Enter basis of promo code: WEDK123D
Promo Code is not valid
Sample Run #2
Enter basis of promo code: ABC31234
Promo Code is not valid
Sample Run #3
Enter basis of promo code: HAPP23X5
Promo Code is not valid
Sample Run #4
Enter basis of promo code: WEDT3464
The completed Promo Code is: WEDT34647
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started