The program prompts the user for five to ten numbers all on one line, separated by spaces, calculates the average of those numbers, and displays the numbers and their average to the user.

The program uses methods to:

1) get the numbers entered by the user all on one line separated by spaces;

2) calculate the average of the numbers entered by the user; and

3) print the results.

The first method should take no arguments and return a String of numbers separated by spaces.

The second method should take a String as its only argument and return a double (the average).

The third method should take a String and a double as arguments but have no return value.

IF user input is: 20 40 60 80 100

Answers

Answer 1

Answer:  

import java.util.Scanner;  

public class AverageDemo

{  

public static String getNumbers()

{

 

 String numbers;  

 Scanner scn = new Scanner(System.in);  

 System.out.println("Enter five to ten numbers all on one line, separated by spaces: ");

 numbers = scn.nextLine();

 return numbers;

}  

public static double calcAverage(String numbers)

{

 String[] values = numbers.split(" ");

 double total = 0;  

 for (int i = 0; i < values.length; i++)

 {

  total += Integer.parseInt(values[i]);

 }  

 if (values.length == 0)

  return 0.0;

 else

  return (total / values.length);

}  

// Method definition of printResults: print the results

public static void printResults(String numbers, double average)

{

 System.out.printf("\nThe average of the numbers %s is %.2f\n", numbers, average);

}  

// main method

public static void main(String[] args)

{

 // Call the methods

 String numbers = getNumbers();

 double average = calcAverage(numbers);

 printResults(numbers, average);

}

}

Output:

The Program Prompts The User For Five To Ten Numbers All On One Line, Separated By Spaces, Calculates

Related Questions

full form of ip ........?​

Answers

internet protocol - hope this helps!

monitor is hard copy output device??
false
true​

Answers

Answer:

false

Explanation:

monitor is an output device but not hard copy. Hard copy is paper


What types of customizations have you or would you make to your operating system, and why?

Answers

Answer:

Explanation:

I have made a couple of customizations to my OS, which is Windows 10. The first being that I activated dark mode, this feature turns the entire OS into a dark-themed color, including apps and menus. This makes using the computer for extended hours much easier on the eyes. The other very important customization I added was a hover taskbar. This allows me to add many important shortcuts to the taskbar which all appear when I hover over the taskbar. It makes my desktop much cleaner and I have quick and easy access to my most important applications.

write a program in python to make the figure:-

*
**
****
********
****************
********************************

The first and correct answer will be marked as brainliest......​

Answers

Answer:

Halo mateeeee

look it will be hard to explain the code and steps to you so just refer this video. .

it will help a lott

( *cries* Serena left Ash In pokemon s19 with a k I s s)

https://youtu.be/rUy_Nq9DHTs

Helpppppppppppppphuhuh

Answers

Answer:

B

Explanation:

You listed this as Computers and Technology where we post coding questions, or hardware related things, but ok.

If there is 7/8 jugs as the starting amount, and they have a 1/2 jug, dividing 0.875 by 0.5 gives the answer of 1.75 or 1 3/4.

Which of these would you use to connect a mouse to a computer?
O RAM
O ROM
O USB
O TOT

Answers

USB is the answer because that is the adapter to plug it in

Plz help help help


What was the first electromechanical digital computer?

For your kind information I would like to tell you that don't search on internet because it will show ENIAC and that is not the answer the answeris may be ABC or MARK I. I am just confused, Please help me

Answers

Explanation:

For your kind information the answer of the question is MARK I.

Answer:

What was the first electromechanical digital computer?

=⟩ Mark I was the first electromechanical digital computer.

Hope it helpful to you

Mary uploaded some images on her website. She chose an image and downloaded it. She found that the image she saw on screen did not seem to have the same DPI as when she had scanned it (she had uploaded a scanned image with 300 DPI). What could be reason with this visual decrease in DPI on the computer screen? (Correct Answer only)

