Question: write in java. Write a program to determine whether the data type is valid or not. The rules for the data type are the following

write in java.

Write a program to determine whether the data type is valid or not.

The rules for the data type are the following

  • Only letters, odd numbers (1,3,5,7,9), pound sign (#) and underscore (_) can be used.
  • It cannot start with a digit or space.
  • Maximum length is 10
  • No space in between

INPUT

The first line contains an integer T (1 T 100), the number of test cases. T test case follows after. Each test case will consist of a line of string. Spaces should not appear at the end of a line.

OUTPUT

For each test case, output the following: "Case #x: " followed by either VALID or INVALID and "Invalid number of Test Cases." if the number of test case is invalid.

SAMPLE INPUT 3 Valid 12Price item_price

SAMPLE OUTPUT Case #1: VALID Case #2: INVALID Case #3: 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!