Statistics are often calculated with varying amounts of data stored in a file. Write a program that takes any number of non-negative integers as input, and outputs the average, min and max. Prompt user for the input file name, open the file, read and process the numbers in the file.

Answers

Answer 1

Following are the program explanation, program, and output to the given question:

Program Explanation:

Import package.Defining a class Main.Defining the main method.Defining a string variable "str" and define a Scanner class object to input the"str" value.After input, the string value of a Scanner class object is created that takes the "str"  value in the parameter.In the next step, the "ArrayList" class object is declared that uses a while loop to add value to the list.In the condition statement an if block is defined that check ArrayList value equal to 0, and print the message.In the else block, a float variable "sum" and three integer variable "ctr, min, and max " is declared that check its value and prints its value with the message.

Program:

import java.io.*;//import package

import java.util.*;//import package    

public class Statistics //defining a class Statistics

{

  public static void main (String[] asx)//defining main method  

  {

       String str;//defining a string variable str

       Scanner sob= new Scanner(System.in);//defining Scanner class object to input value

       System.out.println("Enter value: ");//print message

       str= sob.nextLine();//input value

       Scanner s = new Scanner(str);//using Scanner class to take value str in parameter

       List<Integer> val = new ArrayList<Integer>();//defining an ArrayList class

       while(s.hasNextInt())//defining a while loop in add value

       {

           val.add(s.nextInt());//using add method to add value

       }

       if(val.size() == 0)//defining if block that check ArrayList value equal to 0

           System.out.println("The File is empty");//print message

       else//else block

       {

           float sum = 0;//defining float variable

           int ctr = 0, max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;//defining integer variable that hold value

           for(Integer a:val)//defining a for loop that check ArrayList

           {

               ctr = ctr + 1;//adding value in ctr variable

               sum = sum + a;//adding value sum variable

           if(min > a)//use if to check min value greater than a

               min = a;//holding value in min

           if(max < a)//use if to check max value less than a

               max = a;//holding value in max

           }

               System.out.print("Average = ");//print message

               System.out.println(sum/ctr);//print average value

               System.out.print("Minimum value = ");//print message

               System.out.println(min);//print min value

               System.out.print("Maximum value = ");//print message

               System.out.println(max);//print max value

       }

  }

}

Output:

Please find the attached file.

Learn more:

brainly.com/question/15410214

Statistics Are Often Calculated With Varying Amounts Of Data Stored In A File. Write A Program That Takes

Related Questions

10. Why antivirus is needed to be installed in computer system?

Answers

Antivirus is the software that protects ur computer from viruses.viruses slow down ur computer it hangs ur computer so to prevent this kind of sorts we need to download antivirus

Question: 5
In 2014, what percentage of the world population has access to the Internet?
Less than 30%
Less than 50%
Over 50%
Over 80%
Please help

Answers

The answer would be less than 50

In 2014, less than 50% percentage of the world population has access to the Internet option (B) less than 50% is correct.

What is a computer?

A computer is a digital electronic appliance that may be programmed to automatically perform a series of logical or mathematical operations. Programs are generic sequences of operations that can be carried out by modern computers. These apps give computers the capacity to carry out a broad range of tasks.

As we know,

Internet, a system design that allows different computer networks all over the world to communicate, has transformed communications and methods of commerce.

Thus, in 2014, less than 50% percentage of the world population has access to the Internet option (B) less than 50% is correct.

Learn more about computers here:

https://brainly.com/question/21080395

#SPJ2

What is low, high and machine level language​

Answers

Answer:

A high-level language is one that is user-oriented in that it has been designed to make it straightforward for a programmer to convert an algorithm into program code. A low-level language is machine-oriented. Low-level programs are expressed in terms of the machine operations that must be performed to carry out a task. In easy words high level languages are near to human beings and far from computer and low level languages are near to computers and far from human understandings.

Explanation:

Hope it Helps

HAPPY TO HELP

PLZ MARK AS BRAINLIEST