A. Some image resolution was lost while uploading it
B. She downloaded a compressed version of the image.
C. The computer reset the resolution of the image.
D. Her file was probably corrupted while downloading.
E. Computer screens typically display images of only 72 DPI.

Answers

It could be A or B, with a guess that it’s A. Many websites require images to be compressed on uploading so that it takes less of the site’s database storage, but the wording leads me to believe it may be B. Any thoughts?

The reason for this visual decrease in DPI on the computer screen is some image resolution was lost while uploading it. The correct option is A.

What is resolution?

Resolution is the quality of the image that we see in the screen. It is the number of pixels per inch of space. The meaning of PPI is pixel per inch. When a high-resolution picture is seen, it means there are more pixels per inch.

When a picture is downloaded from a site. It does not download in the original pixels because during downloading some pixels are lost due to slow net or the settings of the computer. And a compressed version does not download on its own, and corrupted files do not affect the resolution.

Thus, the correct option is A. Some image resolution was lost while uploading it.

To learn more about resolution, refer to the link:

https://brainly.com/question/15189307

#SPJ5

Which of these is NOT an input device?
O keyboard
O mouse
O blinking light
O microphone

Answers

Blinking light is not one of the awansers

In large organizations, there is a formal business function that includes developing an information policy, planning for data, overseeing logical database design and data dictionary development, and monitoring how information systems specialists and end user groups use data. __________ is responsible for information policy, as well as for data planning, data dictionary development, and monitoring data usage in the firm.

Answers

Answer:

Data administration.

Explanation:

Data management is a type of infrastructure service that avails businesses (companies) the ability to store and manage corporate data while providing capabilities for analyzing these data.

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to effectively and efficiently create, store, modify, retrieve, centralize and manage data or informations in a database. Thus, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

Generally, a database management system (DBMS) acts as an intermediary between the physical data files stored on a computer system and any software application or program.

Hence, a database management system (DBMS) is a system that enables an organization or business firm to centralize data, manage the data efficiently while providing authorized users a significant level of access to the stored data.

Data administration is a strategic process that is typically responsible for establishing information policy, data planning, data dictionary development, and monitoring data usage in the firm.

A computer that supports LoJack technology must have two main components installed. It needs an Application Agent (residing in the OS), which sends tracking signals that enable location and recovery of a stolen device. The other component is a Persistence Module, which restores the Application Agent and allows it to survive reinstallation of an operating system or reformatting of the hard drive. The highest level of security offered by LoJack can be achieved when Persistence Module resides in the:

Answers

Answer: Computer's BIOS

Explanation:

Following the information given in the question, the highest level of security that is offered by LoJack can be achieved when Persistence Module resides in the computer's BIOS.

The BIOS (basic input/output system) refers to the program which the microprocessor of a computer uses in starting the computer system when the computer is powered on. It should also be noted that the BIOS is used in managing the data flow that exist between the operating system of the computer and the attached devices like the keyboard, hard disk, mouse, etc.

Abdullah wants to send sessitive data. Abdullah wants to make sure that only ahmed can see and read this. How can abdullah protect this data, so that ahmed can only access it. By using this information make an algorithm.

Answers

Answer:

Use an encryption algorithm

Explanation:

An encryption algorithm can be used to hide the message from parties in-between or any third parties that might want to intercept the message being sent by Abudullah to Ahmed.

Encryption algorithms use cryptographic methods to encrypt or code data such that only the sender and receiver of that data have the keys to properly decode/decrypt these messages/data.

Programming languages create codes that represent binary numbers so that programmers can write in a language closer to natural speech.

Answers

Answer:

True

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer how to perform a specific task and to solve a particular problem.

This ultimately implies that, programming languages are designed and developed for creating codes that represent binary numbers (0s and 1s), so that programmers or software developers can write in a language closer to natural speech i.e the human language.

describe in detail what each step would look like if you ran into a software error.

Answers

Answer:

First you have to identify the problem.

Second Gather information.

Third iterate through potential solutions.

Fourth Test your solution.

Explanation:

There are many different ways to handle errors in software but this is the way I do it.

Hope this helps :)

After running into a software error, a user needs to first determine the reason for the error, work towards a solution and then execute the solution discovered.

Software Error

A software error occurs when an error or unusual behaviour is observed in a piece of software and which can be reproduced after certain actions are performed that are in line with the stated rules of the software developer. In other words, a software error does not occur if the software was not used as directed by the software developer.

You can learn more about software errors here https://brainly.com/question/18497347

#SPJ6

Which computer can be used where there is no regular electricity?​

Answers

Answer:

A mechanical computer

Explanation:

Created from gears and levers

20 points!!!!! Plz answer quickly

Answers

Answer:

other words are not clear

how are the computer classified into different types​

Answers

Answer:

Computers differ based on their data processing abilities. They are classified according to purpose, data handling and functionality. ... According to data handling, computers are analog, digital or hybrid. Analog computers work on the principle of measuring, in which the measurements obtained are translated into data.

If an angry person called and demanded to speak with the executive you support, who is currently unavailable, how would you handle it?

Answers

Answer: be nice no matter how mean or rude the person is.

Explanation: because if you’re not you can get in big trouble or fired.

Answer:

remain  calm during the conversation

1. Answer the following questions: a. What are the different types of number system? Name them.​

Answers

Answer:

binary,decimal, hexadecimal and octal number system

You are concerned that if a private key is lost, all documents encrypted using your private key will be inaccessible. Which service should you use to solve this problem

Answers

Answer:

Key escrow.

Explanation:

Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.

In Cyber security, encryption is a form of cryptography and typically involves the process of converting or encoding informations in plaintext into a code, known as a ciphertext.

Typically, an information or data that has been encrypted can only be accessed and deciphered by an authorized user.

Hence, if a private key is lost, all documents encrypted using that private key will be inaccessible to the users. Thus, the service that can be used to solve this problem is a key escrow because the cryptographic (private) keys kept in an escrow system are protected and would not be released to anyone other than the original user (owner).

A key escrow can be defined as a data security method of storing very essential cryptographic keys.

Simply stated, key escrow involves a user entrusting his or her cryptographic key to a third party for storage.

As a standard, each cryptographic key stored or kept in an escrow system are directly linked to the respective users and are encrypted in order to prevent breach, theft or unauthorized access.

is computers takes lots of time to do any mathematical calculations.​

Answers

Answer:

I think the answer is a computer take lost of time to do any mathematical calculations because problem in the book or questions.

Hope this helps you ^^

What is the output?
>>> password = "sdf345"
>>> password isalpha()
>>>

Answers

Explanation:

the output password is isalpha()

The CPU is responsible for?

Answers

The CPU (Central Processing Unit) is the part of a computer system that is commonly referred to as the "brains" of a computer. The CPU is also known as the processor or microprocessor. The CPU is responsible for executing a sequence of stored instructions called a program .

why the internet is not policed​

Answers

Answer:

The Internet allows people to circumvent law by committing criminal acts from areas where their activities are not illegal. Those areas will always exist, and thus new regulations will be just as ineffective as the old ones are ["Net Needs Law Enforcement, Author Says,"]. But Internet traffic is marked with IP addresses, and those addresses can be tied to specific networks with specific locations. Shouldn't it be possible to separate traffic based on the originating network and treat data coming from relatively insecure locations differently than data coming from relatively secure locations? It would be much harder for someone in a rogue nation to hack a network if he had to hack an intermediary network first. And unlike government regulation, which has zero impact in areas where these threats are likely to originate, separating traffic by location might actually work

You are in charge of installing a remote access solution for your network. You decide you need a total of four
remote access servers to service all remote clients. Because remote clients might connect to any of the four
servers, you decide that each remote access server must enforce the exact same policies. You anticipate that
the policies will change frequently.
What should you do? (Select two. Each choice is a required part of the solution.)
A. Configure network policies on the RADIUS server.
B. Make each remote access server a member of the RemoteServers group.
C. Configure the exact same network policies on each server.
D. Configure one of the remote access servers as a RADIUS server, and all other servers as RADIUS clients.
E. Use Group Policy to configure network policies in the default Domain Controllers GPO.
F. Configure each remote access server as a domain controller.

Answers

Answer: configure one of the remote access servers as a RADIUS server and all other servers as RADIUS clients

configure network access policies on the RADIUS server

Explanation:

this help me please. ​

Answers

Answer:

1) 1011010

2) 1100100

3) 1010101

4) 23

5) 22

6) 24

Tristen is teaching her history course. She printed off her presentation so the students could take notes. Wyatt is
teaching a science course. He wants to make sure students who do not have PowerPoint can still view the
presentation. Reed is teaching a math course online. He finds the students are very visual and wants to control the
timing per slide
Which best describes how each teacher handled their presentations?
O Tristen created handouts, Wyatt saved as a PDF, and Reed saved as a video
O Tristen created a video, Wyatt saved as a PDF, and Reed broadcasted.
O Tristen created handouts, Wyatt saved as a video, and Reed saved as a PDF.
O Tristen created a video, Wyatt broadcasted, and Reed saved as a video

Answers

Since Tristen want her students to take notes on her presentations, she should have some sort of handout.

Because Wyatt, wants to ensure that students who do not have PowerPoint can still view his presentations, converting it into a pdf is best.

Since Reed's students are very visual, converting his slides into a video will make it better for students who want to spend some time assessing some of the graphs or equations.

Thus, A is the best choice.

A logistics company's vulnerability scan identifies the following vulnerabilities on Internet-facing devices in
the DMZ: SQL injection on an infrequently used web server that provides files to vendors SSL/TLS not used for a website that contains promotional information
The scan also shows the following vulnerabilities on internal resources: Microsoft Office Remote Code Execution on test server for a human resources system
TLS downgrade vulnerability on a server in a development network In order of risk, which of the following should be patched FIRST?
A. Microsoft Office Remote Code Execution
B. SQL injection
C. SSL/TLS not used
D. TLS downgrade

Answers

Answer:

A. Microsoft Office Remote Code Execution

Explanation:

From the given options, we have;

The web server having a SQL injection is infrequently use

The information on the website having SSL/TLS not used is promotional

The location of the server having  a TLS downgrade is on a development network

The location of the Microsoft Office Remote Code Execution is on a human resource system test server

Therefore, given that the test server, is the deployment source of the main server, and that with a Remote Code Execution, RCE,  cyber attack, the attacker is able to make commands work on other computers, the RCE attack on the test server is a potential access of an attack on the main servers, and should be patched first.

write a c program to display the series: 1,8,27,64,125​

Answers

num_list = [1, 8, 27, 64, 125]

for x in range ( len( num_list) ) :

print (num_list[x])

You have been asked to help a small office with a limited budget set up and configure a Windows network. There are only five computers in this office. In addition to the ability to share network resources, security is a top priority.
Which of the following is the BEST course of action in this situation?
A. Install a HomeGroup to provide a single login and simplify security and sharing.
B. Install a WorkGroup to provide a single login and simplify security and sharing.
C. Install a WorkGroup to allow each device to control what is shared and with whom.
D. Install a HomeGroup to allow each computer to control which items are shared and who can access them.

Answers

Answer:

I will choose a option tin best

Answer: Install a WorkGroup to allow each device to control what is shared and with whom.

Explanation:

Other Questions
Employees earn vacation pay at a rate of one day per month. The company estimated and must expense $1,500 of accrued vacation benefits for the year. Which of the following is the necessary year-end adjusting entry to record accrued vacation benefits? a) Debit Vacation Benefits Expense $1,500; credit Prepaid Vacation $1,500. b) Debit Vacation Benefits Expense $1,500; credit Vacation Benefits Payable $1,500. c) Debit Payroll Tax Expense $1,500: credit Payroll Taxes Payable $1.500. d) Debit Prepaid Vacation Benefits $1,500; credit Vacation Benefits Payable $1,500 Find the length of the missing side. triangle with an 8 inch side and 12 inch side with a right angle 8.9 in. 104 in. 4 in 14.4 in quatrainfree versecoupletmeterprosodyblank versespeakerenjambment Anthony steps on a bathroom scale that records his weight at 195 pounds. He immediately steps back onto the same scale, which records his weight at 205 pounds. It is MOST accurate to describe these scales as: How does the natural process of meiosis support evolution?A. Each daughter cell mutates its own DNA during Reduction Division to produce more variation.B. Each daughter cell is unique, providing natural variation.C. Each daughter cell is identical, providing natural variation.D. It does not support evolution. Explain the significance of the ATOM BOMB during WW2 (8 marks) somone please help me with this Cul de los siguientes niveles es el sucesor del nivel tejido?A.rgano.B.Sistema.C.Organismo.D.Clula. Engineers are designing a large elevator that will accommodate 44 people. The maximum weight the elevator can hold safely is 8228 pounds. According to the National Health Statistics Reports, the weights of adult U.S. men have mean 186 pounds and standard deviation 60 pounds, and the weights of adult U.S. women have mean 157 pounds and standard deviation 69 pounds.a. If 44 people are on the elevator, and their total weight is 8228 pounds, what is their average weight?b. If a random sample of 44 adult men ride the elevator, what is the probability that the maximum safe weight will be exceeded?c. If a random sample of 44 adult women ride the elevator, what is the probability that the maximum safe weight will be exceeded? Hacer una obra teatral con los tres cerditos y el zorro Which of the following about a balanced chemical reactions isNOT true?O A properly written chemical equation will include the states of matterfor every substance in the reaction.O The number of atoms of each element must be the same for bothreactants and products.A balanced chemical equation must follow the Law of Conservationof MatterA balanced chemical equation must always include coefficients onevery reactant and product. 4|x+3| -5(n+9)=7. Find n. Which point gives the y-intercept of (x) = x2 + 4x 3? - Books play a very important part in your life. - It's true that every family has books. - We can see books every where. - We can learn many things from books. - Books help us in self-education and deciding problems in life. - Today, there are a lot of public libraries in our country and all people have the right to use them. - Each year hundreds of new books for children appear in Viet Nam. - The books are very interesting and children like reading them very much. I need help. You are interested in finding a 95% confidence interval for the average commute that non-residential students have to their college. The data below show the number of commute miles for 12 randomly selected non-residential college students. Round answers to 3 decimal places where possible. The graph below shows a company's profit f(x), in dollars, depending on the price of pencils x, in dollars, sold by the company.Part A: What do the x-intercepts and maximum value of the graph represent? What are the intervals where the function is increasing and decreasing, and what do they represent about the sale and profit? (4 points)Part B: What is an approximate average rate of change of the graph from x = 2 to x = 5, and what does this rate represent? (3 points)Part C: Describe the constraints of the domain. (3 points) Matthew Travels 42/50 Meters In 26/30 Minutes. Find The Speed of Mathew In Meters Per Second. Which law allows an artist the right to prevent his or her work from being subject to derogatory treatment?A. the Code of Federal RegulationsB. the First AmendmentC. the Resale ActD. the Visual Artists Rights Act What is the theme of Cell phone Sides? What was the major goal of the political reforms enacted during the Progressive Era (1900-1920)?1.expanding citizen participation in government2.lowering the legal voting age3.discouraging the formation of new political parties4.providing public funding of campaigns