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

hwlp i give 5 stars​
A sample of 86 motels is selected from a large urban area and the price for a night of lodging for a single room was determined for each motel. The mean rate is
Amanda borrowed $8000 from two sources: her parents and a credit union. Her parents charged 3% simple interest and the credit union charged 4% simple interest.
City Cabs charges a $2.50 pickup fee and $1.25 per mile traveled. Diego's fare for a cross-town cab ride is $16.25. How far did he travel in the cab? Diego trav
Scarlet Letter Chapters 3 and 4 Choose a symbol that has been introduced. Create a poster (or slide) for this symbol. On the poster it must include: • The name
What fraction of this shape is shaded?
Based on the graph of z (x), what is the value of z-¹ (-2)?​
what is the slope of the line
Got a test on Monday pls help :)
How would I find the internal and external volume of something like this?