Ask Question
25 November, 06:31

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

+3
Answers (1)
  1. 25 November, 07:40
    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 you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers