Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

REQUIREMENTS: Write a Graphical User Interface (GUI) program using JavaFX that prompts the user to enter a credit card number. Display whether the number is

REQUIREMENTS: Write a Graphical User Interface (GUI) program using JavaFX that prompts the user to enter a credit card number. Display whether the number is valid and the type of credit cards (i.e., Visa, MasterCard, American Express, Discover, and etc). The requirements for this assignment are listed below: Create a class (CreditNumberValidator) that contains these methods: // Return true if the card number is valid. Boolean isValid(String cardNumber); // Get result from Step 2. int sumOfDoubleEvenPlace(String cardNumber); // Return this number if it is a single digit. Otherwise, return the sum of the two digits. // This function is used in Step 1. int getDigit(int number); // Return sum of odd-place digits in in card number (Step 3). int sumOfOddPlace(String cardNumber); // Return true if substr is the prefix for card number. bool startsWith(String cardNumber, String subStr); The GUI must allow the user to enter the credit card number. There is a Validate button. When clicked, the entered credit card number will be validated. If the credit card number is a valid Visa credit card number, display the image of the Visa card. If the credit card number is a valid American Express credit card number, display the image of the American Express card. If the credit card number is a valid Master credit card number, display the image of the Master card. If the credit card number is a valid Discover credit card number, display the image of the Discover card. If the credit card is invalid, display the Invalid Number image. Do not allow non-digits from being entered.

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

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions