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

Fossils of tropical plants and animals can be found buried in limestone rock in the North Texas area. These plants and animals are no longer found in this regio
[tex]f(x) = 2(5)^{x} [/tex]​
Use the substitution method to solve the given system of equations. Write your answer as an ordered pair, (x, y).
What is the theme of Ode to a Grecian Urn? A). Beauty is eternal. B). Beauty is a universal language among friend and foe. C). Both of these D). None of th
Re-read this passage from the FBI's account of the capture of Baby Face Nelson. In less than five minutes, what came to be known as “The Battle of Barrington”
Why did it take so long to desegrate schools after brown v. Board of education decisions
Which of the following is NOT a good way to recycle used tires
What traits are more likely to be found in males ?
15 POINTS plz help me WILL GIVE BRAINLIEST
A front forms when _____ .