Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this laboratory assignment, create a Java program that prompts the user to input a string into a JOptionPane showinputDialog. It should check if the

image text in transcribed
image text in transcribed
image text in transcribed
In this laboratory assignment, create a Java program that prompts the user to input a string into a JOptionPane showinputDialog. It should check if the inputted word is a palindrome (same spelling forward and backward) and output a JOptionPane MessageDialog if it is. Your program should throw exceptions that you catch it: The entry is null (when you click cancel) The word contains a non-alphabetic character . You enter your own name The program should end when you type in "exit" in any case (Exit, exit, exit, etc should all work). Create classes for each exception that extend the exception class. Remember to call the parent class constructor using the keywork super(). When you catch an exception, output an appropriate message to the terminal that identifies which exception was caught. Somewhere in your program you should also have method that handles the inputted strings that throws the exceptions you have made. When checking if the inputted string is a palindrome, throw an exception if the word contains a character that isn't in the alphabet (S. Q. I. 1, 2, etc). It should be case sensitive as well ("Hannah" should not work, "hannah" should work). You only need to worry about palindromes that are one word long, If you finish early you may attempt to make you program work for palindromes that are more than one word (top spot, etc). This is worth no extra marks but just serves as a small challenge. If you finish early you may attempt to make you program work for palindromes that are more than one word (top spot, etc). This is worth no extra marks but just serves as a small challenge. If you are using the lab computers remotely you can run the whole program from the terminal as JOptionPane will not work over a remote connection. If you are able to run Java from your own computer or are coming in-person, I expect you to still use JOptionPane Submission Use JavaDoc to comment your program, remembering to comment each class and method. Include your name, student ID, class, and assignment type and number in a regular comment at the top of each source file. Remember to run the command javadoc filename for each java file you have When your program is completed, demonstrate it to the instructor, and upload your java source files to Moodle with a screen shot, all in a jar file. Use the jar -cf LastName_Lab3.jar Lab3 command to put it in a jar file. Assignments that do not compile or run may be awarded a mark of zero... Enjoy :) In this laboratory assignment, create a Java program that prompts the user to input a string into a JOptionPane showinputDialog. It should check if the inputted word is a palindrome (same spelling forward and backward) and output a JOptionPane MessageDialog if it is. Your program should throw exceptions that you catch it: The entry is null (when you click cancel) The word contains a non-alphabetic character . You enter your own name The program should end when you type in "exit" in any case (Exit, exit, exit, etc should all work). Create classes for each exception that extend the exception class. Remember to call the parent class constructor using the keywork super(). When you catch an exception, output an appropriate message to the terminal that identifies which exception was caught. Somewhere in your program you should also have method that handles the inputted strings that throws the exceptions you have made. When checking if the inputted string is a palindrome, throw an exception if the word contains a character that isn't in the alphabet (S. Q. I. 1, 2, etc). It should be case sensitive as well ("Hannah" should not work, "hannah" should work). You only need to worry about palindromes that are one word long, If you finish early you may attempt to make you program work for palindromes that are more than one word (top spot, etc). This is worth no extra marks but just serves as a small challenge. If you finish early you may attempt to make you program work for palindromes that are more than one word (top spot, etc). This is worth no extra marks but just serves as a small challenge. If you are using the lab computers remotely you can run the whole program from the terminal as JOptionPane will not work over a remote connection. If you are able to run Java from your own computer or are coming in-person, I expect you to still use JOptionPane Submission Use JavaDoc to comment your program, remembering to comment each class and method. Include your name, student ID, class, and assignment type and number in a regular comment at the top of each source file. Remember to run the command javadoc filename for each java file you have When your program is completed, demonstrate it to the instructor, and upload your java source files to Moodle with a screen shot, all in a jar file. Use the jar -cf LastName_Lab3.jar Lab3 command to put it in a jar file. Assignments that do not compile or run may be awarded a mark of zero... Enjoy :)

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

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

how would you have done things differently?

Answered: 1 week ago