Devam Ediyor

512630 Lab 4: Inheritance and Simple GUI

Scenario/Summary

In this lab, you will create one project that uses inheritance and two simple Graphical User Interfaces (GUI) programs.

Deliverables

Program files for each of the three programs:

[url removed, login to view]

[url removed, login to view]

[url removed, login to view]

At the beginning of ALL your programs, put the program name, your name, and a brief description of the program.

Example:

/****************************************************************************

Program Name: InheritanceTest

Programmer's Name: Nana Liu

Program Description: This program will use inheritance to calculate the area of square and cube, etc...

*****************************************************************************/

How to submit your assignment:

[url removed, login to view] programs MUST have the same names as the assignment title.

[url removed, login to view] Java source file (*.java) must include a corresponding class file (*.class) program as evidence of success.

[url removed, login to view] must use a zipped folder to send your Weekly Assignment to the Dropbox. Do not send subfolders within your zipped folder. Place ALL of the .java and .class files for the week into the one zipped folder. The zipped folder should be named: YourLastName Week 4, and this zipped folder will contain all the weekly programming assignments.

[url removed, login to view] all program source files in a Word document with a screen shot of all your program output.

L A B S T E P S

STEP 1: InheritanceTest (20 points)

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, and 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, tests all instance methods, and outputs each object's area and volume when appropriate.

STEP 2: DayGui (10 points)

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

[url removed, login to view] tutorial

3:13, [url removed, login to view]

STEP 3: OfficeAreaCalculator (10 points)

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

Beceriler: Her şey Kabul, Java, PHP

Daha fazlasını görün: tutorial solution, tutorial in programming, tests java programming, solution tutorial, simple free php code, programming inheritance, programming in c tutorial, programmer tests, mainframe programming, lab support, java programming tutorial, java programming classes, java programming assignments, java and php programmer, inheritance programming, how to write an assignment, how to write a good summary, gui programming java, good and the bad, free source programs, free programming classes, free java source code, c# programs with output, c# example programs with output, beginning java programming

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

Proje NO: #2258562

Seçilen:

ranjitsinha

Done.

0 gün içinde 15$ USD
(201 Değerlendirme)
5.7