Slide 30
Slide 30 text
jgs
Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 31
2. Code
• Add this class:
public class Main {
public static void main(String args[]) {
hypothenuse(10, 20);
}
public static double hypothenuse(double a, double b) {
return Math.sqrt(Math.pow(a,2) + Math.pow(b,2));
}
}
• It should be in src/main/java
folder.
• Check your Maven