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 is patriarchal society?anser in very short​
please help !!!! i would really appreciate it ​
20 points lovelys <3​
Daniel buys a new car.In the first year, the value of the car decreases by 12% of its original value.The value of the car at the end of the first year is £9680.
What is the approximate length of the line segment? (1, -1) (6,-8)
2 Give very short answer to the following questions. (a) What are the types of Guthi? What are they? Name them. (b) Who practise Veja? Why? (c) Differentiate be
Find the missing side of triangle
Câu 36: _VD _Hình lập phương có thể tích là 1253 thì diện tích đáy là: A. cm2 B. 5cm2 C. 25cm2 D. 52cm2
i don't understand this, can someone help please?? ​
I NEED HELP IM GOING TO FAIL :/ I ALREADY HAVE ENOUGH STRESS! HELP PLS I BEG The picture I used it what you have to do! Write a two-paragraph objective summary