This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes triangle application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "triangle application" Watch "triangle application" New topic
Author

triangle application

Patricia Stewart
Greenhorn

Joined: Feb 25, 2009
Posts: 1
Hey! can somebody help me doing this please? i will really appreciate it!

Write an application that reads the lengths of the sides of a triangle from the user. Compute the area of the triangle using Heron's formula (below), in which s represents half of the perimeter of the triangle, and a, b, and c represent the lengths of the three sides.

Area = sqrt(s * (s - a) * (s - b) * (s - c))
amitabh mehra
Ranch Hand

Joined: Dec 05, 2006
Posts: 98
Do your own homework
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Welcome to JavaRanch.

The philosophy of JavaRanch is that we help you to learn Java, but you don't learn Java if someone else would just do your homework for you. So, please show some effort - what have you tried yourself, and where do you get stuck.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 917

I wont tell you the code, but here is how you can do it

1. accept the parameters from the user: use BufferedReader
2. calculate s
3. use square root function in the math package.

it simple, you should not run into problems.


My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: triangle application
 
Similar Threads
Using heron's formula to calculate the area of a triangle
Program: calculates distance between 2 points on 2d plane
if statement problem
(new to java)variables might not have been initialized
Almost equilateral triangle