williamsstacy5664 williamsstacy5664
  • 23-10-2017
  • Chemistry
contestada

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

Respuesta :

Kalahira
Kalahira Kalahira
  • 01-11-2017
(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.
Answer Link

Otras preguntas

why is it an advantage for frogs to release large numbers of eggs and sperms?
In Quebec province, strong feelings of ______________ have led to conflict between French and English speakers.
Using only whole numbers,Nikki wrote as many multiplication equations as she could with 12 as the product. What were her equations?
Circle two addends to add first find the sum explain your strategy 7+3+2
state one reason for the color change in beaker A
What is 37 and 1/2 simplified?
m 2.8 − 4.9 = −7.11
0.02 repeating as a fraction
habitat is when the last individual in a species dies or is gona be extincation ? help me please
The reforms of the Progressive Era were a response to which of the following? A. Corruption in business B. Prohibition of alcohol C. Reduction in immigration D.