Question: Urgent help needed in java ! Thanx public class AverageCalculator { public static void main(String[] args) { // 1. Create a Scanner instance (called 'scan1')

Urgent help needed in java ! Thanx

public class AverageCalculator {

public static void main(String[] args) {

// 1. Create a Scanner instance (called 'scan1') that allows users to input a single line from the keyboard. hint use scan1.nextLine()

// 2. Convert the input value into an integer type number, reporting an error if it cannot be converted.

// 3. Extend the program so it keeps asking for a value until the user just presses enter without inputting a value. hint: use a while loop

// 4. Within each iteration of the loop keep a running total of the values input by the user. hint: you will need a 'total' variable.

// 5. Once the user quits display the average of the values they have input. hint: you will need to know how many values were input to calculate the average.

}

}

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!