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

What's 32xy divided by 24yz and how do you figure it out.  The question also asks me to write it as a fraction then cancel (or reduce).
The Three-fifths compromise resulted in...
what is 92/99 written in the simplest form?
Can someone help factor the expression  y2 + 10xy + 25x2
Please help I don't know what to do for number 40
It costs a dollars for an adult ticket to a reggae concert and s dollars for a student ticket. The difference between the cost of 12 adult tickets and 18 studen
what is the factor of both x^2 - x - 6 and x^2 - 5x + 6 ? please explain .
write the equation a. a line with slope 2/3 that passes through the point (-3,6)b. a line that passes through the points (3,-1)and (5,7)
what does slippered pantaloons means in the seven ages of man for william shakespeare
How do you solve sleep deprivation? And i am not trolling!