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
Trina Hauger works for Johnson Electric as a corporate lawyer, and part of her duties are to ensure the ethical and legal use of
Roman55 [17]

Answer:

b) chief privacy officer (CPO)

Explanation:

The CPO is responsible for ensuring the ethical and legal use of information within a company.

Chief knowledge officer (CKO) is a the person responsible for overseeing knowledge management within an organisation. This role is just like the role of chief learning officer.

A chief information officer (CIO) is the person responsible for the management, implementation, and usability of information and computer technologies. The role is also known as chief digital information officer (CIDO)

A chief technology officer (CTO) is the person in charge of an organization's technological demand. This role is also known as a chief technical officer.

From the above explanation; it is clear that the answer is Trina Hauger is a CPO.

5 0
3 years ago
What are node in a computer network​
BabaBlast [244]

Answer:

A node is a connection point inside a network that can receive, send, create, or store data. Each node requires you to provide some form of identification to receive access, like an IP address. A few examples of nodes include computers, printers, modems, bridges, and switches.

3 0
2 years ago
Create a view named Top10PaidInvoices that returns three columns for each vendor: VendorName, LastInvoice (the most recent invoi
maksim [4K]

Answer:

See Explaination

Explanation:

SELECT TOP 10 VendorName AS Name, MAX(InvoiceDate) AS LastInvoice, SUM(InvoiceTotal) AS SumOfInvoices

FROM dbo.Vendors V JOIN dbo.Invoices I

ON V.VendorID = I.VendorID

WHERE PaymentDate IS NOT NULL

GROUP BY VendorName

ORDER BY SumOFInvoices desc;

5 0
3 years ago
Interpretations of the AICPA Code of Professional Conduct are dominated by the concept of: Question 4 options: 1) independence.
timama [110]

Answer: independence

Explanation:

The AICPA Code of professional Conduct is based on the following concepts which are :

1. responsibilities

2. serve the public interest

3. integrity

4. objectivity and independence

5. due care

6. The scope and nature of services.

3 0
3 years ago
Should I download RAM on my computer?
jenyasd209 [6]

Well, if you want to, make sure it's safe.

I don't know what RAM really is, but check if it's safe first. And maybe talk it out with your parents.

That's all I gotta say!

7 0
3 years ago
Read 2 more answers
Other questions:
  • At the dsl local carrier's office, the __________ demultiplexes the data streams and converts them into digital data.
    10·1 answer
  • Information management examines the organizational resource of information and regulates its definitions, uses, value, and distr
    11·1 answer
  • Which of the following payment types require you to pay upfront A. Money order and credit card B. Money orders and prepaid card
    9·2 answers
  • An example of software most commonly associated with productivity software is ____.
    12·1 answer
  • Gear systems with __________ can have both drive and driven gears on the same shaft. a. an odd number of gears b. an even number
    6·1 answer
  • Green field country is planning to conduct a cricket match between two teams A and B. a large crowd is expected in the stadium a
    6·1 answer
  • Drawing programs typically create images using mathematical formulas, instead of by coloring pixels, so images can be resized an
    12·1 answer
  • Can you please help me with the AP Computer Science Fill in the blank. What goes on number 5 8 and 18. I don’t understand this I
    8·1 answer
  • Mississippi law codes state that bullying and cyberbullying are against the law. A court can decide to incur ___________________
    10·1 answer
  • Witch icon allows you to see paragraph formatting feature
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!