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
Karo-lina-s [1.5K]
2 years ago
10

I need a C++ program to ask the user to put in different numbers until zero is pressed then the program counts the numbers that

are put in and finds the sum of the numbers and the negative numbers.
Computers and Technology
1 answer:
frozen [14]2 years ago
7 0

Answer:

#include <iostream>

using namespace std;

int main()

{

int input = 0;

int count = 0;

int sum = 0;

int sumNegative = 0;

while (true) {

 cout << "Enter a number: ";

 cin >> input;

 if (input == 0) break;

 count++;

 sum += input;

 if (input < 0) {

  sumNegative += input;

 }

}

cout << "Count of the numbers: " << count << endl;

cout << "Sum of all the numbers: " << sum << endl;

cout << "Sum of the negative numbers: " << sumNegative << endl;

}

Explanation:

Your requirements regarding the sum and the negative numbers was a bit vague so I just did something you can probably adjust easily to your liking.

You might be interested in
After saving her presentation initially, Leah realizes she needs to add another content slide. She adds the slide and is ready t
liberstina [14]

Answer:

a, c, & e

Explanation:

7 0
3 years ago
One rule in the Java programming language is that you have to place a semicolon at the end of each statement. What is this rule
slavikrds [6]

Answer:

A data structure if I'm correct.

Explanation:

The computer would need to know when one command is over, as you can write code like this,

ellipse(20, 20, 20, 20);fill(255, 0, 240);

and without the semicolon it would end up looking like this,

ellipse(20, 20, 20, 20)fill(255, 0, 240)

and the computer would not know when you've stopped creating the circle and when you've started to color it.

8 0
2 years ago
Read 2 more answers
Bob's Assembly is a hardware manufacturer. It specializes in builders' hardware for doors, cabinets, windows, and bathrooms. Bob
Snezhnost [94]

Answer:

distinctive competence

Explanation:

The distinctive competence denotes the various characteristic of certain business on which behalf that business perform better than its competitors. And since the business succeeds in doing those things better than its competitors, that business gains a competitive advantage over its competitors. And here, Bob's assembly is a hardware manufacturer for the doors, cabinets, windows and the bathrooms. And his assembly products are more durable and economical than its competitor's products. And thus Bob has a competitive advantage over its competitors.

3 0
3 years ago
List 5 differences between monitors and printers​
Alinara [238K]
Monitor is a display for a computer system.
monitor is the primary memorable device.
a printer is a device that builds one static image and captures it permanently on a suitable medium.
a printer cannot project information unlike a monitor.
a monitor is mainly used for commands.
4 0
2 years ago
You would like to enter a formula that subtracts the data in cell B4 from the total of cells B2 and B3. What should the formula
anastassius [24]

Answer:

=b2 b3-b4 or something close to that, I hope this helps ^^

Explanation:

6 0
3 years ago
Other questions:
  • It is important that researchers design rigorous study methods to eliminate: a. inferences. b. the need for a CONSORT flow chart
    10·1 answer
  • Which of the following was one of the first internet search engines? A. archie B. google C. Yahoo D.ask
    7·1 answer
  • Python: Write a program that generates 8 random scores (between 0 and 100), store them in an array,
    8·1 answer
  • When public relations professionals make provocative statements in newsgroups to get people to visit an organization's website o
    10·1 answer
  • A ___ is an organized collection of data in digital format that helps users to keep
    5·1 answer
  • Find the simple interest Jay owes on a five-year student loan of $48,000 with an annual interest rate of 5%.
    6·1 answer
  • Which practice is the safest way to sit at a desk while typing on the computer?
    12·1 answer
  • Does digital media play a big role in your life?
    13·1 answer
  • Is spin to win paying or is a scam app​
    6·2 answers
  • What is the maximum number of extended partitions can you have on a hard drive?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!