akosiraff

Download: Inheritance DayGUI Area Calculator Java

Feb 10th, 2013
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/inheritance-daygui-area-calculator-java/
  3. Write a program called InheritanceTest.java to support an inheritance hierarchy for class Point-Square-Cube. Use Point as the superclass of the hierarchy. Specify the instance variables and methods for each class. The private variable of Point should be the x-y coordinates. The private data of Square should be the sideLength. The private data of Cube should be depth. Each class must provide applicable accessor, mutator, and toString() methods for manipulating private variables of each corresponding class. In addition, the Square class must provide the area() and perimeter() methods. The Cube must provide the area() and volume() methods.
  4. Write a program that instantiates objects of your classes, ask the user to enter the value for x, y, and sideLength, test all instance methods and outputs of each object’s perimeter, area, and volume when appropriate.
  5. Second-
  6. Write a program called DayGui.java that creates a GUI having the following properties
  7. Object
  8. Property
  9. Setting
  10. JFrame
  11. Name
  12. Caption
  13. Layout
  14. mainFrame
  15. Messages
  16. FlowLayout
  17. JButton
  18. Name
  19. Caption
  20. Mnemonic
  21. cmdGood
  22. Good
  23. G
  24. JButton
  25. Name
  26. Caption
  27. Mnemonic
  28. cmdBad
  29. Bad
  30. B
  31. Add individual event handlers to your program so that when a user clicks the Good button, the message “Today is a good day!” appears in a dialog box, and when the Bad button is clicked, the message “I’m having a bad day today!” is displayed. The following tutorial shows you much of the code solution. Feel free to use the tutorial, but make changes so that you are not simply copying the tutorial code for your entire solution. To make this different from the tutorial, change the colors of the buttons and panel. Also, add this application to a tabbed pane along with the program you will complete in the next step, Step 3. The following tutorials will likely be useful as you work to complete this step:
  32. JTabbedPane
  33. Third-
  34. Write a program called OfficeAreaCalculator.java that displays the following prompts using two label components
  35. Enter the length of the office:
  36. Enter the width of the office:
  37. Have your program accept the user input in two text fields. When a button is clicked, your program should calculate the area of the office and display the area in a text field with a label of Area. This display should be cleared whenever the input text fields receive the focus. A second button should be provided to terminate the application (Exit button).
  38. The following tutorial shows you much of the code solution. Feel free to use the tutorial, but make changes so that you are not simply copying the tutorial code for your entire solution. To make this different from the tutorial, change the colors of the panel. Also, add this application to the same tabbed pane (see the JTabbedPane tutorial) as the application you built in Step 2, the DayGui application.
  39.  
  40. Download: http://solutionzip.com/downloads/inheritance-daygui-area-calculator-java/
Advertisement
Add Comment
Please, Sign In to add comment