Attackers have taken over a site commonly used by an enterprise's leadership team to order new raw materials. The site is also visited by leadership at several other enterprises, so taking this site will allow for attacks on many organizations. Which type of malicious activity is this?

Answers

A rootkit is a malware-style terminology designed to infect an attacker's target PC and allow them to install many tools that use him for persistent wireless connectivity to the system.

It is an illegal computer program to enable continuous privileged access to a computer and hide its presence actively. In today's life, it often conceals their existence and actions from uses and other functionality of the system, especially spyware - for instance, trojans, worms, viruses.

That's why the rootkit is employed since it is developed in this case to access Victin's system at an administrator level.

Learn more:

brainly.com/question/3624293

Which of these skills are Transferable Skills?
Question 2 options:

installing a corporate network

solving problems

critical thinking

building positive relationships

creating a spreadsheet

Which of these skills are Technical Skills?
Question 1 options:

Writing code

solving problems

critical thinking

replacing a hard drive

great communicator

Answers

The abilities you utilize in any work, whether it is in the title or the sector, are just how transferable they sound.

Some talents transferable are "hard," such as coding or data analysis is "soft," such as communication skills and relationship development.It allows you to interact more effectively with employees, managers, and customers. These competencies may foster stronger professional partnerships, which can lead to chances for career development and leadership.

So, the final answer is "Solving problems,  critical thinking,  building positive relationships,  and creating a spreadsheet (that is part of Computer Skills)".  

Learn more:

brainly.com/question/20799425

What are some of the innovations that colored television has undergone since its original invention? (include the date of the innovation)

Answers

Answer:

Color television was sold to viewers as a way to experience everything from sports and nature to musical theater in a more legible, realistic, captivating, and sensational way.

Explanation:

E commerce is the demand of modern society both for time and money

Answers

Answer:

Electronic commerce draws on technologies such as mobile commerce, electronic funds transfer, supply chain management, Internet marketing, ...

Answer:

is the activity of electronically buying or selling of products on online services or over the internet

7. In order to check your following distance, use a fixed object and count seconds.
True
False

Answers

Answer:

False

Explanation:

It is true that distance can be checked by counting seconds from a fixed object

How to determine the true statement?

The given highlights are:

Using a fixed objectCounting seconds

When seconds from a fixed object (such as a pole) are counted, the quantity that is being measured is time.

The time recorded can be used along the average speed to determine the distance traveled.

Hence, the given statement is true

Read more about distance and time at

https://brainly.com/question/4931057

#SPJ2

Www requires a tool called a

Answers

Answer:

The World Wide Web (WWW) requires a tool (software) called a HTTP. The full form of HTTP is Hypertext Transfer Protocol.0. It is a type of internet communication software that is needed for the publication of the website or www

Explanation:

In what ways are computers being used to improve our quality of life

Answers

Explanation:

makes info easy to get

improves communication

enhances education

etc

plsss mark me brainliesttt

where do I go to ask help from a tech and internet expert. security and protection. I'm open to suggestions and guesses​

Answers

Answer:

from my own experience, the best place to call is your local Best Buy store. they have a group of technicians called the Geek Squad, and you can either call them for tech support or protection suggestions, or have them do maintenance on a device (both in store and at home)

does The operating system assigns the file, name and location inside

Answers

Answer:

The operating system assigns the file its name, location, and size. When you add information to a word-processing document, one of the roles that your operating system plays is that is saves your unsaved work to temporary storage.

Explanation:

The operating system is designed and developed to assign the file, its name, size and location.

What is an operating system?

An operating system (OS) can be defined as a system software that is pre-installed on a computing device, so as to manage random access memory (RAM), software applications, computer hardware and all user processes.

In computer technology, the operating system is designed and developed to assign the file, its name, size and location.

Read more on software here: https://brainly.com/question/26324021

#SPJ2

Fill in the blank with the correct response.
A _
is an unknown network.

Answers

Answer:

ip address

Explanation:

please mark brainliest

give ways in which fire can be prevented in a computer lab​

Answers

Answer:

don't try to run a sketchy game that plays in 4k on a computer and monitor that can only generate 1280p.

Explanation:

yes. I made that mistake once.

Which model of communication focuses on the meaning that emerges in a relationship between communicators?
a. Transactional
b. Symbolic
c. Complementary
d. Linear

Answers

Answer:

QUESTION

Which model of communication focuses on the meaning that emerges in a relationship between communicators?

[tex]==============================================

[/tex]

CHOICES

a. Transactional

b. Symbolic

c. Complementary

d. Linear

[tex]==============================================

[/tex]

ANSWER

a. Transactional

[tex]==============================================

[/tex]

#CarryOnLearning

(◕ᴗ◕✿)

What is your impression on the subject fundamentals of database systems?​

Answers

Answer:

The DBMS software enables users to share data. It provides a systematic method of creating, updating, retrieving and storing information in a database. DBMSs also are generally responsible for data integrity, data access control, and automated rollback, restart and recovery

   Database Fundamentals introduces database concepts, including relational databases, tables and data types, data selection and manipulation, views, stored procedures, functions, normalization, constraints, indexes, security, and backup and restore.

The output signal from an analogue sensor is sampled every 195 µs to convert it into a digital representation. What is the corresponding sampling rate expressed in kHz?
According to the Sampling Theorem, for this sampling rate value, what approximately could be the highest frequency present in the signal, in kHz, assuming the lowest frequency is very close to zero?

If each sample is now quantised into 512 levels, what will be the resulting bitrate in kbps?

Give your answer in scientific notation to 2 decimal places.

Hint: you need to determine the number of bits per sample that produces 512 quantisation levels.

Answers

Answer:

A sample rate is just reciprocal of the sample period. According to sampling theorem the highest frequency in single would be [tex]5.13/2=2.565 KHz.[/tex][tex]2^8=512[/tex] So you will need 8 bits to represent.[tex]8 bits \times5.128\times(10)^3[/tex]samples [tex]=41.026[/tex] bits per second.

Explanation:

Sample period of 1 millisecond [tex]=1 kHz.[/tex]

Thus a sample period of [tex]0.195[/tex] milliseconds is

[tex]1/0.195=5.12820513 Hz[/tex]

To determine the sample after [tex]512[/tex] levels quantization, we need to find bits per sample that produces [tex]512[/tex] quantization levels.

Thus,

[tex]2^8=512[/tex]

So you will need 8 bits to represent.

8 bits [tex]\times5.128\times(10)^3[/tex] samples [tex]=41.026[/tex] bits per second.

Learn more about scientific notation, refer :

https://brainly.com/question/10401258

write a c++ program to calculate the factorial of a number

Answers

Answer:

#include <iostream>

int factorial(int n) {

 return (n > 1) ? n*factorial(n-1) : 1;

}

int main() {

 std::cout << factorial(5);

}

Explanation:

Above is an approach using recursion.

It will output 120, which is 5! = 5*4*3*2*1

CODE

#include <iostream>

using namespace std;

int main() {

   // Declare the variables

   int n = 19;

   long int factorial = 1;

   // Each time, the factorial multiplies by integers from 1 to the maximum number.

   for(int i = 1; i <= n; i = i + 1) {

       factorial = factorial * i;

   }

   

   // Display the factorial

       cout << factorial;    

   return 0;

}

EXPLANATION

Declare n and factorial as integers and long integers.

The "for loop" runs from 1 to the maximum number and increments by 1. The factorial multiplies each time by integers from 1 to n.

Print the factorial.

How can using stringent security measures, such as two proxy servers with firewall, prevent a Trojan virus?

A. This would make the network virtually impossible to penetrate.
B. This would make the network more of a target.
C. It would become more difficult to penetrate the network, but still possible.
D. It cannot.

Answers

Answer:  C. It would become more difficult to penetrate the network, but still possible.

Explanation: Because its possible but you will have to see how big your network is, and its difficult but it can prevent a Trojan virus, and can deal with two proxy servers with firewall.

Hope I helped :)

30pts! PLEASE ANSWER FAST-BRAINLIEST WILL BE MARKED
the footer is a number and is used in checking to be sure the _____ has not changed​

Answers

the footer is a number and is used in checking to be sure the bottom margin of each page has not changed​

What enables image processing, speech recognition, and complex game play in Artificial Inteligence (AI)?

Answers

Y u no se me hace mal

Answer:

Deep Learning

Explanation:

Deep Learning

What was the fisrt computer?

Answers

Answer:

AtanasoffBerry Computer.  It was built by physics Professor John Vincent Atanasoff and his graduate student, Clifford Berry, in 1942 at Iowa State College, now known as Iowa State University.

Explanation:

The First computer is called The Babbage Difference Engine.

I hope this is what you needed

What is an example of an Experience component within an enterprise platform?​

Answers

Answer:

A

Explanation:

A system used for processing customer payments. A tool used to coordinate recruitment of new employees. A mobile app used by customers to place orders.

Any computer expert to help me answer this question plz am giving brainliest

Answers

Answer:

(Shown below)

Explanation:

The email is written as:

boby(at)qengineers.org

The first part of the email adress is the name, which is Boby. (boby(at)qengineers.org)

The second part will always be the (at) sign. (boby(at)qengineers.org)

The third and last part is the company, or where the email is coming from. (boby(at)qengineers.org)

Hope this helps!

