CS 112: Lab 1, Task 1
/*
* Lab 1 - Debugging Exercise
*
* This is the corrected version.
* Changes are highlighted in red.
*/
// Note that the class name must match the filename.
public class Debugging {
public static void main(String[] args) {
/*
* The following code segment is intended to calculate
* the area of a triangle.
*/
double base = 3.5;
int height = 2;
System.out.println("Running Debugging.java");
// Note: we needed to remove the parens to get
// the correct order of operations.
double area = height*base/2;
System.out.println("Area is: " + area);
} // closing brace for main
} // Debugging