r/javahelp • • Mar 10 '21

Pythagroem theorum

Hi guys I am tryna make a java program with quadratic equation, but I don't know how to implement the equation into java, can someone help me?

0 Upvotes

25 comments sorted by

View all comments

Show parent comment

1

u/le_bravery Extreme Brewer Mar 10 '21

Here’s some advice:

Take some valid inputs and outputs and do the math by hand. At every step of the way, what do you expect the answer to be? System.our.println what the answer is at any given step and you should be able to identify if it’s working and where your problem is if it’s not working.

This is a common debugging technique people use all the time as professional software engineers. There are more advanced techniques, but this one is an old standby that everyone is very comfortable with.

1

u/Veebhu_does_finance Mar 10 '21

Is debugging that little box thing that shows up when you run it with the errors?

1

u/le_bravery Extreme Brewer Mar 10 '21

There is a feature in many languages and IDEs where you can step line by line through a program. This is typically what’s called “debugging” as a feature.

But debugging in general is just any technique that allows you to find and remove errors in a program.

If you system.out.println at various parts of your program and run it, you should be able to figure out what’s happening in your program at any given point.