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
More
1 Expert Answer
Inactive Tutor answered 06/16/22
Tutor
New to Wyzant
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.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Inactive Tutor
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