Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago