Question: In CupCarbon IoT simulator. Create a new script file for example 2 to calculate the sum of integers 1, 2, 3, , 99, 100 and

In CupCarbon IoT simulator. Create a new script file for example 2 to calculate the sum of integers 1, 2, 3, , 99, 100 and print the result 5050.0. You should create a loop to do that.

In CupCarbon IoT simulator. Create a new script file for example 2

Example 2: Calculate a+b This example shows how to calculate the sum of two variables a and b. Repeat all the steps of Example 1 where only the script must be changed as follows: Loop set a 7 set b 8 plus x $a $b print a + b = $x stop The simulation result will display a + b = 15. - addition SITO > a+b 15.0 If we replace the print command with the following command: print $a + $b - $x The simulation result will display 7 + 8 = 15. . 2 7.15 addition2 St[0] > 7+8 15.0 Simulation Speed 1000 ms Test with this script (with a simulation speed of 1000): set a 7 loop for bo 11 mult x $a $b print $a x $b - $x delay 1000 end Example 2: Calculate a+b This example shows how to calculate the sum of two variables a and b. Repeat all the steps of Example 1 where only the script must be changed as follows: Loop set a 7 set b 8 plus x $a $b print a + b = $x stop The simulation result will display a + b = 15. - addition SITO > a+b 15.0 If we replace the print command with the following command: print $a + $b - $x The simulation result will display 7 + 8 = 15. . 2 7.15 addition2 St[0] > 7+8 15.0 Simulation Speed 1000 ms Test with this script (with a simulation speed of 1000): set a 7 loop for bo 11 mult x $a $b print $a x $b - $x delay 1000 end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!