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
HELP PLEASE
Mashcka [7]

A typical example of a Soft skills based question will be "tell us about your interpersonal skills" and "tell us about your time management".

<h3>What are Soft skills?</h3>

Soft skills refers to skills and traits that help employees interact with others and succeed in a typical workplace.

Some example of Soft skills include:

  • interpersonal skills
  • communication skills
  • listening skills
  • time management
  • empathy skills etc

Hence, an example of a Soft skills based question will be "tell us about your interpersonal skills" and "tell us about your time management".

Read more about Soft skills

<em>brainly.com/question/8381292</em>

3 0
2 years ago
What is the relationship between agile teams and project requirements
spin [16.1K]

Answer:

Agile follows a non-linear process, unlike conventional project management, which focuses more on teamwork, cooperation, and versatility, as opposed to a strict sequence of activities.Agile project management takes an iterative approach to project management, which time-boxes tasks into fast sprints.

Explanation:

4 0
3 years ago
Compare and contrast system software and generalised software
jekas [21]
System software is a type of computer program that is designed to run a computer’s hardware and application programs.
Generalized software refers to software designed to read, process and write data with the help of functions performing specific audit routines and with self-made macros.
3 0
3 years ago
PLEASE HELP I FAILED TWICE AND HAVE ONLY ONE MORE TRY BEFORE MY GRADE ARE SET I AM CRYINGGGGG PLEASEEE IM BEGGINGGGGG
anyanavicka [17]

1. C

2. B

3. C

4. A

5. A

6. B

7. C

8. D

9. C

10. B

11. D

12. D

13. D

14. A

15. A

16. B

17. A

18. B

19. D

20. B


Some of the ones towards the start may not be right but I gave it a go :)





8 0
3 years ago
Computers that are close to one another are connected to form a LAN
Archy [21]

Explanation:

different computer are connected to a LAN by a cable and an interface card

6 0
3 years ago
Other questions:
  • NEED ASWERS FAST
    12·1 answer
  • Free points! your welcome
    9·2 answers
  • Which of the following will you select as X in the following series of clicks to lay the title over a chart: Chart Title box &gt
    14·1 answer
  • Brainly wont show me the "I'm Done" button after an interactive ad, and I cant figure out why. I've watched the entire ad, click
    11·2 answers
  • In terms of CPU scheduling metrics, __________ is the time at which the job completes minus the time at which the job arrived in
    10·1 answer
  • WILL GIVE MORE POINTS, PLEASE HELP!!!
    11·1 answer
  • The structure of the atmosphere based temperature changes ​
    5·1 answer
  • You should always be afraid to use the internet<br><br> True or false?
    11·1 answer
  • Identify 5 products/services needed by the people in our current situation.<br>​
    6·1 answer
  • You are a developer for a news, entertainment, lifestyle, and fashion website. User traffic has steadily increased month-over-mo
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!