By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,541 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,541 IT Pros & Developers. It's quick & easy.

Java beginner needs help

P: 3
i'm new to java an have an assignment. i need to write a program that will calculate the sides of a triangle using x and y coordinates.also, it should provide the area, perimeter and lengths of the sides of the triangle as well as the angle in degrees. It's a monster to a beginner. we went from "Hello World" to this. please help!

mac010904@yahoo.com
Jan 26 '07 #1
Share this Question
Share on Google+
5 Replies


10K+
P: 13,264
i'm new to java an have an assignment. i need to write a program that will calculate the sides of a triangle using x and y coordinates.also, it should provide the area, perimeter and lengths of the sides of the triangle as well as the angle in degrees. It's a monster to a beginner. we went from "Hello World" to this. please help!

mac010904@yahoo.com
Deterimine the following first.
What is the input to the program? Three x,y co-orninates? Two co-ordinates and their angle? Any one of the two? Then deterimine what you want as output. This is the process of specifying what the program will do and makes the rest of the program easier to code.
Jan 26 '07 #2

P: 3
The program must prompt for user input of the co-ordinates. how would i prompt for this? would i do one at at time or is there a way to prompt for both?
Jan 26 '07 #3

10K+
P: 13,264
The program must prompt for user input of the co-ordinates. how would i prompt for this? would i do one at at time or is there a way to prompt for both?
You can use either way, Java can do both. It's up to you the programmer to decide which way would be easier for the users.
Jan 26 '07 #4

P: 3
could you give an example of what you mean. I can do the rest of the program it's just this part that has me confused.
Jan 26 '07 #5

10K+
P: 13,264
could you give an example of what you mean. I can do the rest of the program it's just this part that has me confused.
Have a read about how to use the Scanner.
Jan 29 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.