Question: //This class contains a number of syntax and semantic errors. //Your job is to find them all. public class DebugMe{ public static void main(String args[]){

//This class contains a number of syntax and semantic errors. //Your job is to find them all.

public class DebugMe{

public static void main(String args[]){

printSums(args); compareBoxes(); }

//This function is designed to print the sums of all numbers between 1 and the //first number entered as an argument to DebugMe //For example, if you enter: DebugMe 3 //You should get: // The sum of the first 1 numbers is 1. // The sum of the first 2 numbers is 3. // The sum of the first 3 numbers is 6.

public static void printSums(String[] args){ int count; count = Integer.parseInt(args); for (i = 1 ; i <= count ; i++); { int sum = 0; int i = 0; sum += i - 1; System.out.println("The sum of the first " + i + " numbers is " + sum + "."); } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!