(Also please note I put (at) for the at symbol because brainly doesn't let me type it in)

C++: Given three strings on separate lines, insert the contents of the second string in the first string right before the third string. Then,
output the result

Ex: If the input is:
FuzzyBear

Wuzzy

Be

the output is:
FuzzyWuzzyBear

Note: Using a pre-defined string function, the solution can be just one line of code.

(I tried using strVar.insert(partStr, str2) but was unsuccessful. I don’t know where I’m messing up. Thank you for your help. I’ve been trying to alter this code for a while now)

Answers

Answer:

Use the .find() function in your first string to give you an index.

Explanation:

Hi! I'm guessing you're taking COP2334 like me. A T.A. helped me figure out what I needed, so I'm passing it on.

Basically, you're given three strings and no integer to use as an index in order to insert the second line. Since you are required to have an index to use the .insert() function, this is "tear-out-my-hair" frustrating. What I failed to remember was that it is totally possible to use a function inside another function to get what you need!

You have been given is a hint as to where str2 goes, in the form of your 3rd string. If I'm right, all of the tests the system will run (mine is in Zybooks) will give a 3rd string that is inside the first string.

String 1: strVar: "FuzzyBear"

String 2: str2: "Wuzzy"

String 3: partStr "Be"

Open your statement with strVar and use the insert.() function. In the insert function, you are required to give a place to start, (your index), then what you want to insert. Your index will be the .find() function, searching in StrVar for partStr. The second part of the .insert() function is str2.

Hope that helps!

What algorithm should I use?

Answers

Answer:

YOu should use `ordinary least square regression ´

Answer:

Read the path and algorithm labels on the chart as "If <path label> then use <algorithm>." For example: If you want to perform dimension reduction then use principal component analysis. If you need a numeric prediction quickly, use decision trees or linear regression.

What are the major features of React?

Declarative
Centralized
Component-Based
Learn Once, Write Anywhere
Predictable

Answers

JSX - JavaScript Syntax Extension. JSX is a syntax extension to JavaScript.

Virtual DOM. React keeps a lightweight representation of the “real” DOM in the memory, and that is known as the “virtual” DOM (VDOM)

Performance. ...

Extensions. ...

One-way Data Binding. ...

Debugging. ...

Components. ...

State.

jjhb ft fv tuning Denise l Debbie

Answers

What








What the debbie



Answer: is Debbi

Explanation: and what

What is the meaning of DHCP

Answers

Answer:

A Dynamic Host Configuration Protocol

Explanation:

WHAT ACTIONS CAUSE SPAM ON LINKEDIN?

Answers

Answer:

LinkedIn has a very smart algorithm, and it has a very strict policy against spammers. Back in 2014, it deleted millions of accounts that were causing spam on LinkedIn.  

Spam occurs:  

1. When you send bulk of connect requests in a short time  

2. When you send irrelevant messages to prospects  

3. When you Perform overactivity  

4. When you use LinkedIn automation tools  

5. When you send spammy and sales-y messages  

All these actions cause spam on LinkedIn, and it immediately takes action against you by restricting your account temporarily or permanently.

Other Questions
6-2 Algunos momentos histricos claves. Completa las oraciones con laforma correcta de uno de los verbos a continuacin.aguantaraprobarcombatirconvivirdedicarseotorgarpertenecorrestringitnacoren1. El activista de los derechos civiles Martin Luther King, Jr.1929 y muri en 1968.2. Durante toda su vida, el sindicalista Csar Chvezgarantizarles una mejor calidad de vida a los trabajadores agrcolas.3. La ley no permite el derecho de los ciudadanos a votar en laselecciones.4. Muchas personas quea grupos minoritarios han tenido queluchar por sus derechos.5. La enmienda diecinueve de la Constitucin de EE. UU. leelderecho a votar a la mujer en 1920.6. En 1964, el Congreso de EE. UU. la Ley de Derechos Civiles.7. En los 60, no era tan fcil el acoso sexual en el trabajo. Dcadasms tarde, muchas mujeres decidieron que no lo iban a8. El respeto mutuo es esencial para pacficamente con otrosgrupos tnicos.PearsonCopyright 2020, 2013, 2009 Pearson Education, Inc. All Rights ReservedLesson: Leccin 1-B Vocab_Igualdad de Oportunidad4/12nearpod what is the answer to {36m= ? dm} 1 Rajah 1 menunjukkan satu contoh mikroorganisma. Diagram 1 shows an example of microorganisms. 0 Rajah 1 / Diagram I Antara yang berikut, yang manakah pengelasan yang betul bagi mikroorganisma ini? Which of the following is the correct classification for this microorganism? A Alga / Algae B Fungi / Fungi C Virus / Virus D Bakteria / Bacteria What is Pt=3x+4 and tq=5x-6 at a wage of 10$ per hour how many hours did john work to earn 5140$ 15. The total consumption of fruit juice in aparticular country in 2006 was about2.28 x 109 gallons. The population of thatcountry that year was 3 x 108. What was theaverage number of gallons consumed perperson in the country in 2006? Lee la lectura.Decide si es una ventaja o una desventaja. A bicyclist steadily speeds up from rest to 6.00m/s in 7.30s.How far did she travel during this time? Helppppppp meeeeee pleaseeeee 50 POINTS!!!!!!!!!! ASAP!!!!!!!!!!GDP items counted vs not counted Classify each number as rational or irrational and explain.Error Occurred.. square root of 25 . square root of 2 7,548,123 how many time larger is 9x10^-8 than 3x10^-12 If BD = BC , BD = 5x - 26, BC = 2x+1, and AC = 43, find AB f(x) = -4x + 10g(x) = x2 + 7x+ 5Composition of functions how to solve value of g [f(4)] Select all equations that are true.A. 63 x 103 = 63,000OB. 63 x 10,000 = 630,000C. 63 x 102 = 630OD. 63 x 1,000 = 6,300OE. 63 x 105 = 6,300,000 What does it mean to be alive? On the lines below, listcharacteristics that you think living things have. Then read thelesson to learn what you have in common with other livingthings. Alice makes a batch of cookies for her mom'sbirthday. She adds 2 cups of flour and1 cups of sugar to a bowl. How many cups ofdry ingredients does Alice add to the bowl? you absorb attitudes and emotions toward money from your family during which stage of life?a. adolescence b. young adultc. childhoodd. middle age plzzzzzzzzz helppppp A rectangle has a length of 16 inches more than three times its height. If the perimeter of a rectangle is 504 inches, find its dimensions.The length equals ___ inches and the height equals ___ inches.