Ask Question
13 February, 20:25

Write a loop that subtracts 1 from each element in lowerscores. if the element was already 0 or negative, assign 0 to the element.

+1
Answers (1)
  1. 13 February, 20:30
    0
    (pseudo-code)

    var element = input

    if element = or < than 0;

    assign 0 to element;

    else subtract 1 from element;

    repeat

    This problem will be seen in many introductory programming classes. The task assigned is to create a program that constantly subtracts 1 from a variable until the variable reaches 0, which then causes the variable to stay at 0. If said variable started out negative or 0, it will also stay at 0.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a loop that subtracts 1 from each element in lowerscores. if the element was already 0 or negative, assign 0 to the element. ...” in 📙 Chemistry if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers