Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Java Expert


Home >> Java

problem 1) Design the class named Triangle which extends GeometricObject. The class contains:

a) Three double data fields named side1, side2, and side3 with default values 1.0 to denote three sides of triangle.

b) A no-arg constructor which creates the default triangle.

c) A constructor which creates the triangle with specified side1, side2, and side3.

d) The accessor methods for all three data fields.

e) A method named getArea() which returns area of this triangle.

f) A method named getPerimeter()which returns a perimeter of this triangle.

g) A method named toString()which returns the string description for the triangle.

The toString() method is implemented as follows:

return"Triangle: side1 = " + side1 + " side2 = " + side2 +" side3 = " + side3;

Draw UML diagram which involves the classes Triangle and GeometricObject. Implement the class. prepare the test program which creates a Triangle object with sides 1, 1.5, 1, color yellow and filled true, and displays area, perimeter, color, and whether filled or not. prepare all three classes in three separated files: FirstInitialLastNameProject4.java, GeometricObject.java, and Triangle.java.

Java, Programming

  • Category:- Java
  • Reference No.:- M94688

Have any Question? 


Related Questions in Java

Write a java application using netbeans integrated

Write a Java application using NetBeans Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors: • A salesperson will earn a fixed salary of ...

Java programthis assignment will count as both homework and

Java Program This assignment will count as both homework and lab. Develop a program that will allow the user to display the starting line and the bench for a basketball team. The user will also have the option of swappin ...

Write a java program that prints asks the user to enter a

Write a Java program that prints asks the user to enter a positive value (1 less than or equal to 200) and print each number up to that line, 1 per line with the following changes (SNAP CRACKLE POP). • If a number is *** ...

Casegreentek is a software solution company for smartphone

Case Greentek is a software solution company for smartphone and tablet devices. Current headquarter (HQ) locates in Sydney, 30 sale team members and 50 software engineers base in Singapore and Manila respective. The cycl ...

Create a separate class for the selected product that holds

Create a separate class for the selected product that holds the item number, the name of the product, the department in which the product belongs, the number of units in stock, and the price of each unit. You must use th ...

Read the article titled teaching software componentization

Read the article titled, "Teaching software componentization: A bar chart Java bean". Write a two to four page paper in which you: 1. Summarize the main points of the article. 2. Describe one way in which one could apply ...

Java program 1write a java application that generates a

Java Program 1 Write a Java application that generates a 3-digit random number 100 times. Display the output for each of the generated numbers and the sum of all 100 numbers. Demonstrate your code compiles and runs witho ...

Javapizzacontactlistat the beginning of all your programs

JavaPizza ContactList At the beginning of all your programs, put a comment box that includes the program name, your name, and a brief description of the program. Example: /************************************************ ...

Develop a console program for java on microsoft notepad

Develop a console program for JAVA on Microsoft notepad that simulates a section of a restaurant menu. Each item will have a different price and your program should define at least ten items. You will need to obtain an o ...

Assignment 1overviewthis is an individual assignment that

Assignment 1 Overview This is an individual assignment that requires you to design, develop and test a small procedural Java program. Timelines and Expectations Learning Outcomes Assessed The following course learning ou ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro