Question: Write a Java program that reads a series of strings from a user until STOP is entered. Each input consists of information about one student

Write a Java program that reads a series of strings from a user until STOP is entered. Each input consists of information about one student at the ABC Professional School. The input consists of the students last name (the first 15 characters with extra blanks on the right if the name is not 15 characters long), the students number (the next 4 characters, all digits, a number between 1000 and 5999), and the students program of study (one character, either B for Business, C for Computing, L for Law, N for Nursing or T for Tourism).

This information must be read in as one string, and broken into the individual pieces. As the code tries to break the string into its parts, exceptions may be thrown. Some are Java exceptions (which ones?) and some are programmer created exceptions (which ones?) Catch these in main and print out a description of the problem encountered. Be specific. For example rather than outputting, invalid student number state that 6789 is an invalid student number.

Input a series of these strings, so that all possible exceptions are tested, then input STOP when you are done.

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!