Create a new child class to model an equilateral triangle

Assignment Help JAVA Programming
Reference no: EM131290647

Assignment

In this assignment you will create a new child class and new driver program. Please review that example before continuing with this assignment. You should fully understand the shape program above.

You are to create a new child class to model an equilateral triangle. An equilateral triangle is a triangle where the length of all three sides is the same.

Like all shapes, our equilateral triangle will have a color and name. Specific to the equilateral triangle will be the length of its side (remember all three sides are of the same length).

Using the shape class above as a parent write a child class called EquilateralTriangle that contains:

An attribute of side length

Methods that set and get the side length

A method to compute the perimeter of the triangle ( 3 * side)

A method to compute the area of the triangle. The formula is as follows:

Area = side2 * √(3 )/4

A toString method to return a string containing all information stored about the triangle

An appropriate constructor

Be sure to extend the Shape class so that the new child class can inherit all the attributes and methods contained in Shape

In another file create a driver program that will create two equilateral triangle objects, print the attributes of those objects (invoke the toString methods) and then print both the area and perimeter of those objects.

Please name your programs "FirstnameLastnameProgram1.java" and "EquilateralTriangle.java"

Reference no: EM131290647

Questions Cloud

Find the value of f and k on a break forward contract : Consider a stock priced at 100 with a volatility of 25 percent. The continuously compounded riskfree rate is 5 percent. Answer the following questions about various options, all of which have an original maturity of one year.
Gain support for risk management activities : Why is it important to gain support for risk management activities? What methods can you use to get this support?
Business problem or challenge at beginning of report : Choose 2-3 of the following items, and respond with one paragraph for each. 1. Explain the significance of stating the business problem or challenge at the beginning of a report.
Determine a fair price for a two-year assetor-nothing option : A stock is priced at 125.37, the continuously compounded risk-free rate is 4.4 percent, and the volatility is 21 percent. There are no dividends
Create a new child class to model an equilateral triangle : You are to create a new child class to model an equilateral triangle. An equilateral triangle is a triangle where the length of all three sides is the same.
Write a summary of the life-importance of one key person : Write a paper that includes the following:A summary of the life and importance of one key person in Jewish history,An explanation of one key event in the history of Judaism that is connected to that person,A description of any rituals, symbols, or sa..
Determining the strategy implementation : Please talk about the planning paradigm and the anti-plan paradigm. Discuss how you see those two approaches. How do they fit together? Have you seen companies be effective in changing and adjusting plans? 200-300 WORDS
Explain the risk characteristics of io and po strips : Using your answer in a, determine the value of both IO and PO strips with a discount rate of 10 percent under the assumption that the mortgage will not be prepaid.
Write an description paragragh about disneyland : You need to write an description paragragh which is about "disneyland" only one or two pages - As soon as posible

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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