Question: Design and code a Java console application that validates the data entry of a course code (like DC1439) and report back if the course code

Design and code a Java console application that validates the data entry of a course code (like DC1439) and report back if the course code is valid or not valid. The application uses the Java char and String data types to implement the validation.

The application is to read a course code entered by the user from the keyboard. The course code is made of 6 characters and should follow these rules:

First character is always an upper case D or a lower case d

Second character is always an upper case C or a lower case C

Third, fourth, fifth, and sixth characters are always digits (0-9)

The application then validates the course code against above the rules and prints a message if the course code is valid or not.

If the course code is not valid, the application should print a message explaining why the course code is not valid.

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!