subject

7. (a) An algorithm has been written in pseudocode to Input 50 numbers. Positive numbers are stored in the array PosNum[ ]. Negative numbers are stored in the array NegNum ).
Zeros are not included in the positive and negative counts.
Count 0
PosCount Count
NegCount + Count
REPEAT
INPUT Number
IF Number > 0
THEN
PosCount PosCount + 1
PosNum[PosCount] = Number
ELSE
NegCount = NegCount
NegNum[NegCount] = Number
ENDIF
Count Count + 1
UNTIL Count >= 50
OUTPUT "There are ", PosCount," positive numbers"
OUTPUT "There are ", NegCount," negative numbers"
(b) The algorithm needs to be changed so there is no limit to how many numbers can be input.
When the number 9999 is input, the algorithm stops more numbers being input and outputs
the results. The number 9999 is not to be stored nor counted as a positive number.
Explain how you would change the algorithm.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:30
Ajeweler designing a pin has decided to use five stones chosen from diamonds, rubies, and emeralds. in how many ways can the stones be selected?
Answers: 3
question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
question
Computers and Technology, 24.06.2019 01:10
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates.json” file), in order of closest-to-farthest from the origin.
Answers: 1
You know the right answer?
7. (a) An algorithm has been written in pseudocode to Input 50 numbers. Positive numbers are stored...
Questions
question
Mathematics, 10.12.2020 04:00
question
Mathematics, 10.12.2020 04:00
question
Mathematics, 10.12.2020 04:00
question
Mathematics, 10.12.2020 04:00
question
Mathematics, 10.12.2020 04:00