Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions