# Solve the missing information of a triangle

• February 19th, 2013, 09:06 PM
kevinsauerzxc
Solve the missing information of a triangle
Hello everyone, I'm taking an introductory programming class right now and having a problem with one assignment.

We were asked to write a program that would solve for the missing information on:part a) an oblique triangle ; part b) a right triangle
given that the user will input 3 informations (side or angle)
I'm having a problem of how to start off this program
How do I create a user input that will allow me to let the user to enter in 3 informations and this is important : if they don't enter in 3 informations, I'm suppose to tell them that extra information is needed.

Also, for the process, should I use nested loops? for loops? while loops, if statement or switch statement?

Thank you.
• February 19th, 2013, 09:14 PM
curmudgeon
Re: Solve the missing information of a triangle

Try whatever you think might work, experiment with different approaches, then modify your code, play with your code, go hog wild with your code. You can't break anything by doing this and will have much to gain.
• February 19th, 2013, 09:16 PM
kevinsauerzxc
Re: Solve the missing information of a triangle
Is it possible if you could provide me a hint?
• February 20th, 2013, 08:17 AM
Kisiara
Re: Solve the missing information of a triangle
When I was starting, I used to bombard forums with such questions because this things really looked hard. And I always got the same reply...."get a book", "research", "try out and note down your mistakes". "Do what you think will work and not what you hope will work". "Dont make a mistake that is obviously a mistake". And now I can help you code this thing in 5 minutes. but I wont coz that will be unfair to you as you wont learn. but ill give you a hint that I was given about a year ago when I started programming that drove me nuts but made me want to learn more.

class GetABook
{
//get a book and input whatever practices you learn here
}

im not brushing you off and I know it sucks not getting a response you had hoped for but one year down the line, maybe you will appreciate this as well. Oh and when you have some code, just throw it in here and trust me, help will come flooding to you.
• February 20th, 2013, 11:02 AM
curmudgeon
Re: Solve the missing information of a triangle
I would recommend that you first write out the typical interactions that you want your program to have with the user including how the interaction would look if the user entered inadequate information, then use this script to help you write out pseudo-code a basic structure for your program. Only then write out the Java. The key here being you need to first understand your problem before you can even consider the code.