Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

In Java, answer the following problem. Write a Java program that will prompt users for persons last name, year of birth, and employee number in

In Java, answer the following problem. Write a Java program that will prompt users for persons last name, year of birth, and employee number in a predefined specific format. Then it will need to parse the input string and print it in separate lines along with validations.

The input format will be of the form :,< employee number >

It will need to separate three segments in order to print it as:

Last name Year of birth Employee number

The program will report if these values are Valid, or if they are Invalid.

Functional requirements:

1. A last name is valid if it contains only letters and spaces, it begins and ends with a letter, and it does not contain consecutive spaces.

2. Valid birth years are integers between 1900 and 1999, inclusive, but your program must print Invalid on non-numeric input. Implicitly, this means you must read the data as a string.

3. Valid employee number will have the format LDDD-DD-DDDD, where L is a capital letter and each D is a digit. For example, A991-16-4602.

4.You will need to use at least the indexOf and substring methods.

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_2

Step: 3

blur-text-image_3

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 And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students explore these related Databases questions