Question: For this homework assignment you are going to create a basic credit card validator. Write a program that asks the user to enter their full

For this homework assignment you are going to create a basic credit card validator. Write a program that asks the user to enter their full name, credit card number and a credit card charge amount. Here is an example of what the program should look like when it runs:

What is the credit card holder's full name? = Robert Bruce

What is the credit card number? = 4417123456789113

How much should be charged on the credit card? = 110.14

You have successfully processed the payment in the amount of $110.14 You will need to validate the credit card number that a user provides. To do this I have provided you with a method already that you can copy into your program.

Don't worry, you don't have to understand how this method works. You just need to figure out how to paste it into your code outside of the public static void main() method. copy this method into your program and use it to validate a credit card number:

For this homework assignment you are going to create a basic credit

You also need to validate the card holder's name. Your program should store the name "Robert Bruce" omewhere in a variable and then check any name that is provided against the name "Robert Bruce". So, if I rere to use your program and put my name in "Henner Mohr", your program should tell me that the name I rovided was not correct. inally, your program should store the maximum credit card amount as $1000.00 in a variable. Your rogram should detect if the amount to be charged on the card is greater than this $1000.00 and then otify the user that the charge is beyond the credit max of the card. Your program should accept any alues with decimal points such as 110.13,256.85,811.87 for amounts.

You can use the following valid credit card number to test your program: 4417123456789113

Remember to format the output correctly as seen in my output above for the amount provided for the credit card charge amount. Also your program should loop each time an invalid item was detected. If an invalid name, or invalid credit card number or a invalid amount is used, your program should ask again to enter those values. This means that you should collect the name, credit card charge and amount. Then check if all three of them are correct. If ANY one of them is not correct, you need to ask the user to enter all the values (name, credit card number, amount) again.

You need to keep asking for these values until they get them all correct. Below is an example of what your code should look like when the user gives input that isn't valid. In this screenshot, the user entered a credit card number that isn't real. What is the credit card holder's full name? Robert Bruce What is the credit card number? 1234123412341234 How much should be charged on the credit card? 100.59 You entered an invalid name or a credit card number or an amount. Please try again. What is the credit card holder's full name? Robert Bruce What is the credit card number? 4417123456789113 How much should be charged on the credit card? 100 You have successfully processed the payment in the amount of $100.00

card validator. Write a program that asks the user to enter theirfull name, credit card number and a credit card charge amount. Hereis an example of what the program should look like when it

For this homework assignment you are going to create a basic credit card validator. Write a program that asks the user to enter their full name, credit card number and a credit card charge amount. See section 5.4 in your book to learn how to use the Scanner in Java to input data. Here is an example of what the program should look like when it runs: Console Debug Shell Main (1) [Java Application] /Volumes/Eclipse/Eclipse.app/Contents/Eclipse/plugins/org.eclips What is the credit card holder's full name? Robert Bruce What is the credit card number? 4417123456789113 How much should be charged on the credit card? 110.14 You have successfully processed the payment in the amount of $110.14 You will need to validate the credit card number that a user provides. To do this I have provided you with a method already that you can copy into your program. Don't worry, you don't have to understand how this method works. You just need to figure out how to paste it into your code outside of the public static void main() method. opy this method into your program and use it to validate a credit card number: 'ou also need to validate the card holder's name. Your program should store the name "Robert Bruce" omewhere in a variable and then check any name that is provided against the name "Robert Bruce". So, if I rere to use your program and put my name in "Henner Mohr", your program should tell me that the name I rovided was not correct. inally, your program should store the maximum credit card amount as $1000.00 in a variable. Your rogram should detect if the amount to be charged on the card is greater than this $1000.00 and then otify the user that the charge is beyond the credit max of the card. Your program should accept any alues with decimal points such as 110.13,256.85,811.87 for amounts. You can use the following valid credit card number to test your program: 4417123456789113 Remember to format the output correctly as seen in my output above for the amount provided for the credit card charge amount. Also your program should loop each time an invalid item was detected. If an invalid name, or invalid credit card number or a invalid amount is used, your program should ask again to enter those values. This means that you should collect the name, credit card charge and amount. Then check if all three of them are correct. If ANY one of them is not correct, you need to ask the user to enter all the values (name, credit card number, amount) again. You need to keep asking for these values until they get them all correct. Below is an example of what your code should look like when the user gives input that isn't valid. In this screenshot, the user entered a credit card number that isn't real. What is the credit card holder's full name? Robert Bruce What is the credit card number? 1234123412341234 How much should be charged on the credit card? 100.59 You entered an invalid name or a credit card number or an amount. Please try again. What is the credit card holder's full name? Robert Bruce What is the credit card number? 4417123456789113 How much should be charged on the credit card? 100 You have successfully processed the payment in the amount of $100.00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!