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
Naily [24]
3 years ago
8

Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, a

nd 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. Sample Run 1
Computers and Technology
1 answer:
nika2105 [10]3 years ago
3 0

Answer:

import java.util.Scanner;

public class NumbersStats {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int pos = 0, neg = 0, count = 0, num;

       double total = 0;

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

       while (true) {

           num = in.nextInt();

           if(num == 0) break;

           if(num > 0) {

               pos++;

           } else {

               neg++;

           }

           total += num;

           count++;

       }

       System.out.println("The number of positives is " + pos);

       System.out.println("The number of negatives is " + neg);

       System.out.println("The total is " + total);

       System.out.println("The average is " + (total/count));

   }

}

Explanation:

You might be interested in
Mesh networks:__________.
postnew [5]

Answer:

b. typically contain more circuits in the network than in star or ring networks

Explanation:

In mesh architecture, all computers are connected to each other. In mesh all nodes connect directly and non hierarchical to each other so as  to efficiently route data.

Mesh combines the benefits of both ring and star networks. It  usually provide relatively short routes through the network (compared to ring networks) and provide  many possible routes through the network to prevent one circuit from becoming overloaded (as compared to star network).  Mesh network uses decentralized routing with each network performing its own routing.

Mesh network typically contain more circuits in the network than in star or ring networks and are more expensive than ring networks

7 0
3 years ago
If you’re looking for a quick, high-level overview of common metrics such as audience growth, website traffic, and total posts,
salantis [7]

Google Analytics, this is a common one but there are others that do the same thing.

7 0
3 years ago
What does it mean when a return is rejected for code 0503?
GarryVolchara [31]
Reject Code 0503<span> indicates that the Spouse's Social Security Number and the first 4 letters of the spouse's last name </span>do<span> not match IRS records. The IRS uses data provided by the Social Security Administration to verify this information. Hope this helps.</span>
5 0
3 years ago
if ur parent gets mad at u and says something then u say something, why do they say "stop back talking'' if ur just starting a c
Y_Kistochka [10]

Answer:

ummm what does this have to do with school work?

Explanation:

5 0
3 years ago
Read 2 more answers
At the end of the day, you finish a job only to find that the user you were doing it for had to leave. What should you do
Vika [28.1K]

The way to proceed in the situation presented would be:

  • Finish the process started to help that user and continue with the other tasks of the day.

<h3>How to serve a customer properly?</h3>

In different work positions we have the possibility of personally or virtually assisting clients by carrying out procedures to help them improve their service or experience with the company.

Companies have developed complete customer service systems so that their employees know how to proceed in different specific situations in which their customers require help.

In the situation described, the most appropriate thing would be to finish the process required by the user and continue with the other tasks of the day that were planned.

Learn more about job in: brainly.com/question/2018598

7 0
2 years ago
Other questions:
  • Although the battery on your smartphone is fully charged, it drains quickly. In some instances when the phone shows that the bat
    12·1 answer
  • ¿Cuál es el objetivo principal de los servicios?
    7·1 answer
  • Differentiate between Software as a service, platform as a service and infrastructure as a service.
    14·1 answer
  • A communication medium which allows receivers to observe multiple cues, such as body language and tone of voice, and allows send
    15·1 answer
  • Which of the following websites is least biased
    12·1 answer
  • Why would you use quotation marks in a search string when conducting an internet search?
    12·1 answer
  • list = 7 # these many modified Fibonacci numbers. def fibonacci_gt(n, t1, t2): if n&lt;0: print("Incorrect input") elif n == 0:
    12·1 answer
  • What is a defult? pls help if you wouldn't mind
    11·2 answers
  • The company generates a lot of revenue and is rapidly growing. They're expecting to hire hundreds of new employees in the next y
    6·1 answer
  • What makes you normally visit the site-graphics, layout, or content? Why?​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!