Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in Java that checks the format of a special identifier passed through the command line argument args[0]. The special identifier has to

Write a program in Java that checks the format of a special identifier passed through the command line argument args[0]. The special identifier has to start with an uppercase letter. The rest characters of the identifier must be a letter, a digit, or a special character (!, @, #, $, %). The special identifier must contain at least a digit and a special character.

The output of the code will be either Legal id. or Illegal id..

Starter Code:

public class SpecialistIdentifier { public static void main(String[]args) { if(args.length==0) { System.out.println("Usage: need a command line argument to run!"); return; } } private static boolean isSpecialCharcter(char ch) { if(ch=='!' || ch=='@'|| ch=='#' || ch=='$' || ch=='%') return true; return false; } }

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 Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

What is the purpose of small nuclear RNA? What is an snRNP?

Answered: 1 week ago

Question

Can we account for placebo effects and assess pure effectiveness?

Answered: 1 week ago