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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started