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, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
Answers: 2
question
Computers and Technology, 24.06.2019 15:00
In excel, what happens to the cell contents when you click and drag a cell into multiple cells?
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, 08.09.2021 01:00
Questions on the website: 13722360