Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Micro Micro Gc prog (436) class GWrite Lear G %20T222%20-%20Assessment%20Brief%202%20(6).pdf 2/2 - - 59% +| 4. Debugging (10 Marks) See the program below, which

image text in transcribed

Micro Micro Gc prog (436) class GWrite Lear G %20T222%20-%20Assessment%20Brief%202%20(6).pdf 2/2 - - 59% +| 4. Debugging (10 Marks) See the program below, which has syntax and/or logic errors. In each case, determine the problem and fix the errors. 1 Program: Public class Average { public static void main(String() Args) { Scanner input = new scanner(System.in); System.out.println("Enter a list of nonnegative scores.); System.out.println("Mark the end with a negative number.") System.out.println("I will compute their average."); double next, sum; int count = 0; next=input.nextDouble(); while(next >= 0) { } sum = sum + next; count+; next = keyboard.nextDouble(); if (count == 0) System.out.println("No scores entered."); else { double average = sum/count; system.out.println(count + " scores read."); System.out.println("The average is " + average); } } } tv N MacBook Air D l A W

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions