Question: JAVA 1) - Write the following program with NetBeans IDE, compile/run and verify is it correct? 2) - Move the sub program compute average (line

JAVA

1) - Write the following program with NetBeans IDE, compile/run and verify is it correct?

2) - Move the sub program compute average (line 8 to 21) to a method name it setAverage(int Ntest) and call it from main program of class projPart1, compile/run and verify. Submit your work.

( I cannot seem to get the METHOD to read into the program) PLEASE HELP?

import java.util.Scanner;

public class Project1

{ public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); System.out.print("Enter number of test :"); int Ntest = keyboard.nextInt(), score = 0 , i, sum = 0; setAverage=(Ntest); }

static void setAverage(int Nest) { avg = sum/i; double avg = 0; for (i = 0; i= 0 && score <= 100) sum += score; else{ System.out.print(" The number should be between 0 and 100 "); i --; } } System.out.println("Average of " + Ntest+ " is " + avg);

} }

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!