Question: Somebody know how to summarize the error's names? Look at each of the descriptions below and identify the type of programming error . Note that

Somebody know how to summarize the error's names?

Look at each of the descriptions below and identify the type of programming error. Note that more than one of these descriptions may be caused by the same type of programming error.

2 points: You calculate the average of a list of grades with the expression:

average = sum / size; // assume average is double and sum & size are ints

However, average is always a whole number because sum and size are both integers.

What kind of error is this?

2 points: You forget to put an ending double quote in a System.out.println() statement:

System.out.println("Hello there! );

What kind of error is this?

2 points: You write a loop to that counts down to zero but sometimes it runs forever:

int number = input.nextInt();

int sum = 0;

System.out.println("Countdown to zero!");

while (number != 0)

{

System.out.print(number + " ");

sum += number;

number--;

}

System.out.println();

System.out.println("The sum of the numbers is: " + sum);

What will cause the loop to run forever? What kind of error is this?

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!