Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 11 Weeks Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
this is JAVA CLASS
Design a Swing GUI formula calculator. Your program will prompt the user to enter a non-negative number. If the user enters a negative number or a nondigit number, throw and handle an appropriate exception and prompt the user to re-enter another number. Your calculator has a button labeled “display result”; if it is clicked the system will display the result of calculation based on the following formula.
result = ( -x + .... p;ease look at the attach flile
CS3300 HW Assignment 4Question 1: Exceptions (15 points)Write a program that converts dates from numerical “month/day/year” format to normal“month day, year” format (for example, 12/25/2000 corresponds to December 25, 2000).You will define three exception classes, one calledMonthException, another calledDayException, and a third calledYearException.If the user enters anything other than a legal month number (integers from 1 to 12), yourprogram will throw and catch aMonthExceptionand ask the user to reenter themonth.Similarly, if the user enters anything other than a valid day number (integers from 1 toeither 28, 29, 30, or 31, depending on the month and year), then your program will throwand catch aDayExceptionand ask the user to reenter the day.If the user enters a year that is not in the range 1000 to 3000 (inclusive), then yourprogram will throw and catch aYearExceptionand ask the user to reenter the year.(There is nothing very special about the numbers 1000 and 3000 other than giving a goodrange of likely dates.) Use the following rule for determining if the year is a leap year: Ayear is a leap year if it is divisible by 4 but is not divisible by 100, or if it is divisible by400.Question 2: Exceptions and Swing (15 points)Design a Swing GUI formula calculator. Your program will prompt the user to enter anon-negative number. If the user enters a negative number or a nondigit number, throwand handle an appropriate exception and prompt the user to re-enter another number.Your calculator has a button labeled “display result”; if it is clicked the system willdisplay the result of calculation based on the following formula.±²³´µ ¶·¸ ¹ º»¸¼· ½¸ ¹ ¾»¾
Attachments:-----------