Design a class named triangle to represent a triangle
Course:- JAVA Programming
Reference No.:- EM131599417

Assignment Help
Assignment Help >> JAVA Programming

1 Classes and Objects
Build the specified Classes.

Triangle Class
Design a class named Triangle to represent a Triangle. The class should contain:

- Three double data fields named S1, S2 , and S3 that specify the three sides of the triangle.
- A static data field which counts the number of triangles created.
- A constructor which creates the triangle.
- The accessor and mutator methods for all data fields.
- A getArea method.
- A getPerimeter method.
- A getHeight method.
- A isEquilateral method.

Stock Class
Design a class named Stock to represent a trading equity. The class should contain:
- A String data field named symbol which contains the Stock's 3-letter symbol.
- A String data field named name which contains the name of the company associ- ated with the Stock.
- A double data field named previous which contains the Stock's previous closing price.
- A double data field named current which contains the Stock's current price.
- A constructor which creates the Stock utilizing the symbol and name only.
- The accessor and mutator methods for all data fields.
- A method that returns the percent of change from the previous price and the current price.

Put your comment

Ask Question & Get Answers from Experts
Browse some more (JAVA Programming) Materials
Provide Java code to create and initialize an array of integers (Java primitive int), floats or any other Java primitive type of your choice. You pick the array name and leng
You will write a Maze data type that can read in .maze files, and print their out in the same format. A graph can represent a maze and there are many different ways to repre
Create an application that keeps tracks of the information in such a simple social network. More specifically, your application will allow for user profiles to be added to,
Write a program in java that asks the user for values of x and y, and displays the point as an ordered pair along with a message that describes where that point falls on the s
Develop a Java applet that will help an elementary school student learn multiplication. Use the Math.random method or a Random object to produce two positive one-digit in
write a java program that continues to prompt the user to input a real number. if the number is positive, the program calculates and outputs the area of circle using the inp
Write a statement that creates and initializes a static variable named salesTax to 7.59. Write a statement that creates a constant variable named TAX_RATE. The tax rate is 8.2
The char will be a single character and indicate what character you should use to create your output figure. You will write a program that reads from one file, interprets what