Today we'll be answering age-old questions, like why is the sky blue, where do tax rates come from, and more importantly, what is 1+2+...+1000
?
For example, in JavaScript:
// Input Variables
var cutoff = 1000;
// Let's calculate the answer
var sum = 0;
for (var x=1; x <= 1000; ++x){
sum += x;
}
// Let's format the message
var message = "The total of 1+2+...+"+cutoff+
" is "+sum+
".";
// And let's output the message and be done
console.log(message);
cutoff
variable to 2000
. Demonstrate your answer with screenshots.For each of the following, demonstrate your answer with screenshots.
2*2*...
). Using your new "power calculator," what is the value of 3 to the 16th power?1915+1683+1000_1798+2000+1324
.