1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tcecarenko [31]
3 years ago
8

Varied amount of input data Statistics are often calculated with varying amounts of input data. Write a program that takes any n

umber of integers as input, and outputs the average and max.
Computers and Technology
1 answer:
TiliK225 [7]3 years ago
4 0

Answer:

// Program will be written in Java Programming Language

// Comments are used for explanatory purpose

// Program starts here

import java.util.Scanner;

public class variednum

{

public static void main (String [} args)

{

Scanner input = new Scanner(System.in);

// Declare variables ; count, to count number of inputs; total to add all inputs

// And max to get the highest input.

// All declared Variables are initialised to 0

int count = 0, max = 0, total = 0;

// Prompt to ask if the user wants to input

System.out.print("Enter Y or y to continue: ");

char ask;

ask = input.next().charAt(0);

while ( ask == 'Y' || ask == 'y')

{

System.out.printn("Enter any number: ");

int num = input.nextInt();

// The above code segment gets input from the user

count++;

total += num;

// Check max number

max = Math.max(max, num);

System.out.println("Enter Y or y to continue: ");

ask = input.next().charAt(0);

}

// Calculate average

int avg = count == 0 ? 0 : total/count;

// Print average and max if count is not 0

System.out.println("Average = "+avg + "; Max = " + max);

}

}

You might be interested in
What does the format painter button in excel do
wlad13 [49]
The format painter button in excel copies formatting from one place and it applies it to another
7 0
4 years ago
True of False - use T or F An abstract class can have instances created using the constructor of the class.
Sindrei [870]

Answer:

False

Explanation:

An instance of an abstract class cannot be created through the constructor of the class, because it does not have a complete implementation. Though, it is possible to have references of an abstract type class. Abstract classes are incomplete structures and you would have to build onto it before you are able to use it.

7 0
4 years ago
3. How has air - conditioning affected human life?​
meriva

Answer:

Sudden changes in temperature and humidity affect the respiratory system. ... The air circulation can transmit infectious respiratory diseases. Airborne dust and fungi can cause allergic reactions. Air conditioning is associated with chronic rhinitis and pharyngitis, throat irritation and hoarseness.

6 0
3 years ago
When a device or service causes the system to hang during a normal boot, boot into __________ and disable the device or service
Olenka [21]

You should boot into <u>safe mode</u> and disable the device or service when it causes the computer system to hang during a normal boot.

<h3>What is safe mood?</h3>

Safe mood can be defined as a boot option in which the operating system (OS) of a computer system starts in <u>diagnostic mode</u> rather than in a normal operating mode, so as to enable the user correct any problems preventing the computer system to have a normal boot.

This ultimately implies that, safe mood is a diagnostic mode of the operating system (OS) of a computer system that is designed and developed to fix most problems within an operating system (OS) and for the removal of rogue software applications.

Read more on safe mood here: brainly.com/question/13026618

5 0
2 years ago
Question 4 of 20
Verdich [7]

Answer:

B

Explanation:

8 0
3 years ago
Other questions:
  • Write a program named Admission for a college’s admissions office. The user enters a numeric high school grade point average (fo
    15·1 answer
  • Movie that has a knife and shower​
    14·1 answer
  • Rather than a single address, you can refer to an array using their first (top/Left) and last (bottom/right) addresses separated
    15·1 answer
  • the ____ presents information about the document, the progress of current tasks, and the status of certain commands and keys.​
    14·1 answer
  • A page can have High needs met rating even if it is not related To the topic of the query​
    9·1 answer
  • 2- (8 point) Write a program using the instructions below. Assume that integers are stored in 4 bytes. a) Define an array of typ
    10·1 answer
  • Write chracteristics of all 5 generation of computer​
    7·2 answers
  • What is the function of ctrl+Q​
    14·1 answer
  • A large company has a LAN. The manager of the company wants to change it to a WAN
    10·1 answer
  • PLS HELP ME!! WILL GIVE BRAINLIEST
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!