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, 22.06.2019 01:00
What is added to the < meta > tag to describe the encoding type?
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
How do you make a lenny face? plz, brailiest to who can answer first.
Answers: 1
question
Computers and Technology, 22.06.2019 22:50
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Write the html code to make a link out of the text “all about puppies”. it should link to a pdf called “puppies.pdf” inside the “documents” folder. the pdf should open in a new window.
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
question
Mathematics, 30.12.2020 15:40
question
English, 30.12.2020 15:50
question
Mathematics, 30.12.2020 15:50
question
Mathematics, 30.12.2020 15:50
question
Health, 30.12.2020 15:50
question
English, 30.12.2020 15:50
question
English, 30.12.2020 15:50
question
English, 30.12.2020 15:50
question
Mathematics, 30.12.2020 15:50
question
Mathematics, 30.12.2020 16:00
question
Biology, 30.12.2020 16:00
Questions on the website: 13722359