PLEASE I NEED HELP ASAP PLEASE PLEASE!!!

For a list of numbers entered by the user and terminated by 0, find the sum of the positive numbers and the sum of the negative numbers. C++ language only.

Answers

Answer 1

Answer:

Following are the program in the Python Programming Language

#set variables to 0

positive_sum=0  

negative_sum=0  

#print message  

print("Enter 0 to terminate")  

#set the while loop  

while(True):  

#get input from the user  

num=float(input("Enter positive or negative numbers: "))  

#set if statement to check condition  

if(num==0):  

  break  

elif(num>0):  

  positive_sum+=num  

else:  

  negative_sum+=num  

#print output with message  

print()  

print("sum of positive numbers: ", positive_sum)  

print("sum of negative numbers: ", negative_sum)  

Output:  

Enter 0 to terminate  

Enter positive or negative numbers: 1  

Enter positive or negative numbers: 3  

Enter positive or negative numbers: 5  

Enter positive or negative numbers: -7  

Enter positive or negative numbers: -2Enter positive or negative numbers: 0  

sum of positive numbers:  9.0  

sum of negative numbers:  -9.0

Explanation:

Here, we set two integer data type variables "positive_sum", "negative_sum" and initialize to 0.

Then, we set the while infinite loop inside the loop.

Set a variable "num" and get input from the user in it.

Set the if conditional statement and check condition the variable "num" is equal to 0 then, loop will terminate.

Set the elif statement and check condition the variable "num" is greater than 0 then, add that input and store in the variable "positive_sum"

Otherwise, add that input and store in the variable "negative_sum".

Finally, we print the output with the message.


Related Questions

I need help fixing “Love Nikki” game on my phone. I had it on my phone and it worked just fine but then igot a new phone and tried theDownload it but when I opened up the app it kept saying update the game so I clicked update but then after that it wouldn’t even update and it just said update feel rule out mistake. I thought it was just my new phone so I went back to my other phone but it was doing the same thing. I have 5G on my new phone so internets not the problem.

does anybody know how to fix it so I can play the game again?

Answers

Answer:

Try resetting your phone multiple times or uninstall and add the game again. If not, check settings and see whats wrong. Or just sign out of your phone and sign in again. Hope this helps :D

I need an If else statement that sorts three numbers from a file from least to greatest

Answers

void sort3(int& a, int& b, int& c)
{
if (a > b)
{
std::swap(a, b);
}
if (b > c)
{
std::swap(b, c);
}
if (a > b)
{
std::swap(a, b);
}
}

1. It manages the computer's memory and processes, as well as all of its software and hardware.
A. Application software
C. Graphical User Interface
B. Computer Operating System
D. Micro Computer ​

Answers

Answer:

B. Computer operating system

Explanation:

the operating system (or OS) manages all of the hardware and software in the computer, and allows hardware and software to communicate.

We can also figure this out by process of elimination: Application software is just a fancy way to say apps, Graphical User Interface (or GUI) are menus that allow a user to use the computer through a visual representation (what you interact with using your mouse), and microcomputer just means a small computer like a laptop or a phone.

which subunit of a heterodimeric cdk is the regulatory subunit?

Answers

The answer is cyclin subunit

A company is looking for an employee to install new computers and integrate them into its existing network. Which computer field most likely include this job ?
A. Network systems administrator
B. Information security analysis
C. Computer support
D. Application Development

Answers

A. Network systems administrator

Answer:

A. Network systems administrator

Explanation:

trust me i just did it 1.3.2

define management styles

Answers

Answer:

man·age·ment style

noun

plural noun: management styles

the methods used by a person in managing an organization or group of people.

"the players seemed to lose confidence in his management style"

Explanation:

lol is that good?

Answer:

A Management style is the particular way managers go about accomplishing these objectives.


Which type of list should be used if the items in the list need to be in a specific order?

Answers

Answer:

chronological

Explanation:

if your list is in chronological order that means it will be in the exact specific order in which you need it to be

You are in charge of setting up a network for a small office and ensuring its security. Describe how you will set up a small network.

Answers

hi there!

Answer:

setting up a small office network can be done with a LAN connection using a router, switch and some cables then we can connect all devices to the router through the switch using cables and it's done.

hope this helps.

goal of any user-friendly game should be to create a good what for the player?

A.
user experience (UX)
B.
user-interface (UI)
C.
user intuition (UIT)
D.
user skill (US).

Middle school question edmentum please add pic or just give answer

Answers

Answer:

with me being a gamer i know for a fact i love getting a good experience but also using my own thoughts into the game to help make decisions. so for the sake of your question its gonna be C; UIT

Answer:

A

Explanation:

User Experience is what makes a use friendly game accessible and enjoyable


Which type of list should be used if the items in the list need to be in a specific order?

Answers

Answer:

1.

2.

3.

Explanation:

Depending on the situation, any of them could be used to indicate a specific order. But for most cases, such as with scientific procedures, it's best to use the most traditional numbering system of 1. 2. 3...

What are the steps for adding a Watch Window?
Select the cell to watch

Answers

Answer:

How to The Watch Window in Excel

Select the cell you want to watch.

Click the Formulas tab.

Click the Watch Window button. ...

Click the Add Watch. ...

Ensure the correct cell is identified and click Add.

Scroll to the area of the worksheet where you need to add or update values.

Update the cell values.

Which of the following programming scenarios would benefit most from the use of lists?

Answers

The programming scenarios which would benefit most from the use of lists is: B. writing a program to calculate statistics about a large set of exam scores (e.g highest/lowest score, median average score).

Computer programming involves the process of designing and developing an executable instructions (codes) or collection of data to perform a specific task.

In Computer programming, a list can be defined as an abstract data type that represents a finite number of either ordered or unordered values. Thus, a list can be used to perform the following tasks:

Store data items.Delete data items.Add data items.

A computer program that is used to calculate statistics about a large set of exam scores (e.g highest/lowest score, median average score) would benefit most from the use of lists because it comprises a set of numerical values that can be sorted in either an ordered or unordered array.

Read more on lists here: https://brainly.com/question/15092271

Vivo critique 6 sentences

Answers

Answer:

im sorry i cant understad

how to stop programs from running at startup windows 10?

Answers

Just go into settings, type in startup apps, and it will take you to an area where you can select certain apps to start or not start when you reset / shut down / turn off your computer and turn it back on again.

Megan owns a small neighborhood coffee shop, and she has fifteen employees who work as baristas. All of the employees have the same hourly pay rate. Megan has asked you to design a program that will allow her to enter the number of hours worked by each employee and then display the amounts of all the employees’ gross pay. You determine that the program should perform the following steps:

1. The text that is in the file is stored as one sentence. Incorporate the code that reads the file’s contents and calculates the following:
a. total number of words in the file
b. total average number of words per sentence
c. total number of characters in the file
d. total average number of characters per sentence


file name: employee_names.txt
file text:
George Thomas
Melinda Harris
Norah Jeddery
Jorge Ortiz
Samantha Gregory
Tanvi Gupta
William Edwards
Tania Gomez
Erica Sanders
Gracie Lou Freebush
Tony Montana
Obi-Wan Kenobi
Cruella De Vil
Marty McFly
Napoleon Dynamite

Answers

Answer:

she gives 10 dollars an hour

Explanation:

no

Which of the following statements is true?

A.
Freelancers often charge high hourly rates to make up for the fact that their employers don't provide health care and other benefits.

B.
Freelancers automatically receive free health insurance.

C.
Freelancers are not reliable because there is no way to rate their work ethic or job performance.

D.
Freelancers must hire an accountant to handle their billing and payments.

Answers

Answer:

A.

Explanation:

The correct statement is: A. Freelancers often charge high hourly rates to make up for the fact that their employers don't provide health care and other benefits.

Freelancers often charge high hourly rates to make up for the fact that their employers don't provide health care and other benefits.

Freelancers typically have to factor in the costs of healthcare, retirement savings, and other benefits that are not provided by their clients or employers.

This can lead to higher hourly rates to ensure they can cover these expenses on their own.

Hence,

The statement that is true is A.

To learn more about skills of freelancing visit:

https://brainly.com/question/33779682

#SPJ3

You see a whiteboard that has “8-10 years olds, interested in horses” written on it. This is MOST likely a description of:

A.
data management.

B.
target users.

C.
GUI.

D.
iterative development.

Answers

Answer:

B target users

Explanation:

because it targets 8-10 year olds that are interested in horses so it targets that audience range

Farmer John has recently acquired NN new cows (3≤N≤5×105)(3≤N≤5×105), each of whose breed is either Guernsey or Holstein.The cows are currently standing in a line, and Farmer John wants take a photo of every sequence of three or more consecutive cows. However, he doesn't want to take a photo in which there is exactly one cow whose breed is Guernsey or exactly one cow whose breed is Holstein --- he reckons this singular cow would feel isolated and self-conscious. After taking a photo of every sequence of three or more cows, he throws out all of these so-called "lonely" photos, in which there is exactly one Guernsey or exactly one Holstein.

Answers

//Note: This program was compiled using turboc compiler. If you are using gcc or any other compiler, then you have to modify the code slightly
#include
#include
int main()
{
int field[110][110]; //FIELD SIZE
int N, i, j;
char dir[50]; //TO REPRESENT THE DIRECTIONS OF 50 COWS
int cow[50][1][2]; //TO STORE THE X,Y COORDINATES OF 50 COWS
int infinity[50]; //TO IDENTIFY, HOW MANY COWS VALUES WILL BE INFINITY AND VICE VERSA
int count[50]; //TO COUNT AMOUNT OF GRASS EATEN BY EVERY COW
int cont = 1; //FLAG VARIABLE, INITIALLY KEEP IT 1.

//CLEAR THE SCREEN
clrscr();

//MARK ALL FIELD POSITIONS AS 1, INDICATING THERE IS GRASS TO EAT
for (i=0; i<110; i++)
for (j=0; j<110; j++)
field[i][j]=1;

//FOR ALL COWS SET INFINITY AS 1 AND COUNT AS 0. I.E WE ASSUME THAT
//EVERY COW WILL EAT INFINITE GRASS AND INITIALLY IT HAS NOT EATEN ANYTHING
//SO COUNT IS SET AS 0
for (i=0 ; i<50 ; i++){
infinity[i] = 1;
count[i] = 0;
}

//READ N, I.E NO. OF COWS
scanf("%d", &N);

//FOR EACH COW, READ THE DIRECTION AND X, Y COORDINATES
for( i=0 ; i fflush(stdin);
scanf("%c%d%d", &dir[i], &cow[i][0][0], &cow[i][0][1]);
}

//REPEAT UNTIL CONT==1
while( cont==1 ){

//FOR EVERY COW CHECK ITS DIRECTION
for( i=0 ; i //IF THE COW IS FACING NORTH DIRECTION
if( dir[i] == 'N'){
//IF THE RESPECTIVE COW'S Y COORDINATE IS LESS THAN 109
if( cow[i][0][1] < 109 )
//IF THERE IS GRASS IN THE PARTICULAR LOCATION,
if( field[cow[i][0][0]][cow[i][0][1]] == 1 ){
//LET THE COW MOVES TO THE NEXT LOCATION, BY INCREMENTING THE VALUE ASSOCIATED WITHN Y-COORDINATE
cow[i][0][1]++;
//INCREMENT THE COUNT VALUE FOR THE RESPECTIVE COW
count[i]++;
}
else
//IF THERE IS NO GRASS IN THAT LOCATION, THEN MAKE THE INFINITY VALUE CORRESPONDING TO THIS COW AS 0
//COW STOPS
infinity[i] = 0;
}

//IF THE COW IS FACING EAST DIRECTION
if( dir[i] == 'E'){
//IF THE RESPECTIVE COW'S X COORDINATE POS IS LESS THAN 109
if( cow[i][0][0] < 109 )
//IF THERE IS GRASS IN THAT PARTICULAR LOCATION
if( field[cow[i][0][0]][cow[i][0][1]] == 1 ){
//LET THE COW MOVE ON TO THE NEXT LOCATION
cow[i][0][0]++;
//INCREMENT THE COUNT FOR THE RESPECTIVE COW
count[i]++;
}
else
//IF THERE IS NO GRASS THEN MAKE INFINTY AS 0 FOR THE PARTICULAR COW.
//THE COW STOPS
infinity[i] = 0;
}
}

/*IN THE PREVIOUS TWO LOOPS WE MADE THE COW TO MOVE TO THE NEXT LOCATION WITHOUT
EATING THE GRASS, BUT ACTUALLY THE COW SHOULD EAT THE GRASS AND MOVE. THE BELOW
LOOP ENSURES THAT. THIS TASK WAS SEPARTED, TO ALLLOW TO TWO COWS TO SHARE THE SAME
POSITION FOR EATING.*/
for( i=0 ; i //IF THE COW IS FACING NORTH
if( dir[i] == 'N'){
//IF CURRENT Y POSITION IS <= 109
if( cow[i][0][1] <= 109 )
//IF IN THE PREVIOUS Y POSITION, THERE IS GRASS
if( field[cow[i][0][0]][cow[i][0][1]-1] == 1 )
//REMOVE (EAT) THE GRASS
field[cow[i][0][0]][cow[i][0][1]-1]=0;
}
//IF THE COW IS FACING EAST
if( dir[i] == 'E'){
//IF CURRENT X POS IS <= 109
if( cow[i][0][0] <= 109 )
//IF IN THE PREVIOUS X POS, THERE IS GRASS
if( field[cow[i][0][0]][cow[i][0][1]] == 1 )
//REMOVE (EAT) THE GRASS
field[cow[i][0][0]-1][cow[i][0][1]]=0;
}
}

/*ASSUME THAT ALL THE COW STOPS EATING AS THERE IS NO GRASS IN THE CURRENT CELL
OR THE COW HAS REACHED THE LAST LOCATION*/
cont = 0;

//REPEAT FOR EVERY COW
for( i=0 ; i //IF THE COW IS FACING NORTH
if( dir[i] == 'N'){
//IF THE COW HAS NOT REACHED LAST Y LOC OR NOT STOPPED EATING
if( cow[i][0][1] < 109 && field[cow[i][0][0]][cow[i][0][1]] !=0 )
cont = 1; //MAKE COUNT AS 1, THE WHILE LOOP SHOULD REPEAT
}
//IF THE COW IS FACING EAST
if( dir[i] == 'E'){
//IF THE COW HAS NOT REACHED LAST X LOC OR NOT STOPPED EATING
if( cow[i][0][0] < 109 && field[cow[i][0][0]][cow[i][0][1]] !=0)
cont = 1; //MAKE COUNT AS 1
}
}
}

//DISPLAY THE OUTPUT
for( i=0 ; i {
//IF THE INFINITY VALUE OF THE RESPECTIVE COW IS 1, THEN DUSPLAY AS INFINITY
if( infinity[i] == 1 )
printf("\nInfinity");
else //ELSE DISPLAY THE RESPECTIVE COUNT VALUE
printf("\n%d", count[i]);
}

getch();
return 0;
}

why does my ps4 keep disconnecting from the internet

Answers

Answer:

It could be a variety of reasons depending on your form of connection. Wireless, it could be distance from router causing packet loss or disconnection. Wired, damaged or poor wire, or bad internet. What do you know about your connection?

Drag each label to the correct location on the image.
Identify the parts of the URL.
World Wide Web
server name
resource ID
protocol
domain name

Answers

Answer:

1) Resource ID

2) Server Name

3) Domain Name

4) World Wide Web

5) Protocol

The correct location is Resource ID, Server Name, Domain Name, World Wide Web, Protocol respectively.

What is a website?

The Online Etymology Dictionary states that in 1994, the word "website" first appeared in the English language.

It combines "Web," used in the meaning of the Internet, with "Site." The study of word origins and how their meanings changed over time is known as etymology. The web address of every website begins with "http://".

The website may be one of many various forms, such as an e-commerce website, a social media website, or a blog website. Each website serves a unique purpose, but they all have the feature of having numerous linked web pages.

Resource ID, Server Name, Domain Name, World Wide Web, and Protocol are the right locations, accordingly.

Thus, this is the correct answers for the given situation.

For more details regarding a website, visit:

https://brainly.com/question/29777063

#SPJ2

What is one way hackers can trick you into transmitting personal data over on a public network without your knowledge

Answers

Hmmm when they say that we have a debt of $10,000 but you don't but you don't know that so they ask you for the personal data for your bank so their can get in and get the money for you so you don't have to and that how they trick you

To insert a row, right-click the row below where you want to insert a row and then click on ____ the shortcut menu. A. Columns B. Insert C.Rows D.Cells​

Answers

Answer:

I think it's insert. (It's the only one that actually makes sense).

Explanation:

Hope that helps. x

Understanding that protection of sensitive unclassified information is:

Answers

Answer:

Not necessarily malignant

Explanation:

As the word "unclassified" shows it's not damaging, however I still doesn't recommend if it's not necessary.

Identify the type of software that should be in main memory in order to use the keyboard? *


A. word processing software

B. systems software

C. spreadsheet software

D. applications software

Answers

Answer:

Ok so im not completely sure about this but i think its

Systems Software

Explanation:

because word processor is for typing documents and stuff

spreadsheet is for like tracking you money your daily money or something

or some kind of graph for stuff like that (i think)

applications software well your keyboard isn't a application unless its the on screen keyboard

so the only one left is system software

hope it helped :)))) (●'◡'●)

Which is the best autoclicker for godbrigding

Answers

The best auto clicker for godbrigding is

Can anyone help me out with my photography questions?

Answers

Verifying, The answer above me is correct

The software which manages environment for running programs handling error controlling devices configuring the computer system and managing the resources of a computer.
Write the technical term of the given question of the picture .
Correct Answer =⟩ Thanks
Best answer =⟩ Brainliest
Random answer =⟩ Reported and deleted ​

Answers

Answer:

D

Application

System software is the set of programs that enables your computers hardware devices and Application software to work together.

Practical computer systems divide software systems into two major classes: System software: Helps run the computer hardware and computer system itself. System software includes operating systems, device drivers, diagnostic tools and more. ... (Some application software is pre-installed on most computer systems.)

Explanation:

write a program to print even numbers from 1 to 20​

Answers

Answer:

If qbasic then

pls mark barinist

Answer:

print(“2 4 6 8 10 12 14 16 18 20”)

8.3.7: Exclamat!on Po!nts
Write the function exclamation that takes a string and then returns the same string with every lowercase i replaced with an exclamation point. Your function should:

Convert the initial string to a list
Use a for loop to go through your list element by element
Whenever you see a lowercase i, replace it with an exclamation point in the list
Return the stringified version of the list when your for loop is finished
Here’s what an example run of your program might look like:

exclamation("I like music.")
# => I l!ke mus!c.

Answers

The function is an illustration of loops.

Loop instructions are used to repeat operations

The function in Python, where comments are used to explain each line is as follows:

#This defines the function

def exclamation(myStr):

   #This iterates through the string

   for i in range(len(myStr)):

       #This checks if the current character of the string is "i"

       if myStr[i] == "i":

           #If yes, this converts the string to a list

           s = list(myStr)

           #This replaces i with !

           s[i] = '!'

           #This gets the updated string

           myStr = "".join(s)

   #This returns the new string

   return myStr

       

Read more about similar programs at:

https://brainly.com/question/22444309

What does it mean by does the author create an emotional connection toward the readers?

(Emotional connection reading definition)

Answers

Answer:

the author makes an emotional connection between you and the character

Explanation:

short version:you feel the characters emotion

Other Questions
Hi Shehhrbr e. EeHeheheb?So l mr. jessup and mr allen i ready mathematics pages 77 and 78 Um yeah so ignore the blue circles. I need your helpp ty Write the equation of a line that passes through the point (-1,2) that has a y-intercept of (0,-1). PLS HELP QUICK I NEED TO UNDERSTAND THIS I HAVE A FINAL TMRW Andrew loses31 pencils inOctoberWhat is thelose rate perday? 100 POINTSSound evidence provides strong support for a claim. Consider this evidence from the text:Colony losses from CCD are a very serious problem for beekeepers. Annual losses from the winters of 2006-2011 averaged about 33 percent each year.Select all the claims that this evidence would support.(A) Farmers and beekeepers remain perplexed as to why the honeybee colonies are collapsing.(B) Continued colony collapse will result in higher prices for the produce we eat daily.(C) Decreases in honeybee colony populations have farmers worried that crop pollination may be severely affected.(D) State and federal governments must help in the attempt to find clear answers for why bee colonies are collapsing.(E) Many beekeepers feel that CCD has been blown out of proportion in the media and in the farming community.(F) Finding a solution for CCD continues to be a priority for most beekeeperstheir livelihood depends on it. Which of the following particles are fundamental parts of an atom? Check all that apply.protonneutronOelectron Which two elements are typically included in an autobiography? anybody here can help me with this assignment???? Food that has been prepared or handled should never be placed on the salesfloor before it has been. Uhhhh..... can someone help me plz Katrina graduated from college with a degree in veterinary science. She also has an interest in law enforcement. What company might be interested in hiring Katrina?Question 5 options:a government building looking for a security officera city government in need of an animal control officera county commissioner looking for an executive assistanta large bank in need of a network manager han earns $33,00 for babysitting 4 hours. at this rate, how much will he earn if he babysits for 7 hours? The comparison of two bullets is possible with the comparison microscope. Such a study is made difficult by the fact that: YO ANYONE WHO IS REALLY GOOD AT MATH THAT COULD HELP ME ? Number 1 of the cell in the image below is the How would Susan miller okin go about creating a just society Eric leaves his house on his bike. He rides at a constant speed until he reaches a lemonade stand, where he parks his bike and takes a rest. Then he turns around and bikes home as fast as he can. PLEASE HELP!! DUE SOON!!! WILL GIVE 5 STARS ALONG WITH A HEART!!! please help me quick What is photosynthesis?