Write a program called inheritancetest java

Assignment Help JAVA Programming
Reference no: EM13765369

Inheritance and Simple GUI :

Program files for each of the following three programs.

1. InheritanceTest
2. DayGui
3. OfficeAreaCalculator

Step 1: InheritanceTest

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.

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.

For the inheritancetest you will need a circle.java file for it to operate correctly

Best College Study.Com

CLICK HERE TO VIEW TUTORIAL

Step 2: Day GUI

Write a program called DayGui.java 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 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:

Step 3: OfficeAreaCalculator

Write a program called OfficeAreaCalculator.java 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 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).

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.

Reference no: EM13765369

Questions Cloud

Case study- marbury v madison : Case Study: Marbury v. Madison, 5 U.S. 137, 1 Cranch 137, 2 L. Ed. 60 (1803), In 1803, the Supreme Court, led by Chief Justice John Marshall, decides the landmark case of William Marbury versus James Madison
Problems based on tombstones : Why YTM differs from coupon rate? What should we compare YTM with?
Revenue recognition-point of sale : Sheena Company sells goods that cost $400,000 to Richie Company for $530,000 on January 2, 2014. The sales price includes an installation fee, which is valued at $50,000. The fair value of the goods is $480,000. The installation is expected to tak..
Component interface for an emergency control room : As the lead software engineer for a medium-sized hospital, you have been asked to spearhead an effort to improve the tracking of Voice Over IP (VOIP) calls made within the hospital system.
Write a program called inheritancetest java : 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.
Revenue recognition-point of sale : Presented below are three revenue recognition situations.
Revenue recognition-point of sale : Explain this type of revenue recognition transaction. What factors should be considered in determining when to recognize revenue in this transaction?
Monopolists are less elastic at all levels of output : In contrast to firms operating in purely competitive industries, demand curves faced by monopolists are less elastic at all levels of output
What elements must be in place for formation of a contract : What elements must be in place for formation of a contract? The Uniform Commercial Code generally regulates commerce or trade on a national basis

Reviews

Write a Review

JAVA Programming Questions & Answers

  Give at least one constructor without any parameter

We learned as popular Set implementation. Write own TreeSet class that implements following interface: You are to give at least one constructor without any parameter.

  Develop a gui based java program

Designing and developing a College Registration program

  Write a method named rowofstars

Write a method named rowOfStars that takes a single integer parameter n and returns a String with that many stars in it.

  Java application which creates bank records

Write down a java application which creates 10000 bank records and the allow user ti enter a balance and customer account info. using a an account number.

  Implement the finite field gf

Write a program called "GF2.java" to implement the finite field GF(p n )where p is a prime number andn is a positive integer.You also need to write four methodsto realize.

  Write java program to reads ten values from user

Write the java program which reads 10 values from user and store them in 1 daimantion array. your program will ask the user wich operation he wants to perform:

  Write a method called alldigitsodds that returns whether

write a method called alldigitsodds that returns whether every digit of a positive integer is odd. return true if the

  Display the values that were typed in to the form

This assignment will focus on creating Java Server Pages (JSP) and deploying them onto a Java Servlet Container.

  Inheritancedemo

Create a New Project named InheritanceDemo . 2. Create a new class called Person and cut and paste the Person.java file from Blackboard into the class. Create a new class called Student and cut and paste the Student.java file from Blackboard into the..

  Create a console-based application named multiplication

Create a console-based application named Multiplication whose main() method asks the user to input and then calls a method named MultiplicationTable(), which displays the results of multiplying the integers by each of the number 2 through 10

  Write an application that displays all even numbers

Write an application that displays all even numbers from 2 to 100 inclusive, and that starts a new line after every multiple of 20 ( 20, 40, 60, and 80). Save the file as EvenNums. java

  One search function

One search function will use a sentinel to mark the end of the array. The other search function will use an array length (maximum legal index into the array) to determine when to exit the search loop. Both functions must return true when the searc..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd