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
Tom [10]
3 years ago
10

(Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecified number of int

egers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Python
Computers and Technology
1 answer:
Papessa [141]3 years ago
7 0

Answer:

Explanation:

Sorry it  is in Java, though you can covert it using converter

public class Exercise {

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 int positives = 0;  // Count the number of positive numbers

 int negatives = 0;  // Count the number of negative numbers

 int count = 0;   // Count all numbers

 double total = 0;  // Accumulate a totol

 // Promopt the user to enter an integer or 0 to exit

 System.out.print("Enter an integer, the input ends if it is 0: ");

 int number = input.nextInt();

 if (number == 0) { // Test for sentinel value

  System.out.println("No numbers are entered except 0");

  System.exit(1);

 }

 while (number != 0) {// Test for sentinel value

  if (number > 0)

   positives++; // Increase positives

  else

   negatives++; // Increase negatives

  total += number; // Accumulate total

  count++;    // Increase the count

  number = input.nextInt();

 }

 // Calculate the average

 double average = total / count;

 // Display results

 System.out.println(

  "The number of positive is " + positives +

  "\nThe number of negatives is " + negatives +

  "\nThe total is total " + total +

  "\nThe average is " + average);

}

}

You might be interested in
How is digital footprint created ?
dalvyx [7]

Answer:

by simply just logging on and using the internet.

Explanation:

4 0
3 years ago
Which of the following is not a data visualization technique?
Minchanka [31]

Answer:

Normalization

Explanation:

From the options given :

Boxplot is a data visualization techniqye used for representing numerical data in the form of a box such that it adequately conveys the five number summary if the dataset which are the minimum, maximum, lower quartile, median and upper quartile, it also depicts the presence of outlines.

Scatter plot are used depict the relationship between two variables on the x and y axis of a graph. Each point is a representation of the (x, y) value pairs of the observation.

Tag clouds are usually used to represent word, metatdata and other free form text using different colors and font sizes to give information about the data.

Normalization is the odd option out as it is used to restructure data in other to promote integrity of data.

3 0
3 years ago
What is a device driver​
sleet_krkn [62]

Answer:

Explanation:

In computing, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer. ...

4 0
3 years ago
Read 2 more answers
Code Example 8-1
damaskus [11]

Answer:

Option A: FileNotFoundError

Explanation:

FileNotFoundError is an exception which is thrown when a program fail to open a specified file. The root causes of this type of error can be:

  1. The directory path to locate a target file is wrongly defined in our code due to a typo on the file name or misuse of relative directory path, such as ../ and ./ which denote two different paths.
  2. For some reasons, a target file is misplaced in a wrong directory.

Any one of the above reasons can lead to the exception to be thrown when the file doesn't exist.

6 0
3 years ago
Which query will return the entire Gamers table?
Serga [27]

SQL queries can be used to retrieve data from a table.

The query that returns the entire Gamers table is (b) SELECT * FROM Gamers;

To retrieve a data we make use of the SELECT FROM clause

From the question, we understand that all entries of the Gamers table should be returned.

The keyword ALL in SQL is represented with asterisk i.e. *

The table whose data would be retrieved is the Gamers table.

Hence, the required query is: SELECT * FROM Gamers;

Read more about SQL queries at:

brainly.com/question/24223730

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which is an example of withholding you might see on your pay stub
    14·2 answers
  • Cover photos have a prominent location in your social media profiles, so you should use this space strategically – for example,
    14·1 answer
  • A _____ is a search engine that combines internet technology with traditional library methods of cataloguing and assessing data.
    8·1 answer
  • Movie that has a knife and shower​
    14·1 answer
  • Pick the two statements about packets and routing on the Internet which are true. a. Packets travelling across the Internet take
    13·1 answer
  • Which of the following does not illustrate the survey method of choosing a speech topic?
    6·2 answers
  • • Suppose an application generates chunks of 40 bytes of data every 20 msec, and each chunk gets encapsulated in a TCP segment a
    5·1 answer
  • Many websites (mostly online shopping sites), monitor a person’s Internet browsing behavior, such as the websites we often visit
    14·1 answer
  • Write and application that reads five integers from the user and determines and prints the largest and the smallest integers. Us
    7·1 answer
  • What is the 6 example of computer hardware and explain​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!