Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions