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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 13:30, andybiersack154
Consider jasper’s balance sheet. which shows how to calculate jasper’s net worth?
Answers: 1
image
Computers and Technology, 24.06.2019 14:00, superstarsara5ouh83x
Fast answer i need for apex ! smartphones should be banned from the classroom in public schools so that students cannot cheat on test so easily? which is an example of a counter argument to the thesis above? a. the classroom is a place for learning not for making phone calls b. smartphones are useful learning tools in the modern classroom c. banning smartphones will not students pay attention to teachers any better d. banning smartphones would decreased incidents of theft
Answers: 2
image
Computers and Technology, 25.06.2019 08:30, Anliz0179
What is the chief concern of cloud computing?
Answers: 1
image
Computers and Technology, 26.06.2019 05:30, spellsaltoniza
Consider ron’s budget. how much money does ron have left over each month?
Answers: 2
You know the right answer?
7. (a) An algorithm has been written in pseudocode to Input 50 numbers. Positive numbers are stored...

Questions in other subjects: