EDIT: Oops, this became a wall of text...
FYI, the [ code ] and [ /code ] (without spaces inside the brackets) are what I used above to keep formatting. It works better with spaces than tabs for indentation.
As for the code, I would have combined the double variable declarations with the initialisations. You should declare variables as close as possible to where you use them (and at the same time if possible). ie.
System.out.println ("Please enter 3 numbers representing the length of each side of the triangle to be formed" );
double side1 = scan.nextDouble();
double side2 = scan.nextDouble();
double side3 = scan.nextDouble();
double perimeter = side1 + side2 + side3;
It's not important for assignments because you write them and then throw them away, but it's good programming practice nonetheless. The main reason for doing this is that it helps prevent "dead" code as the program goes through changes. If I declare a variable on line 323 and don't use it until, say, line 335, someone may later change the code around line 335 and remove the need for the variable but not remove the declaration. In that instance there's a small amount of wasted memory set aside for something that is never used.
Secondly, I'd have removed the comments. I'm guessing that your professor wants them there as it seems to be a professor thing to do, but they really serve little purpose in most cases as long as the code is good. For example, let's look at your first comment (excluding the class description), which covers the code above:
"Reads input data from the user to get side values, and based on those calculates potential perimeter."
The first line that prints to the console and the 4 variable assignments make it pretty obvious that it does exactly that (which is a good thing!), so the comment is redundant. I've seen worse though, such as something similar to this in
production code related to insurance:
double excess; // the excess
Really?
Now the real problem with comments is threefold:
1. They can be flat out wrong from the start. I have seen comments which describe the opposite of what the code does. Not helpful at all...
2. They may have been correct for the original code, but often get left unchanged when the code evolves. Therefore they become a point of confusion rather than helpful.
3. If you need comments to describe
what your code does, then you've written it badly and should do it again. A programmer with even a small amount of experience should be able to work it out within a reasonable amount of time. Don't write magic code that somehow works but which everybody is afraid to touch for fear of breaking it.
The only time comments are really helpful is if it's difficult to express in code
why you've written it the way you have, even to an experienced programmer. This might happen if your program interacts with unreliable third party services that do quirky things which require special error handling in unexpected places. Even in that case,
how error handling works should still be clear.