First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).Then create a new Java application called "AverageWithMethods" (without the quotation marks) according to the following guidelines.The program prompts the user for five to ten numbers, all on one line, and separated by spaces. Then the user calculates the average of those numbers, and displays the numbers and their average to the user.The program uses methods to:Get the numbers entered by the userCalculate the average of the numbers entered by the userPrint the results with the whole number, a decimal, and two decimal positionsThe first method should take no arguments and return a String of numbers separated by spaces. [CASE 2]The second method should take a String as its only argument and return a double (the average). [CASE 4] The third method should take a String and a double as arguments but have no return value. [CASE 3]For example, if the user input is... 20 40 60 80 100...the program should give as output... The average of the numbers 20 40 60 80 100 is 60.00.

Question

First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).
Then create a new Java application called "AverageWithMethods" (without the quotation marks) according to the following guidelines.
The program prompts the user for five to ten numbers, all on one line, and separated by spaces. Then the user calculates the average of those numbers, and displays the numbers and their average to the user.
The program uses methods to:
Get the numbers entered by the user
Calculate the average of the numbers entered by the user
Print the results with the whole number, a decimal, and two decimal positions
The first method should take no arguments and return a String of numbers separated by spaces. [CASE 2]
The second method should take a String as its only argument and return a double (the average). [CASE 4]
The third method should take a String and a double as arguments but have no return value. [CASE 3]
For example, if the user input is... 20 40 60 80 100
...the program should give as output... The average of the numbers 20 40 60 80 100 is 60.00.

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Java

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Which of the following diagrams do not contradict the current state of our knowledge about the compl...

A: P class problems can be solved in deterministic polynomial time. NP class can be verified in the pol...

Q: Please Use JAVA to solve the problem

A: Create a java class “ArrayInv” and create a main method inside it.And declare a required variable to...

