Ask Question
23 November, 02:02

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

+2
Answers (1)
  1. 23 November, 02:08
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers