
Ardaan C.
asked 02/04/22how to write an alogorithim to input 1000 numbers, count how many are positive and how many have zeroes then output result
use either psedocode or flowchart recomend flowchart
1 Expert Answer

Luke L. answered 06/16/22
[DISCOUNTED PRICE] Experienced developer w/ teaching experience
Here is the pseudocode:
func count (int[] numbers):
numPositive = 0;
numContainsZeros = 0
for number in numbers:
if number > 0: numPositive++
if str(number).contains("0"): numContainsZero++
return numPositive, numContainsZeros
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Jake D.
Hi Ardaan, Could you elaborate a bit more? Let me know if this sounds correct. The algorithm takes in a random list of 1000 numbers and counts both how many of those numbers are positive and how many of those numbers contain a '0' character in them. For example. if one of the numbers was 1045, would it could for both a positive number and a number that contains a '0'?02/04/22