Step 1 - Break down the question ...
Pseudocode ...
IF StockLevel < 10 THEN PRINT 'Reorder'ENDIFPython ...
if StockLevel < 10: print('ReOrder')Step 1 - Break down the question ...
Pseudocode ...
Total <- 0 CountPositive <- 0 FOR Count <- 1 to 20 INPUT Number IF Number > 0 THEN Total <- Total + Number CountPositive <- CountPositive + 1 ENDIF NEXT Count Average <- Total / CountPositive PRINT 'Average of the Positive numbers is ', AveragePython ...
Total = 0 CountPositive = 0 for Count in range(20): Number = int(input('Enter number: ')) if Number > 0: Total = Total + Number CountPositive += 1 Average = Total / CountPositive print('Average of the Positive numbers is ', Average)For this question you would only need to explain what you would do. No Pseudocode is required.
"Put the input statement in a 'Repeat Until' loop that rejects any number less than zero."
Pseudocode Example ...
Total <- 0 CountPositive <- 0 FOR Count <- 1 to 20 REPEAT INPUT Number UNTIL Number > 0 IF Number > 0 THEN Total <- Total + Number CountPositive <- CountPositive + 1 ENDIF NEXT Count Average <- Total / CountPositive PRINT 'Average of the Positive numbers is ', Average