Q: PLEASE EXPLAIN ALL STEPSCreate a truth table of the equation:((((Y AND (NOT Z)) OR ((NOT Y) AND Z)) ...

A: Note: In the given equation, the number of opening and closing brackets is not equal. The following ...

Q: a. Show that the disk moves made in the classic recursive algorithm for the Towers of Hanoi puzzle c...

A: a.Disk moves for Tower of Hanoi puzzle The disk moves that are made in the classic recursive algorit...

Q: Exercise 3.2.1: Here is a transition table for a DFA 0 1 92 qз *q3 q3 a) Give all the regular expres...

A: Since you have posted multiple questions and have not specified which question needs to be solved, w...

Q: Given a nested list named table, use a loop to print each sub list of the nested list. The sub lists...

A: Program descriptionOne 3 x3 list is created to demonstrate the conceptdisplay the elements of the su...

Q: What role does database technology play in managing data as a business resource within an organizati...

A: Data resource management is applying software tools and information systems technologies such as dat...

Q: Python 3.7.4 Assume that print_todays_date is a function that uses no parameters and returns no valu...

A: A statement that calls (invokes) the function print_todays_date is: print_todays_date()This function...

Q: Arrays Write three statements to print the first three elements of array runTimes. Follow each state...

A: Note: As the user given index value is constant and so the value of index will not be changed while ...

Q: Suppose you have two tables: EMPLOYEE and EMPLOYEE_1. The EMPLOYEE table contains the records for th...

A: To display the output of the given tables by using UNION operator.Two tables are given:First Table n...

Q: In Python Use the Design Recipe to write a function,  print_histogram  that consumes a list of numbe...

A:  Programming Instructions: Define the function print_histogram which takes the list of integers as a...

Q: PLEASE EXPLAIN ALL STEPSDevelop a k-map to simplify the equation (truth table included)

A:  Given boolean expression = xz + (xy + ~z)Now by using given truth table, draw a K-map of 8 cells by...

Q: This program is written in pseudocode."Design a program that asks the user to enter a store's sales ...

A: Create a C++ program and in the "main" method define an array with name "item" and define a macro wi...

Q: This is my function for validating a char value. So far it doesn't accept any value. I need it to ac...

A: A C++ program for validating a char value is as follows,//Declare headre files#include <iostream&...

Q: Please explain how you solve the follwing problem:

A: Since you have posted multiple questions and have not specified which question needs to be solved, w...

Q: Write a Java program that prompts the user to enter a password and checks whether it is valid accord...

A: Create a main() method and a check_pass() to validate whether a password contains 8 characters or no...

Q: Question 3

A: Writing the program code in java as in the given question no programming language is specified.This ...

Q: Siobhan’s laptop has 8GB of RAM. Her operating system takes up 2GB, andher application programs use ...

A: It also depends that whether the graphic card is installed or not otherwise an 8 Gb of RAM itself is...

Q: Submission Instructions Follow the instructions for How to Submit Programming Assignments. Assignmen...

A: the name of the java application is PatternMaker.A string variable firstString is used to store the ...

Q: 4.7: Time Machine Your time machine is capable of going forward in time up to 24 hours. The machine ...

A: Following is the c++ program:Variables used:startHours, startMins are used to store the starting tim...

Q: Consider the window size is 10, bandwidth is 1500 bps, transmission delay is 2 ms atpropagation dela...

A: Given information:

Q: whats is the length of UDP?

A: The given User Datagram Protocol header is 12 03 00 0F 00 1E A3 10.The UDP (User Datagram Protocol) ...

Q: I need help with this problem for C++  If a linear search function is searching for a value that is ...

A: Often called sequential search is linear search. Linear search is a method within an array to check ...

Q: Python 3.7.4: Assume that C is a variable has been assigned a string value. Write an expression whos...

A: Since you have not specified what needs to be done in else part so we have included a print statemen...

Q: program3_3.py in pythonWrite a wholly creative quiz program that consists of three original question...

A: The code consists of three inputs such as int, float and string for wholly creative quiz program. 

Q: Boolean Logic Draw the truth table for the following functions: F(A,B)=AB+(A+B) F(A,B,C)=AB+BC+...

A: Hey, since there are multiple questions posted, we will answer first question. If you want any speci...

Q: How can I fix that Traceback (most recent call last):  File "C:\Users\Richard Seegerer\Documents\Pyt...

A: Here you are trying to open a file name module.txt in reading only format. You are utilizing a relat...

Q: Python 3.7.4 Write the code to call a function whose name is send_number. There is one argument for ...

A: Source Codedef send_number(n):    #getting the value 5 from the function call.  print("The value of ...

Q: Shipping is free for online orders totaling $25 or more at Mississippi.com. Orders less than $25 are...

A: Note: You didn't mention any language so i use Python#get the inputs from the userunit_cost = float(...

Q: in python 2.2Write a program that prompts the user for two inputs: the unit cost of an item and the ...

A: round() function is used to round the number.Syntax of round function:round(number [, ndigit])number...

Q: OF 2019 x + X PG Difference between two given ti https://moodle.oakland.edu/plug X fn Course: CSI-14...

A: Program in C to calculate the order price by entering number of books, price of a book, tax per book...

Q: C++ program   This assignment is about array operations. Create an array with 1000 items and fill it...

A: Create a C++ program and initialize a macro N with value 1000.In the main method declare an array "a...

Q: whats a string

A: String:A string is a data type used in programming, such as an integer and floating point unitThe st...

Q: Write a program that displays the income tax due on taxable income entered by the user. Have the use...

A: The program that displays the income tax due on taxable income is created in java.In calTax() method...

Q: The truth table for a Boolean expression is shown below. Write the Boolean expression in sum-of-prod...

A: Answer:Sum of Product (SOP) form:If the input is 1, then write an AND term for each input combinatio...

Q: (select all that apply) In MS Access, to ensure that a grade must be either A, B, C, D or F, whichva...

A: Validation rule:In MS Access, the validation rule used to ensure the grade that must be either A, B,...

Q: NOTE: in mathematics, the square root of a negative number is not real; in C++ therefore, passing su...

A: A C++ program is to be created  that will read the value for area of square and will print the lengt...

Q: PLEASE EXPLAIN ALL STEPSPredict the output of the following assembly language program if the input i...

A: Before explaining the difference first user must know about the Assembly languageAssembly language:A...

Q: What are some of the key factors that DNS policies that define how a DNS responds to DNS queries? [C...

A: Key factors of Domain Name System (DNS) policiesSome of the key factors of DNS policies that define ...

Q: An administrator has received a call indicating that some users are having difficulty logging on aft...

A: Domain Controller:Domain controller is a server computer on Microsoft servers.The purpose of domain ...

Q: EXPLAIN ALL STEPS: Convert the following assembly language instructions into hexadecimal machine lan...

A: Here user want to do a conversation of assembly language into hexadecimal. So, going ahead our duty ...

Q: Consider partitioning the list {1,4,0,1,1,1,2,3,1,0,4,4,1,2,0,1} where the first element ofthe array...

A: Program description for part (A)The program for part A works by using two new arrays for the left an...

Q: Python   1. Write a for loop (using the range() function) that will print the integers 10,15,20,25,3...

A: Program:#display the statementprint("The integers are: ") #iterate "i" in the range of 10 to 51 with...

Q: This is my code for an MIPS assignment where im taking numbers into an array and reversing within th...

A: Note:For the given code and attached image, the following explanation is briefly described about the...

Q: Identify where magnetic tape is still in use and explain why.

A: Use of Magnetic Tapes:Invented in 1928 for the purpose of sound recording.Reliable data storage sinc...

Q: Write a Java program that prompts the user for the page size used in a virtual memory system; this w...

A: A Java program that accepts a valid system page size and virtual address and calculates the page num...

Q: I need help with this programming exercise:   Write a C++ console application that allows your user ...

A: Program code #1:

Q: Create a program that prompts the user for an amount less than 100 and then displays the minimum num...

A: Program AlgorithmInitialize the required variables.Get the input from the user and check if the inpu...

Q: consider the sender A transmits 12 data packets to b using stop wait protocol. if every 3rd packet i...

A: The all data transmission in send and wait protocol as follows:If packet loss, retransmit packet.Ini...

Q: EXPLAIN ALL STEPS: Determine the output of the following Pep/9 machine language program. The left co...

A: In this question our first duty is to discuss what is pep/9:pep/9:Pep/9 CPU simulator for use with C...