Devam Ediyor

513798 Java Lab 4

STEP 1: InheritanceTest (20 points)

Back to top

Write a program called [url removed, login to view] 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 data 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. Provide applicable accessor methods, mutator methods, toString() methods, area() method and volume() method to all classes. Write a program that instantiates objects of your classes, test all instance methods and outputs each object's area and volume when appropriate.

STEP 2: DayGui (10 points)

Back to top

Write a program called [url removed, login to view] that creates a GUI having the following properties:

Object

Property

Setting

JFrame

Name

Caption

Layout

mainFrame

Messages

FlowLayout

JButton

Name

Caption

Mnemonic

cmdGood

Good

G

JButton

Name

Caption

Mnemonic

cmdBad

Bad

B

Add individual event handlers to the 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.

STEP 3: OfficeAreaCalculator (10 points)

Back to top

Write a program called [url removed, login to view] that displays the following prompts using two label components:

Enter the length of the office:

Enter the width of the office:

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. 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).

Beceriler: Her şey Kabul, Java

Daha fazlasını görün: inheritancetest java input, lab support, step inheritancetest points, java step daygui, lab test, java to c, java lab program, java calculate, java jframe application, java text message, gui layout, using program java, java test program, display cube, lab java, java add data, java cube lab, today good day java, square point cube, object method, point square cube class, inheritance hierarchy class point square cube, input program gui, inheritance gui java, add data java

İşveren Hakkında:
( 4 değerlendirme )

Proje NO: #2259730

Seçilen:

ranjitsinha

Ready to do it. Thanks.

0 gün içinde 10$ USD
(200 Değerlendirme)
5.6