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

Erin's hourly salary went from $9.00 to $9.27. What percent raise did she receive?
When you turn on a radio and hear music, at what approximate speed are the radio waves traveling? A. the speed of light B. 80% of the speed of light C. 50% o
1/2 x 4/7?plz help meh
Sharon is driving through Oklahoma from her home in Ponca City, near the northern border, to her friend’s house in Ft. Worth, Texas, far to the south. If the te
The probability of selecting a particular color almond m&m (according to the website) from a bag of m&ms is listed below. let the probability of selecti
Can someone create a poem on a positive story experience at school
Can someone please help
GENTEEEEE AIUDAAAAA PLZZZZZZZ.... necesito un resumen “de cómo tía Lola termino empezando otra vez” AIUDAAAAAAAA q no me quiero quemar :(
you flip a coin 200 times and it lands heads up every time what is the approximate probadilaty
Does anyone knows the answer to this?