https://script.spoken-tutorial.org/api.php?action=feedcontributions&user=Pratham920&feedformat=atomScript | Spoken-Tutorial - User contributions [en]2024-03-29T07:18:51ZUser contributionsMediaWiki 1.23.17https://script.spoken-tutorial.org/index.php/Python-3.4.3/C2/Other-Types-Of-Plots/EnglishPython-3.4.3/C2/Other-Types-Of-Plots/English2017-09-05T12:09:33Z<p>Pratham920: </p>
<hr />
<div>'''lPython/C2/Other-types-of-plots/English'''<br />
<br />
<br />
'''Title of script''': '''Other types of plots. '''<br />
<br />
'''Author: Anoop Jacob Thomas, Thirumalesh H S'''<br />
<br />
'''Keywords: Python, IPython, pylab, scatter plot, loglog plot, video tutorial'''<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''Visual Cue'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''Narration'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show slide <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Hello friends. Welcome to the tutorial on '''Other types of plots'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show slide <br />
<br />
Learning Objectives <br />
<br />
* Create '''scatter plot'''<br />
* Create''' log-log plots'''<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| At the end of this tutorial, you will be able to - <br />
<br />
* Create '''scatter plot'''<br />
* Create''' log-log plots'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show slide<br />
<br />
System Specifications <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To record this tutorial, I am using <br />
<br />
* '''Ubuntu Linux 14.04''' operating system<br />
* '''Python 3.4.3'''<br />
* '''IPython 5.1.0'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show slide<br />
<br />
Pre-requisites<br />
<br />
* run basic '''Python''' '''commands''' on the '''ipython''' '''console'''<br />
* Load''' data '''from''' files '''and <br />
* '''Plot data'''.<br />
<br />
If not, see the relevant '''Python''' tutorials on http://spoken-tutorial.org<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To practice this tutorial, you should know how to<br />
<br />
* run basic '''Python''' '''commands''' on the '''ipython''' '''console'''<br />
* Load''' data '''from''' files '''and <br />
* '''Plot data'''.<br />
<br />
If not, see the relevant '''Python''' tutorials on this website.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Terminal]<br />
<br />
'''ipython3'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us first open the '''Terminal '''by pressing '''Ctrl+Alt+T '''keys simultaneously. <br />
<br />
<br />
Now, type '''ipython3''' and press '''Enter'''. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython console]<br />
<br />
'''%pylab '''and press '''Enter.'''<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us initialise the '''pylab''' package.<br />
<br />
<br />
Type ''percent '''''pylab '''and press''' Enter.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
'''Scatter plot'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| In a '''scatter''' '''plot''', the data is displayed as a collection of points. <br />
<br />
<br />
Each point determines its position on the x and y axes <br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Exercise 1<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| * Plot a '''scatter''' '''plot''' showing the percentage profit of a company A from the year 2000 to 2010. <br />
<br />
* The data for the same is available in the '''file''' '''company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt'''.<br />
<br />
* '''company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt''' file is available in the code file link of this tutorial. <br />
<br />
* Please download and use it.<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| In terminal type:<br />
<br />
cat '''company-a-data.txt'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Let us see the content of the file '''company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt'''.<br />
<br />
So type,<br />
<br />
'''cat company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt'''.''' '''and''' press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show cat '''company-a-data.txt '''output<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| The data file has two columns with a set of values in each column.<br />
<br />
<br />
The first column represents the years. And the second column represents the profit percentage.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
'''year, profit = loadtxt('company-a-data.txt', unpack = True)'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To produce the scatter plot, <br />
<br />
<br />
we first need to load the data from the file using '''loadtxt''' command.<br />
<br />
Type<br />
<br />
<br />
'''year '''''comma''''' profit '''''equal to''''' loadtxt '''''within parentheses within single quotes '''''company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt '''''after single quotes comma''''' unpack '''''comma''''' True '''and''' Press Enter'''<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Highlight '''unpack = True'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''unpack '''''equal to''''' True returns''' the '''transposed array '''of '''data'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
'''scatter()''' function<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''scatter() function''' is used to generate the '''scatter''' '''graph''' <br />
<br />
<br />
Syntax: '''scatter '''''within parentheses '''''x '''''comma '''''y'''<br />
<br />
* '''x '''is''' '''a sequence of data<br />
* '''y '''is''' '''a sequence of data having the same length of '''x'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
'''scatter(year, profit)'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Let us use '''scatter function '''to '''plot scatter graph '''for data stored in '''year '''and''' profit. '''<br />
<br />
<br />
Type '''scatter '''''within parentheses''''' year '''''comma''''' profit''' and press '''Enter.'''<br />
<br />
<br />
Notice that we passed two arguments to '''scatter() '''function.<br />
<br />
First one being the values in x-coordinate that is '''year.'''<br />
<br />
<br />
Second, the values in y-coordinate, the '''profit''' '''percentages'''.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Exercise<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Pause the video here, try out the following exercise and resume the video.<br />
<br />
<br />
Read the documentation of scatter.<br />
<br />
<br />
'''Plot''' a scatter plot of same data in '''company '''''hyphen '''''a '''''hyphen '''''data '''''dot '''''txt''' with red diamond markers.<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
'''clf()'''<br />
<br />
'''scatter(year,profit,color='r',marker='d')'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Solution to Exercise<br />
<br />
<br />
Clear the '''plot window '''by typing '''clf parentheses '''and press '''Enter'''<br />
<br />
<br />
Now type <br />
<br />
'''scatter '''''within parentheses '''''year '''''comma '''''profit '''''comma '''''color '''''equal to within single quotes '''''r '''''comma '''''marker '''''equal to within single quotes '''''d '''and '''press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Thus, we got our scatter plot. <br />
<br />
<br />
Now let us see another kind of plot.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
'''log-log '''graph<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| * A '''log-log plot''' is a two-dimensional graph of numerical data.<br />
* It uses '''logarithmic''' '''scales''' on both '''axes'''.<br />
* Graph appears as straight line due to non-linear scaling<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
'''loglog() function'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''Syntax'''<br />
<br />
'''loglog '''''within parentheses '''''x '''''comma''''' y'''<br />
<br />
* '''x '''is''' '''a sequence of data<br />
* '''y '''is''' '''a sequence of data, having the same length of '''x'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Exercise 3<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Plot a '''log-log''''' '''''chart''' of '''y '''''equal to''''' 5 times x cube''' for '''x''' from 1 to 20.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
'''x = linspace(1,20,100)'''<br />
<br />
'''y = 5*x**3'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Before we actually plot, let us calculate the points needed for that. <br />
<br />
<br />
Type''' '''<br />
<br />
'''x '''''equalto '''''linspace '''''within parentheses''''' 1 '''''comma '''''20 '''''comma '''''100 '''and''' press Enter'''<br />
<br />
Then''', y '''''equal to '''''5 '''''into''''' x '''''raised to''''' 3''' and''' press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
'''clf()'''<br />
<br />
'''loglog(x,y)'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Clear the '''plot window '''by typing '''clf '''parentheses and '''press Enter'''<br />
<br />
<br />
Type '''loglog '''''within parentheses '''''x '''''comma '''''y '''and '''press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We see the required plot<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Summary <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| This brings us to the end of this tutorial. In this tutorial we learnt to,<br />
<br />
<br />
# Plot a '''scatter''' '''plot''' using '''scatter()''' function<br />
<br />
# Plot a '''log-log graph''' using '''loglog()''' function<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Assignment<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Here are some self assessment questions for you to solve.<br />
<br />
# '''scatter '''''within parentheses '''''x '''''comma''''' y '''''comma''''' color '''''equal to within single quotes '''''blue '''''comma''''' marker '''''equal to within single quotes '''''d''' <br />
<br />
and '''plot '''''within parentheses '''''x '''''comma''''' y '''''comma''''' color '''''equal to within single quotes '''''b '''''comma''''' marker '''''equal to within single quotes '''''d'''does exactly the same.?<br />
<br />
* True or False<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Solution to assignment<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| And the answer,<br />
<br />
# '''False'''. Both functions do not produce the same kind of plot.<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Forum<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Please post your timed queries in this forum.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Fossee Forum<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Please post your general queries on Python in this forum.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Textbook Companion<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| FOSSEE team coordinates the TBC project.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Acknowledgment<br />
<br />
http://spoken-tutorial.org<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Spoken Tutorial Project is funded by NMEICT, MHRD, Govt. of India.<br />
<br />
For more details, visit this website.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Previous slide<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| This is _________ from IIT Bombay (or FOSSEE, if you wish) signing off.<br />
<br />
Thank you.<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Python-3.4.3/C2/Plotting-Data/EnglishPython-3.4.3/C2/Plotting-Data/English2017-09-04T08:14:50Z<p>Pratham920: </p>
<hr />
<div>'''Python/C2/Plotting data /English'''<br />
<br />
<br />
'''Title of script''': '''Plotting data '''<br />
<br />
'''Author: Aditya Palaparthy'''<br />
<br />
'''Keywords: Python, IPython,''' '''plot, title, errorbar, video tutorial'''<br />
{| style="border-spacing:0;"<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| <center>'''Visual Cue'''</center><br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| <center>'''Narration'''</center><br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
containing title, name of the production team along with the logo of MHRD <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Hello Friends. Welcome to the tutorial on "'''Plotting data '''". <br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Objectives <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| In this tutorial, we will learn about<br />
<br />
<br />
* Define a '''list''' of '''numbers'''. <br />
* Perform '''element-wise''' squaring of the list. <br />
* '''Plot''' '''data points'''. <br />
* '''Plot''' '''errorbars'''. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| System Requirements <br />
<br />
Ubuntu Linux 14.04<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To record this tutorial, I am using <br />
<br />
* '''Ubuntu Linux 14.04''' operating system<br />
* '''Python 3.4.3'''<br />
* '''IPython 5.1.0'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Pre-requisites <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To practise this tutorial, you should know how to <br />
<br />
* run basic '''Python '''commands on the '''ipython console'''<br />
* use '''Plots''' interactively<br />
* Embellish a '''plot'''<br />
<br />
If not, see the relevant '''Python '''tutorials on this website.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [Terminal]<br />
<br />
'''ipython3'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us first open the '''Terminal '''by pressing '''Ctrl+Alt+T '''keys simultaneously. <br />
<br />
<br />
Now, type '''ipython3''' and press '''Enter'''. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython console]<br />
<br />
'''%pylab '''and press '''Enter.'''<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us initialise the '''pylab''' package.<br />
<br />
<br />
Type '''%pylab '''and press''' Enter.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Example - Simple Pendulum <br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us see an example for plotting the data related to a Simple Pendulum.<br />
<br />
<br />
For a '''simple pendulum''' L is '''directly proportional''' to the '''square''' of '''time''' T. <br />
<br />
<br />
We will be '''plotting''' '''L''' and '''T square values'''. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show slide<br />
<br />
Simple Pendulum Data <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us use the data shown here for plotting.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''l = [0.1, 0.2, 0.3, 0.4, 0.5,0.6, 0.7, 0.8, 0.9] '''<br />
<br />
<br />
'''t= [0.69, 0.90, 1.19,1.30, 1.47, 1.58, 1.77, 1.83, 1.94]'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| First let us initiate ''''l'''' and ''''t' values'''. <br />
<br />
We initiate them as '''sequence''' of '''values'''. This is also called as '''List'''.<br />
<br />
Type <br />
<br />
l''' '''''equal to ''within square brackets ''values ''and press''' Enter'''<br />
<br />
t''' '''''equal to ''within square brackets the ''values ''and press''' Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
'''tsquare=square(t) '''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Now we will obtain '''square''' of '''t '''by using '''function''' '''square'''. <br />
<br />
Type <br />
<br />
'''tsquare=square '''within parentheses''' t '''and press''' Enter'''<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''tsquare'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Now type<br />
<br />
'''tsquare and press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| show array in terminal<br />
<br />
<br />
'''array([ 0.4761, 0.81 , 1.4161, 1.69 , 2.1609, 2.4964, 3.1329,'''<br />
<br />
'''3.3489, 3.7636])'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We see the values of '''tsquare'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''plot(l,tsquare,'.') '''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Now to '''plot L versus T square''', we will simply type <br />
<br />
'''plot '''within parentheses''' I '''''comma '''''tsquare '''''comma'' within single quotes '''dot '''and press''' Enter '''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show the plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We see the required plot.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''clf() '''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| You can also specify ''''o'''' for '''filled circles'''.<br />
<br />
<br />
For this let us clear the '''plot''' first. <br />
<br />
<br />
Type '''clf parentheses Enter'''<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| So the plot is clear now<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''plot(l,tsquare,'o')'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Now type,<br />
<br />
'''plot '''within parentheses''' I '''''comma '''''tsquare '''''comma'' within single quotes '''o '''and press''' Enter'''<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We see the plot with filled circles<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Exercise 1 <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Pause the video. Try this exercise and then resume the video<br />
<br />
<br />
'''Plot''' the given '''experimental data''' with '''large dots'''. The '''data''' is on your screen. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Exercise 1 data <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Use the error data given here for plotting.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''delta_l= [0.08,0.09,0.07,0.05,0.06,0.00,0.06,0.06,0.01] '''<br />
<br />
'''delta_t= [0.04,0.08,0.03,0.05,0.03,0.03,0.04,0.07,0.08]'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We shall again '''initialize''' the '''sequence values''' in the same manner as we did for l and t. <br />
<br />
<br />
Type '''delta underscore l '''within square bracket the''''' '''values ''and press '''Enter'''<br />
<br />
'''delta underscore t '''within square bracket the''''' '''values ''and press '''Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''errorbar(l,tsquare,xerr=delta_l, yerr=delta_t, fmt='bo') '''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Now to plot L versus T square with an '''error bar,''' we use the '''function''' '''errorbar()'''. <br />
<br />
So type, <br />
<br />
errorbar within parentheses '''I '''''comma '''''tsquare '''''comma '''''xerr '''''equalto '''''delta underscore I '''''comma '''''y underscore err '''''equalto '''''delta underscore t '''''comma '''''fmt= '''within single quotes '''bo '''<br />
<br />
'''and press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We see plot L versus T square with an '''error bar'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''errorbar? '''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| You can explore other options of '''errorbar''' using the '''documentation''' of '''errorbar'''. <br />
<br />
That is, '''errorbar ''question mark'''''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Exercise 2 <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Pause the video. Try this exercise and then resume the video.<br />
<br />
<br />
'''Plot''' the given '''experimental data '''with '''small dots'''. Also include the '''error''' in your '''plot'''. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Exercise 2 data <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Use the data given here for plotting.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Summary slide <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| This brings us to the end of this '''tutorial'''. In this '''tutorial''', we have learned to, <br />
<br />
<br />
# Declare a '''list''' of '''numbers''' using the '''function''' '''array'''. <br />
<br />
# Perform '''element-wise''' '''squaring''' using the '''square''' '''function'''. <br />
# Use the various '''options''' available for '''plotting''' like '''dots''',''' lines'''. <br />
# '''Plot experimental data''' such that we can also represent '''error''' by using the '''errorbar() function'''. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Evaluation<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Here are some self assessment questions for you to solve. <br />
<br />
<br />
# '''Square''' the following '''sequence'''.distance underscore values ''equalto within square brackets'' '''2.1,4.6,8.72,9.03''' <br />
# Plot L versus T in '''red pluses'''. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Solutions <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| And the answers, <br />
<br />
<br />
1.To square a sequence of values, we use the function square <br />
<br />
square ''within parentheses'' distance underscore values<br />
<br />
2. We pass an additional argument stating the desired parameter <br />
<br />
plot within parentheses L ''comma'' T ''comma'' within single quotes r ''plus'' for red pluses<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Forum <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Please post your timed queries in this forum.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Fossee Forum <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Please post your general queries on Python in this forum.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Textbook Companion <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| FOSSEE team coordinates the TBC project.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Acknowledgement <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Spoken-tutorial is funded by NMEICT, MHRD, Govt. of India. <br />
<br />
For more details, visit this website.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Thank You<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| This is underscore ________ from IIT Bombay signing off.<br />
<br />
Thank You<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Python-3.4.3/C2/Other-Types-Of-Plots/EnglishPython-3.4.3/C2/Other-Types-Of-Plots/English2017-08-01T00:02:34Z<p>Pratham920: Created page with "'''lPython/C2/Other-types-of-plots/English''''''Title of script''': '''Other types of plots. ''' '''Author: Anoop Jacob Thomas, Thirumalesh H S''' '''Keywords: Python, IPyth..."</p>
<hr />
<div>'''lPython/C2/Other-types-of-plots/English''''''Title of script''': '''Other types of plots. '''<br />
<br />
'''Author: Anoop Jacob Thomas, Thirumalesh H S'''<br />
<br />
'''Keywords: Python, IPython, pylab, scatter plot, loglog plot, video tutorial'''<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''Visual Cue'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''Narration'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show slide <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Hello friends. Welcome to the tutorial on '''Other types of plots'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show slide <br />
<br />
Learning Objectives <br />
<br />
* Create '''scatter plot'''<br />
* Create''' log-log plots'''<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| At the end of this tutorial, you will be able to - <br />
<br />
* Create '''scatter plot'''<br />
* Create''' log-log plots'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show slide<br />
<br />
System Specifications <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To record this tutorial, I am using <br />
<br />
* '''Ubuntu Linux 14.04''' operating system<br />
* '''Python 3.4.3'''<br />
* '''IPython 5.1.0'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show slide<br />
<br />
Pre-requisites<br />
<br />
* run basic '''Python''' '''commands''' on the '''ipython''' '''console'''<br />
* Load''' data '''from''' files '''and <br />
* '''Plot data'''.<br />
<br />
If not, see the relevant '''Python''' tutorials on http://spoken-tutorial.org<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To practice this tutorial, you should know how to<br />
<br />
* run basic '''Python''' '''commands''' on the '''ipython''' '''console'''<br />
* Load''' data '''from''' files '''and <br />
* '''Plot data'''.<br />
<br />
If not, see the relevant '''Python''' tutorials on this website.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Terminal]<br />
<br />
'''ipython3'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us first open the '''Terminal '''by pressing '''Ctrl+Alt+T '''keys simultaneously. <br />
<br />
<br />
Now, type '''ipython3''' and press '''Enter'''. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython console]<br />
<br />
'''%pylab '''and press '''Enter.'''<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us initialise the '''pylab''' package.<br />
<br />
<br />
Type '''%pylab '''and press''' Enter.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
'''Scatter plot'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| In a '''scatter''' '''plot''', the data is displayed as a collection of points. <br />
<br />
<br />
Each point determines its position on the x and y axes <br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Exercise 1<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| * Plot a '''scatter''' '''plot''' showing the percentage profit of a company A from the year 2000-2010. <br />
<br />
* The data for the same is available in the '''file''' '''company-a-data.txt'''.<br />
<br />
* '''company-a-data.txt''' file is available in the code file link of this tutorial. <br />
<br />
* Please download and use it.<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| In terminal type:<br />
<br />
cat '''company-a-data.txt'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Let us see the content of the file '''company-a-data.txt'''<br />
<br />
<br />
'''cat company-a-data.txt '''and''' press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show cat '''company-a-data.txt '''output<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| The data file has two columns with a set of values in each column.<br />
<br />
<br />
The column line represents the years. The column line represents the profit percentage.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
'''year, profit = loadtxt('company-a-data.txt', unpack = True)'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To produce the scatter plot, <br />
<br />
<br />
we first need to load the data from the file using '''loadtxt''' command.<br />
<br />
Type<br />
<br />
<br />
'''year '''''comma''''' profit '''''equal to''''' loadtxt '''''within parentheses within single quotes '''''company-a-data.txt '''''after single quotes comma''''' unpack '''''comma''''' True '''and''' Press Enter'''<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Highlight '''unpack = True'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''unpack '''''equal to''''' True returns''' the '''transposed array '''of '''data'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
'''scatter()''' function<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''scatter() function''' is used to generate the '''scatter''' '''graph''' <br />
<br />
<br />
Syntax: '''scatter '''''within parentheses '''''x '''''comma '''''y'''<br />
<br />
* '''x '''is''' '''a sequence of data<br />
* '''y '''is''' '''a sequence of data having same length of '''x'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
'''scatter(year, profit)'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Let us use '''scatter() function '''to '''plot scatter graph '''for data stored in '''year '''and''' profit. '''<br />
<br />
<br />
Type '''scatter '''''within parentheses''''' year '''''comma''''' profit''' and press '''Enter.'''<br />
<br />
<br />
Notice that we passed two arguments to '''scatter() '''function.<br />
<br />
First one being the values in x-coordinate – '''year.'''<br />
<br />
<br />
Second, the values in y-coordinate, the '''profit''' '''percentages'''.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Exercise<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Pause the video here, try out the following exercise and resume the video.<br />
<br />
<br />
Read the documentation of scatter.<br />
<br />
<br />
'''Plot''' a scatter plot of same data in '''company-a-data.txt''' with red diamond markers.<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
'''clf()'''<br />
<br />
'''scatter(year,profit,color='r',marker='d')'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Solution to Exercise<br />
<br />
<br />
Clear the '''plot window '''by typing '''clf parentheses '''and press '''Enter'''<br />
<br />
<br />
Now type <br />
<br />
'''scatter '''''within parentheses '''''year '''''comma '''''profit '''''comma '''''color '''''equal to within single quotes '''''r '''''comma '''''marker '''''equal to within single quotes '''''d '''and '''press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Thus, we got our scatter plot. <br />
<br />
<br />
Now let us see another kind of plot.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
'''log-log '''graph<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| * A '''log-log plot''' is a two-dimensional graph of numerical data.<br />
* It uses '''logarithmic''' '''scales''' on both '''axes'''.<br />
* Graph appears as straight line due to non-linear scaling<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
'''loglog() function'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''Syntax'''<br />
<br />
'''loglog '''''within parentheses '''''x '''''comma''''' y'''<br />
<br />
* '''x '''is''' '''a sequence of data<br />
* '''y '''is''' '''a sequence of data, having the same length of '''x'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Exercise 3<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Plot a '''log-log''''' '''''chart''' of '''y '''''equal to''''' 5 times x(cube)''' for '''x''' from 1 to 20.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
'''x = linspace(1,20,100)'''<br />
<br />
'''y = 5*x**3'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Before we actually plot, let us calculate the points needed for that. <br />
<br />
<br />
Type''' '''<br />
<br />
'''x = linspace '''''within parentheses''''' 1 '''''comma '''''20 '''''comma '''''100 '''and''' press Enter'''<br />
<br />
'''y '''''equal to '''''5 '''''into''''' x '''''raised to''''' 3''' and''' press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
'''clf()'''<br />
<br />
'''loglog(x,y)'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Clear the '''plot window '''by typing '''clf '''parentheses and '''press Enter'''<br />
<br />
<br />
Type '''loglog '''''within parentheses '''''x '''''comma '''''y '''and '''press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We see the required plot<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Summary <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| This brings us to the end of this tutorial. In this tutorial we learnt to,<br />
<br />
<br />
# Plot a '''scatter''' '''plot''' using '''scatter()''' function<br />
<br />
# Plot a '''log-log graph''' using '''loglog()''' function<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Assignment<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Here are some self assessment questions for you to solve.<br />
<br />
# '''scatter '''''within parentheses '''''x '''''comma''''' y '''''comma''''' color '''''equal to within single quotes '''''blue '''''comma''''' marker '''''equal to within single quotes '''''d''' <br />
<br />
and '''plot '''''within parentheses '''''x '''''comma''''' y '''''comma''''' color '''''equal to within single quotes '''''b '''''comma''''' marker '''''equal to within single quotes '''''d'''does exactly the same.?<br />
<br />
* True<br />
* False<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Solution to assignment<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| And the answers,<br />
<br />
# '''False'''. Both functions do not produce the same kind of plot.<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Forum<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Please post your timed queries in this forum.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Fossee Forum<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Please post your general queries on Python in this forum.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Textbook Companion<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| FOSSEE team coordinates the TBC project.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Acknowledgment<br />
<br />
http://spoken-tutorial.org<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Spoken Tutorial Project is funded by NMEICT, MHRD, Govt. of India.<br />
<br />
For more details, visit this website.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Previous slide<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| This is _________ from IIT Bombay (or FOSSEE, if you wish) signing off.<br />
<br />
Thank you.<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Python-3.4.3/C2/Plotting-Data/EnglishPython-3.4.3/C2/Plotting-Data/English2017-07-31T09:53:18Z<p>Pratham920: Created page with "'''Python/C2/Plotting data /English''' '''Title of script''': '''Plotting data ''' '''Author: Aditya Palaparthy''' '''Keywords: Python, IPython,''' '''plot, title, errorbar'..."</p>
<hr />
<div>'''Python/C2/Plotting data /English''' '''Title of script''': '''Plotting data '''<br />
<br />
'''Author: Aditya Palaparthy'''<br />
<br />
'''Keywords: Python, IPython,''' '''plot, title, errorbar'''<br />
{| style="border-spacing:0;"<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| <center>'''Visual Cue'''</center><br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| <center>'''Narration'''</center><br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
containing title, name of the production team along with the logo of MHRD <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Hello Friends. Welcome to the tutorial on "'''Plotting data '''". <br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Objectives <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| In this tutorial, we will learn about<br />
<br />
<br />
* Define a '''list''' of '''numbers'''. <br />
* Perform '''element-wise''' squaring of the list. <br />
* '''Plot''' '''data points'''. <br />
* '''Plot''' '''errorbars'''. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| System Requirements <br />
<br />
Ubuntu Linux 14.04<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To record this tutorial, I am using <br />
<br />
* '''Ubuntu Linux 14.04''' operating system<br />
* '''Python 3.4.3'''<br />
* '''IPython 5.1.0'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Pre-requisites <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| To practise this tutorial, you should know how to <br />
<br />
* run basic '''Python '''commands on the '''ipython console'''<br />
* use '''Plots''' interactively<br />
* Embellish a '''plot'''<br />
<br />
If not, see the relevant '''Python '''tutorials on this website.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [Terminal]<br />
<br />
'''ipython3'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us first open the '''Terminal '''by pressing '''Ctrl+Alt+T '''keys simultaneously. <br />
<br />
<br />
Now, type '''ipython3''' and press '''Enter'''. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython console]<br />
<br />
'''%pylab '''and press '''Enter.'''<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us initialise the '''pylab''' package.<br />
<br />
<br />
Type '''%pylab '''and press''' Enter.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Example - Simple Pendulum <br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us see an example for plotting the data related to a Simple Pendulum.<br />
<br />
<br />
For a '''simple pendulum''' L is '''directly proportional''' to the '''square''' of '''time''' T. <br />
<br />
<br />
We will be '''plotting''' '''L''' and '''T^2 values'''. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show slide<br />
<br />
Simple Pendulum Data <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us use the data shown here for plotting.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''l = [0.1, 0.2, 0.3, 0.4, 0.5,0.6, 0.7, 0.8, 0.9] '''<br />
<br />
<br />
'''t= [0.69, 0.90, 1.19,1.30, 1.47, 1.58, 1.77, 1.83, 1.94]'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| First let us initiate ''''l'''' and ''''t' values'''. <br />
<br />
We initiate them as '''sequence''' of '''values'''. This is also called as '''List'''.<br />
<br />
Type <br />
<br />
l''' '''''equal to ''within square brackets ''values ''and press''' Enter'''<br />
<br />
t''' '''''equal to ''within square brackets the ''values ''and press''' Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
'''tsquare=square(t) '''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Now we will obtain '''square''' of '''t '''by using '''function''' '''square'''. <br />
<br />
Type <br />
<br />
'''tsquare=square '''within parentheses''' t '''and press''' Enter'''<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''tsquare'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Now type<br />
<br />
'''tsquare and press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| show array in terminal<br />
<br />
<br />
'''array([ 0.4761, 0.81 , 1.4161, 1.69 , 2.1609, 2.4964, 3.1329,'''<br />
<br />
'''3.3489, 3.7636])'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We see the values of '''tsquare'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''plot(l,tsquare,'.') '''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Now to '''plot L v/s T^2''', we will simply type <br />
<br />
'''plot '''within parentheses''' I '''''comma '''''tsquare '''''comma'' within single quotes '''dot '''and press''' Enter '''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show the plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We see the required plot.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''clf() '''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| You can also specify ''''o'''' for '''filled circles'''.<br />
<br />
<br />
For this let us clear the '''plot''' first. <br />
<br />
<br />
Type '''clf parentheses Enter'''<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| So the plot is clear now<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| '''plot(l,tsquare,'o')'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Now type,<br />
<br />
'''plot '''within parentheses''' I '''''comma '''''tsquare '''''comma'' within single quotes '''o '''and press''' Enter'''<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We see the plot with filled circles<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Exercise 1 <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Pause the video. Try this exercise and then resume the video<br />
<br />
<br />
'''Plot''' the given '''experimental data''' with '''large dots'''. The '''data''' is on your screen. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Exercise 1 data <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Use the error data given here for plotting.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''delta_l= [0.08,0.09,0.07,0.05,0.06,0.00,0.06,0.06,0.01] '''<br />
<br />
'''delta_t= [0.04,0.08,0.03,0.05,0.03,0.03,0.04,0.07,0.08]'''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We shall again '''initialize''' the '''sequence values''' in the same manner as we did for l and t. <br />
<br />
<br />
Type '''delta_l '''within square bracket the''''' '''values ''and press '''Enter'''<br />
<br />
'''delta_t '''within square bracket the''''' '''values ''and press '''Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''errorbar(l,tsquare,xerr=delta_l, yerr=delta_t, fmt='bo') '''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Now to plot L versus T^2 with an '''error bar,''' we use the '''function''' '''errorbar()'''. <br />
<br />
So type, <br />
<br />
errorbar within parentheses '''I '''''comma '''''tsquare '''''comma '''''xerr '''''equalto '''''delta_I '''''comma '''''y_err '''''equalto '''''delta_t '''''comma '''''fmt= '''within single quotes '''bo '''<br />
<br />
'''and press Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show plot window<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| We see plot L versus T^2 with an '''error bar'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| [Ipython Terminal]<br />
<br />
<br />
'''errorbar? '''<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| You can explore other options of '''errorbar''' using the '''documentation''' of '''errorbar'''. <br />
<br />
That is, '''errorbar ''question mark'''''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Exercise 2 <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Pause the video. Try this exercise and then resume the video.<br />
<br />
<br />
'''Plot''' the given '''experimental data '''with '''small dots'''. Also include the '''error''' in your '''plot'''. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Exercise 2 data <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Use the data given here for plotting.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Summary slide <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| This brings us to the end of this '''tutorial'''. In this '''tutorial''', we have learned to, <br />
<br />
<br />
# Declare a '''list''' of '''numbers''' using the '''function''' '''array'''. <br />
<br />
# Perform '''element-wise''' '''squaring''' using the '''square''' '''function'''. <br />
# Use the various '''options''' available for '''plotting''' like '''dots''',''' lines'''. <br />
# '''Plot experimental data''' such that we can also represent '''error''' by using the '''errorbar() function'''. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Evaluation<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Here are some self assessment questions for you to solve. <br />
<br />
<br />
# '''Square''' the following '''sequence'''.distance_values ''equalto within square brackets'' '''2.1,4.6,8.72,9.03''' <br />
<br />
# Plot L versus T in '''red pluses'''. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Solutions <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| And the answers, <br />
<br />
<br />
1.To square a sequence of values, we use the function square <br />
<br />
square ''within parentheses'' distance_values<br />
<br />
2. We pass an additional argument stating the desired parameter <br />
<br />
plot within parentheses L ''comma'' T ''comma'' within single quotes r ''plus'' for red pluses<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Forum <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Please post your timed queries in this forum.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Fossee Forum <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Please post your general queries on Python in this forum.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Textbook Companion <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| FOSSEE team coordinates the TBC project.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Acknowledgement <br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Spoken-tutorial is funded by NMEICT, MHRD, Govt. of India. <br />
<br />
For more details, visit this website.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Thank You<br />
| style="background-color:#ffffff;border:0.5pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.097cm;padding-right:0.191cm;"| This is _________ from IIT Bombay signing off.<br />
<br />
Thank You<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Python-3.4.3/C2/Loading-Data-From-Files/EnglishPython-3.4.3/C2/Loading-Data-From-Files/English2017-07-26T10:57:38Z<p>Pratham920: Created page with "Loading data from files - English '''Title of script: Loading data files from files''' '''Author: Ankit''' '''Keywords: video tutorial, read data, files, loadtxt, ipython'..."</p>
<hr />
<div>Loading data from files - English<br />
<br />
<br />
'''Title of script: Loading data files from files'''<br />
<br />
'''Author: Ankit'''<br />
<br />
'''Keywords: video tutorial, read data, files, loadtxt, ipython'''<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| <center>'''Visual Cue'''</center><br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| <center>'''Narration'''</center><br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide <br />
<br />
containing title, name of the production team along with the logo of MHRD <br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Hello Friends and Welcome to the spoken tutorial on '''"loading data from files".'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Learning objectives<br />
<br />
Read data from files, which contain data in:<br />
<br />
* Single column format <br />
<br />
* Multiple columns separated by spaces or other delimiters<br />
<br />
<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| In this tutorial you will learn to,<br />
<br />
Read data from files, which contain data in:<br />
<br />
* Single column format <br />
<br />
Or<br />
<br />
* Multiple columns separated by spaces or other delimiters<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide <br />
<br />
System Requirements <br />
<br />
* '''Ubuntu Linux 14.04'''<br />
<br />
<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| To record this tutorial, I am using <br />
<br />
* '''Ubuntu Linux 14.04''' operating system<br />
* '''Python 3.4.3'''<br />
* '''IPython 5.1.0'''<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Pre-requisites<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| You should know how to run basic '''Python''' commands on the '''ipython console.'''<br />
<br />
<br />
If not, for relevant Python tutorials, please visit this website [http://spoken-tutorial.org/ http://spoken-tutorial.org]<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [Terminal]<br />
<br />
'''ipython3'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us first open the '''Terminal '''by pressing '''Ctrl+Alt+T '''keys simultaneously. <br />
<br />
<br />
Now, type '''ipython3''' and press '''Enter'''. <br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython console]<br />
<br />
'''%pylab '''and press '''Enter.'''<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us initialise the '''pylab''' package.<br />
<br />
<br />
Type '''%pylab '''and press''' Enter.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| <br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| <br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
Type<br />
<br />
'''cat primes.txt'''<br />
<br />
and press Enter<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us begin with reading the file''' primes.txt'''. This file contains a list of prime numbers listed in a column.<br />
<br />
<br />
Type'' '''''cat'''''(space)'''''primes'''''(dot)'''''txt''''' ''<br />
<br />
We can use the''' cat''' command to fetch data from the file and display it on the terminal.<br />
<br />
''press ''Enter<br />
<br />
We see the prime numbers are displayed on the terminal.<br />
<br />
|-<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
Type '''primes = loadtxt(“primes.txt”)'''<br />
<br />
and press '''Enter'''<br />
| style="background-color:#ffffff;border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Now we can use the '''loadtxt()''' command to store this list into the variable''' primes'''.<br />
<br />
<br />
Type'' '''''primes'''''(equal to)'''''loadtx'''''t(within parentheses)(within double quotes)'''''primes'''''(dot)'''''txt''''' and press''' ''Enter.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| <br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Please make sure that you provide the correct path to the file, ''''primes.txt'.'''<br />
<br />
<br />
The file, in our case, is present in the '''home''' folder.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
Type<br />
<br />
'''print(primes)''' and press '''Enter'''<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| '''primes''' is now a sequence of prime numbers, that was listed in the file, '''primes.txt'''. <br />
<br />
<br />
Now let us display the contents in the variable '''primes.'''<br />
<br />
<br />
'''So,''' type,'' '''''print'''''(within parentheses)'''''primes''''' ''to <br />
<br />
<br />
We see the sequence printed.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
Highlight the output on the terminal<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| We observe that all the numbers end with a period '''‘.’'''. <br />
<br />
<br />
This is because these numbers are '''floats.'''<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
Type<br />
<br />
'''cat pendulum.txt'''<br />
<br />
<br />
'''Highlight Cat'''<br />
<br />
<br />
and press''' Enter'''<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Type '''cat'''''(space)'''''pendulum'''''(dot)'''''txt '''<br />
<br />
<br />
Press Enter.<br />
<br />
<br />
This file contains two columns of data.<br />
<br />
<br />
This first column contains the length of the pendulum.<br />
<br />
The second column contains the corresponding time period.<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
Type<br />
<br />
'''pend=loadtxt(“pendulum.txt”)'''<br />
<br />
and press Enter<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us, now, read the data from the file into the variable''' pend''' using the''' loadtxt''' command.<br />
<br />
<br />
Type '''pend'''''(equal to)'''''loadtxt'''''(within parentheses)(within double quotes)'''''pendulum'''''(dot)'''''txt''''' ''and'' press''' Enter.'''''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| <br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Please note that '''loadtxt''' needs both the columns of the file to have equal number of rows.<br />
<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
print'''(pend)'''<br />
<br />
and press '''Enter'''<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Now print the variable''' pend''' and to see what it contains.<br />
<br />
<br />
Type'' '''''print'''''(within parentheses)'''''pend''''' ''and press''' Enter.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
Type '''L''','''T'''<nowiki>=</nowiki>'''loadtxt(“pendulum.txt”, unpack=True)'''<br />
<br />
<br />
and press Enter<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Notice that''' '''variable has two sequences containing two columns of the data file.<br />
<br />
<br />
Let us use an additional argument of the''' loadtxt''' command to read the data into two separate sequences.<br />
<br />
<br />
Type '''L'''(comma)'''T'''''(equal to)'''''loadtxt'''''(within parentheses)(inside double quotes)'''''pendulum'''''(dot)'''''txt'''''(after double quotes comma)'''''unpack'''''(equal to)'''''True''''' ''and press''''' Enter'''''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
Type print'''(L)'''<br />
<br />
print'''(T)'''<br />
<br />
and press Enter<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Now print the variables''' L''' and''' T''', to see what they contain.<br />
<br />
<br />
Type'' '''''print'''''(within parentheses)'''''L''''' ''and press''' Enter'''<br />
<br />
Type'' '''''print'''''(within parentheses)'''''T '''and press''' Enter'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Highlight the output<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Notice, that''' L''' and''' T''' now contain the first and second columns of data from the '''pendulum.txt '''respectively<br />
<br />
<br />
'''unpack(equal to)True''' has made the two columns into two separate and simple sequences.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide 4<br />
<br />
Assignment 1<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Pause the video over here and try out the following exercise and resume the video.<br />
<br />
<br />
Read the data from the file''' pendulum'''''(underscore)'''''semicolon'''''(dot)'''''txt. '''<br />
<br />
This file contains data in two columns. These columns are separated by semicolons.<br />
<br />
Use the''' IPython''' help to see how to do this.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
<br />
Type<br />
<br />
'''L, T = loadtxt(“pendulum_semicolon.txt”, unpack=True,delimiter<nowiki>=”;”</nowiki>)'''<br />
<br />
<br />
<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Let us look at the solution. Switch to the terminal.<br />
<br />
First we will see the content of the file.<br />
<br />
So type cat '''pendulum'''''(underscore)'''''semicolon'''''(dot)'''''txt'''<br />
<br />
''Press''''' Enter'''<br />
<br />
We see the two columns separated by a semi-colon.<br />
<br />
<br />
Now, type'' '''''L'''''(comma)'''''T'''''(equal to)'''''loadtxt'''''(within parentheses)(within double quotes)'''''pendulum'''''(underscore)'''''semicolon'''''(dot)'''''txt'''''(after double quotes comma)'''''unpack'''''(equal to)'''''True'''''(comma)'''''delimiter'''''(equal to)(within double quotes)'''''semicolon'''''.''<br />
<br />
And press Enter.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| [IPython Terminal]<br />
<br />
Type<br />
<br />
print'''(L)'''<br />
<br />
and press Enter<br />
<br />
[IPython Terminal]<br />
<br />
Type<br />
<br />
print'''(T)'''<br />
<br />
and press''' Enter'''<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Then Type'' '''''print'''''(within parentheses)'''''L''' and press '''Enter.'''<br />
<br />
<br />
'''print'''''(within parentheses)'''''T '''''and press'' '''Enter. '''<br />
<br />
<br />
This will display the contents inside the two variables '''L''' and '''T.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Summary slide<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| This brings us to the end of this tutorial. In this tutorial, we have learnt:<br />
<br />
To read data from files using the '''loadtxt()''' command.<br />
<br />
The data can be in <br />
<br />
# A single column format<br />
<br />
or<br />
<br />
# Multiple column format, separated by spaces or other delimiters.<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Evaluation slide<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Here are some self assessment questions for you to solve<br />
<br />
# '''loadtxt''' can read data only from a file with one column Is it True or False?<br />
# Given a file''' data.txt''' with three columns of data separated by spaces.<br />
<br />
Read it into 3 separate simple sequences.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Evaluation slide<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| # Given a file''' data.txt''' with three columns of data separated by ":"<br />
<br />
Read it into 3 separate simple sequences.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Slide <br />
<br />
Solution 1:<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Now let us look at the answers,<br />
<br />
<br />
The answer to the first question is False. <br />
<br />
<br />
The '''loadtxt() '''command can read data from files having single columns as well as multiple columns.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Slide <br />
<br />
Solution 2: <br />
<br />
<br />
<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| To separate data into three columns, we use the''' loadtxt()''' command as follows:<br />
<br />
<br />
'''x('''''equal to)'''''loadtxt'''''(within parentheses and double qu otes'')'''data'''''(dot'')''txt''(after double quotes ''comma'')'''unpack'''(equal to)'''True'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Slide <br />
<br />
<br />
Solution 3:<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| The answer to the third question is,<br />
<br />
<br />
We read into three separate sequences by using an additional argument of delimiter in the loadtxt command.<br />
<br />
<br />
'''x'''(''equal to'')'''loadtxt'''('' within parentheses, within double quotes'')'''data'''''(dot)'''''txt'''(after double quotes ''comma)'''''unpack'''''(equal to)'''''True'''''(comma)'''''delimiter'''''(equal to'')''(within double quotes)'''''semicolon'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Forum <br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Do you have questions on THIS '''Spoken Tutorial?'''<br />
<br />
Choose the minute and second where you have the question. <br />
<br />
Explain your question briefly. <br />
<br />
Someone from the '''FOSSEE''' team will answer them. <br />
<br />
Please visit this site. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Fossee Forum <br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Do you have any general / technical questions?<br />
<br />
Please visit the forum given in the link.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide <br />
<br />
Textbook Companion <br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| The '''FOSSEE '''team coordinates coding of solved examples of popular books. <br />
<br />
We give honorarium and certificates for those who do this. <br />
<br />
For more details, please visit this site. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Acknowledgment <br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| The Spoken Tutorial project is funded by NMEICT, MHRD, Govt. of India <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| Show Slide<br />
<br />
Thank You<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.032cm;padding-right:0.191cm;"| This is Prathamesh Salunke from IIT Bombay signing off. Thanks for watching.<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Digital-Divide/D0/First-Aid-on-Snake-Bite/EnglishDigital-Divide/D0/First-Aid-on-Snake-Bite/English2013-04-22T13:13:49Z<p>Pratham920: </p>
<hr />
<div>'''Title of script''': First Aid on Snake Bite<br />
<br />
'''Author : Prathamesh Salunke'''<br />
<br />
'''Keywords: video tutorial, Snake bite'''<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| '''Visual Cue'''<br />
| style="background-color:#ffffff;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| '''Narration'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children playing <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Many of you are familiar with this scene in your village-<br />
<br />
a group of children playing in an open area.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy chasing the ball<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Watch this boy, who is chasing the ball.<br />
<br />
<br />
He enters the nearby bushy area.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Snake coming out of the hide out<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| He spots a snake.<br />
<br />
<br />
In no time, it crawls out of its hide out.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy throwing stone on snake<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The scared boy tries to shoo away the snake by throwing a stone.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Snake biting the boy<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The snake does not crawl away.<br />
<br />
<br />
Instead it turns towards the boy and bites him on the foot.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy screaming and friends running towards him<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The boy screams for help.<br />
<br />
<br />
His friends runs to his side to help. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| After seeing two red spots friends are carrying him<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| They see two red spots on the foot.<br />
<br />
<br />
They carry the boy out of the bush. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children discussing<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| There is a commotion.<br />
<br />
<br />
All the children give different opinions about first aid.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Importance of first aid<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Here comes the importance of knowing the first aid in case of a snake bite. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Welcome to spoken tutorial on '''First Aid on Snake Bites.'''<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Welcome to spoken tutorial on '''First Aid on Snake Bites.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Correct first aids<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| In this tutorial we will see<br />
<br />
* How important is first aid.<br />
* How to give the correct first aid in case of a snake bite.<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children surrounding the boy<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Before moving on to the first aid instructions, <br />
<br />
<br />
we will review what the group of boys did to save their friend. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| After making the boy lie down, they bring elders who is tying a cloth around the wound<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| They made the boy lie down.<br />
<br />
<br />
And then they sought the help of elders to shift him to the hospital.<br />
<br />
<br />
Then they tied a cloth around the wound. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Was it the right first aid? <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Was it the right first aid? <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| People carrying the boy into the hospital<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Yes! In a way it is correct.<br />
<br />
<br />
In this case, the hospital was not far away.<br />
<br />
<br />
So the boy got the medical aid in time.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The correct way to give first aid in case of a snake bite is - <br />
<br />
# Make the person lie down on a flat surface. <br />
# Roll a cloth on the affected area. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The primary purpose of this first aid is to stop the poison from circulating throughout the body.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| And how should we roll the cloth around the wound? <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Start rolling from the upper portion of the leg and move downwards.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Hospital<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Shift the person quickly to the nearest hospital for further treatment.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| In this way, first aid given in time prevents many damages.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Remember, wrong first aid can make one’s condition worse.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Do's <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Do’s in case of a snake bite.<br />
<br />
- First lay the victim down<br />
<br />
- When you roll the cloth apply some pressure<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Dont's <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| And the Don’ts in case of a snake bite <br />
<br />
- Do Not Cut the skin or the flesh around the bite. <br />
<br />
- Do Not Put ice on or around the bite <br />
<br />
- Do Not Shock the person with electricity <br />
<br />
- Do Not Try to suck the blood or the venom out of the bite<br />
<br />
- Do Not Tie the cloth too tight. This could lead to gangrene.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| End <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| This video is part of the bridge the digital divide initiative of the spoken tutorial project <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial video<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"|To know more about the spoken tutorial project<br />
<br />
Watch the video available at http://spoken-tutorial.org/What_is_a_Spoken_Tutorial<br />
<br />
It summaries the Spoken Tutorial project<br />
<br />
If u do not have a good bandwidth you can download and watch it<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial Workshops<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The Spoken Tutorial project team conducts workshops using spoken tutorials. <br />
<br />
Gives certificates to those who pass an online test. <br />
<br />
For more details, please write to: <br />
<br />
contact@spoken-tutorial.org<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Acknowledgment<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial Project is a part of the Talk to a Teacher project<br />
<br />
It is Supported by the National Mission on Education through <br />
<br />
ICT, MHRD, Government of India<br />
<br />
More information on this mission is available at <br />
<br />
http://spoken-tutorial.org\NMEICT-Intro<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| About the contributors<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"|<br />
<br />
Animation is contributed by Arthi <br />
<br />
This is Prathamesh Salunke, thanks for joining<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Digital-Divide/D0/First-Aid-on-Snake-Bite/EnglishDigital-Divide/D0/First-Aid-on-Snake-Bite/English2013-04-22T12:50:59Z<p>Pratham920: </p>
<hr />
<div>'''Title of script''': First Aid on Snake Bite<br />
<br />
'''Author : Prathamesh Salunke'''<br />
<br />
'''Keywords: video tutorial, Snake bite'''<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| '''Visual Cue'''<br />
| style="background-color:#ffffff;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| '''Narration'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children playing <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Many of you are familiar with this scene in your village-<br />
<br />
a group of children playing in an open area.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy chasing the ball<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Watch this boy, who is chasing the ball.<br />
<br />
<br />
He enters the nearby bushy area.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Snake coming out of the hide out<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| He spots a snake.<br />
<br />
<br />
In no time, it crawls out of its hide out.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy throwing stone on snake<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The scared boy tries to shoo away the snake by throwing a stone.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Snake biting the boy<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The snake does not crawl away.<br />
<br />
<br />
Instead it turns towards the boy and bites him on the foot.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy screaming and friends running towards him<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The boy screams for help.<br />
<br />
<br />
His friends runs to his side to help. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| After seeing two red spots friends are carrying him<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| They see two red spots on the foot.<br />
<br />
<br />
They carry the boy out of the bush. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children discussing<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| There is a commotion.<br />
<br />
<br />
All the children give different opinions about first aid.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Importance of first aid<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Here comes the importance of knowing the first aid in case of a snake bite. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Welcome to spoken tutorial on '''First Aid on Snake Bites.'''<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Welcome to spoken tutorial on '''First Aid on Snake Bites.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Correct first aids<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| In this tutorial we will see<br />
<br />
* How important is first aid.<br />
* How to give the correct first aid in case of a snake bite.<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children surrounding the boy<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Before moving on to the first aid instructions, <br />
<br />
<br />
we will review what the group of boys did to save their friend. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| After making the boy lie down, they bring elders who is tying a cloth around the wound<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| They made the boy lie down.<br />
<br />
<br />
And then they sought the help of elders to shift him to the hospital.<br />
<br />
<br />
Then they tied a cloth around the wound. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Was it the right first aid? <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Was it the right first aid? <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| People carrying the boy into the hospital<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Yes! In a way it is correct.<br />
<br />
<br />
In this case, the hospital was not far away.<br />
<br />
<br />
So the boy got the medical aid in time.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The correct way to give first aid in case of a snake bite is - <br />
<br />
# Make the person lie down on a flat surface. <br />
# Roll a cloth on the affected area. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The primary purpose of this first aid is to stop the poison from circulating throughout the body.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| And how should we roll the cloth around the wound? <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Start rolling from the upper portion of the leg and move downwards.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Hospital<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Shift the person quickly to the nearest hospital for further treatment.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| In this way, first aid given in time prevents many damages.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Remember, wrong first aid can make one’s condition worse.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Do's <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Do’s in case of a snake bite.<br />
<br />
- First lay the victim down<br />
<br />
- When you roll the cloth apply some pressure<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Dont's <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| And the Don’ts in case of a snake bite <br />
<br />
- Do Not Cut the skin or the flesh around the bite. <br />
<br />
- Do Not Put ice on or around the bite <br />
<br />
- Do Not Shock the person with electricity <br />
<br />
- Do Not Try to suck the blood or the venom out of the bite<br />
<br />
- Do Not Tie the cloth too tight. This could lead to gangrene.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| End <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| This brings to the end of the tutorial. Remember, timely first aid saves a life. <br />
<br />
Thanking you for listening and STAY SAFE. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial video<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Watch the video available at the following link<br />
<br />
It summaries the Spoken Tutorial project<br />
<br />
If u do not have a good bandwidth you can download and watch it<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial Workshops<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The Spoken Tutorial project team conducts workshops using spoken tutorials. <br />
<br />
Gives certificates to those who pass an online test. <br />
<br />
For more details, please write to: <br />
<br />
contact@spoken-tutorial.org<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Acknowledgment<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial Project is a part of the Talk to a Teacher project<br />
<br />
It is Supported by the National Mission on Education through <br />
<br />
ICT, MHRD, Government of India<br />
<br />
More information on this mission is available at <br />
<br />
http://spoken-tutorial.org\NMEICT-Intro<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| About the contributors<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"|<br />
<br />
Animation is contributed by Arthi <br />
<br />
This is Prathamesh Salunke, thanks for joining<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Digital-Divide/D0/First-Aid-on-Snake-Bite/EnglishDigital-Divide/D0/First-Aid-on-Snake-Bite/English2013-04-22T12:46:33Z<p>Pratham920: </p>
<hr />
<div>'''Title of script''': First Aid on Snake Bite<br />
<br />
'''Author : Prathamesh Salunke'''<br />
<br />
'''Keywords: video tutorial, Snake bite'''<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| '''Visual Cue'''<br />
| style="background-color:#ffffff;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| '''Narration'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children playing <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Many of you are familiar with this scene in your village-<br />
<br />
a group of children playing in an open area.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy chasing the ball<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Watch this boy, who is chasing the ball.<br />
<br />
<br />
He enters the nearby bushy area.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Snake coming out of the hide out<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| He spots a snake.<br />
<br />
<br />
In no time, it crawls out of its hide out.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy throwing stone on snake<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The scared boy tries to shoo away the snake by throwing a stone.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Snake biting the boy<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The snake does not crawl away.<br />
<br />
<br />
Instead it turns towards the boy and bites him on the foot.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy screaming and friends running towards him<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The boy screams for help.<br />
<br />
<br />
His friends runs to his side to help. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| After seeing two red spots friends are carrying him<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| They see two red spots on the foot.<br />
<br />
<br />
They carry the boy out of the bush. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children discussing<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| There is a commotion.<br />
<br />
<br />
All the children give different opinions about first aid.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Importance of first aid<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Here comes the importance of knowing the first aid in case of a snake bite. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Welcome to spoken tutorial on '''First Aid on Snake Bites.'''<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Welcome to spoken tutorial on '''First Aid on Snake Bites.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Correct first aids<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| In this tutorial we will see<br />
<br />
* How important is first aid.<br />
* How to give the correct first aid in case of a snake bite.<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children surrounding the boy<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Before moving on to the first aid instructions, <br />
<br />
<br />
we will review what the group of boys did to save their friend. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| After making the boy lie down, they bring elders who is tying a cloth around the wound<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| They made the boy lie down.<br />
<br />
<br />
And then they sought the help of elders to shift him to the hospital.<br />
<br />
<br />
Then they tied a cloth around the wound. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Was it the right first aid? <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Was it the right first aid? <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| People carrying the boy into the hospital<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Yes! In a way it is correct.<br />
<br />
<br />
In this case, the hospital was not far away.<br />
<br />
<br />
So the boy got the medical aid in time.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The correct way to give first aid in case of a snake bite is - <br />
<br />
# Make the person lie down on a flat surface. <br />
# Roll a cloth on the affected area. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The primary purpose of this first aid is to stop the poison from circulating throughout the body.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| And how should we roll the cloth around the wound? <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Start rolling from the upper portion of the leg and move downwards.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Hospital<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Shift the person quickly to the nearest hospital for further treatment.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| In this way, first aid given in time prevents many damages.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Remember, wrong first aid can make one’s condition worse.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Do's <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Do’s in case of a snake bite.<br />
<br />
- First lay the victim down<br />
<br />
- When you roll the cloth apply some pressure<br />
<br />
- Use a piece of wood to prevent the movement of leg.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Dont's <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| And the Don’ts in case of a snake bite <br />
<br />
- Do Not Cut the skin or the flesh around the bite. <br />
<br />
- Do Not Put ice on or around the bite <br />
<br />
- Do Not Shock the person with electricity <br />
<br />
- Do Not Try to suck the blood or the venom out of the bite<br />
<br />
- Do Not Tie the cloth too tight. This could lead to gangrene.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| End <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| This brings to the end of the tutorial. Remember, timely first aid saves a life. <br />
<br />
Thanking you for listening and STAY SAFE. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial video<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Watch the video available at the following link<br />
<br />
It summaries the Spoken Tutorial project<br />
<br />
If u do not have a good bandwidth you can download and watch it<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial Workshops<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The Spoken Tutorial project team conducts workshops using spoken tutorials. <br />
<br />
Gives certificates to those who pass an online test. <br />
<br />
For more details, please write to: <br />
<br />
contact@spoken-tutorial.org<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Acknowledgment<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial Project is a part of the Talk to a Teacher project<br />
<br />
It is Supported by the National Mission on Education through <br />
<br />
ICT, MHRD, Government of India<br />
<br />
More information on this mission is available at <br />
<br />
http://spoken-tutorial.org\NMEICT-Intro<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| About the contributors<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Script & Narration by Prathamesh Salunke<br />
<br />
Animation is contributed by Arthi <br />
<br />
This is Prathamesh Salunke signing off from IIT Bombay<br />
<br />
Thanks for joining<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Digital-Divide/D0/First-Aid-on-Snake-Bite/EnglishDigital-Divide/D0/First-Aid-on-Snake-Bite/English2013-04-22T12:45:07Z<p>Pratham920: </p>
<hr />
<div>'''Title of script''': First Aid on Snake Bite<br />
<br />
'''Author : Prathamesh Salunke'''<br />
<br />
'''Keywords: video tutorial, Snake bite'''<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| '''Visual Cue'''<br />
| style="background-color:#ffffff;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| '''Narration'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children playing <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Many of you are familiar with this scene in your village-<br />
<br />
a group of children playing in an open area.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy chasing the ball<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Watch this boy, who is chasing the ball.<br />
<br />
<br />
He enters the nearby bushy area.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Snake coming out of the hide out<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| He spots a snake.<br />
<br />
<br />
In no time, it crawls out of its hide out.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy throwing stone on snake<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The scared boy tries to shoo away the snake by throwing a stone.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Snake biting the boy<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The snake does not crawl away.<br />
<br />
<br />
Instead it turns towards the boy and bites him on the foot.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy screaming and friends running towards him<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The boy screams for help.<br />
<br />
<br />
His friends runs to his side to help. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| After seeing two red spots friends are carrying him<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| They see two red spots on the foot.<br />
<br />
<br />
They carry the boy out of the bush. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children discussing<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| There is a commotion.<br />
<br />
<br />
All the children give different opinions about first aid.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Importance of first aid<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Here comes the importance of knowing the first aid in case of a snake bite. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Welcome to spoken tutorial on '''First Aid on Snake Bites.'''<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Welcome to spoken tutorial on '''First Aid on Snake Bites.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Correct first aids<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| In this tutorial we will see<br />
<br />
* How important is first aid.<br />
* How to give the correct first aid in case of a snake bite.<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children surrounding the boy<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Before moving on to the first aid instructions, <br />
<br />
<br />
we will review what the group of boys did to save their friend. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| After making the boy lie down, they bring elders who is tying a cloth around the wound<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| They made the boy lie down.<br />
<br />
<br />
And then they sought the help of elders to shift him to the hospital.<br />
<br />
<br />
Then they tied a cloth around the wound. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Was it the right first aid? <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Was it the right first aid? <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| People carrying the boy into the hospital<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Yes! In a way it is correct.<br />
<br />
<br />
In this case, the hospital was not far away.<br />
<br />
<br />
So the boy got the medical aid in time.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The correct way to give first aid in case of a snake bite is - <br />
<br />
# Make the person lie down on a flat surface. <br />
# Roll a cloth on the affected area. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The primary purpose of this first aid is to stop the poison from circulating throughout the body.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| And how should we roll the cloth around the wound? <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Start rolling from the upper portion of the leg and move downwards.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Hospital<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Shift the person quickly to the nearest hospital for further treatment.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| In this way, the first aid given in time prevented many damages.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Remember, wrong first aid can make one’s condition worse.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Do's <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Do’s in case of a snake bite.<br />
<br />
- First lay the victim down<br />
<br />
- When you roll the cloth apply some pressure<br />
<br />
- Use a piece of wood to prevent the movement of leg.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Dont's <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| And the Don’ts in case of a snake bite <br />
<br />
- Do Not Cut the skin or the flesh around the bite. <br />
<br />
- Do Not Put ice on or around the bite <br />
<br />
- Do Not Shock the person with electricity <br />
<br />
- Do Not Try to suck the blood or the venom out of the bite<br />
<br />
- Do Not Tie the cloth too tight. This could lead to gangrene.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| End <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| This brings to the end of the tutorial. Remember, timely first aid saves a life. <br />
<br />
Thanking you for listening and STAY SAFE. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial video<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Watch the video available at the following link<br />
<br />
It summaries the Spoken Tutorial project<br />
<br />
If u do not have a good bandwidth you can download and watch it<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial Workshops<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The Spoken Tutorial project team conducts workshops using spoken tutorials. <br />
<br />
Gives certificates to those who pass an online test. <br />
<br />
For more details, please write to: <br />
<br />
contact@spoken-tutorial.org<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Acknowledgment<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial Project is a part of the Talk to a Teacher project<br />
<br />
It is Supported by the National Mission on Education through <br />
<br />
ICT, MHRD, Government of India<br />
<br />
More information on this mission is available at <br />
<br />
http://spoken-tutorial.org\NMEICT-Intro<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| About the contributors<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Script & Narration by Prathamesh Salunke<br />
<br />
Animation is contributed by Arthi <br />
<br />
This is Prathamesh Salunke signing off from IIT Bombay<br />
<br />
Thanks for joining<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Digital-Divide/D0/First-Aid-on-Snake-Bite/EnglishDigital-Divide/D0/First-Aid-on-Snake-Bite/English2013-04-22T12:42:43Z<p>Pratham920: </p>
<hr />
<div>'''Title of script''': First Aid on Snake Bite<br />
<br />
'''Author : Prathamesh Salunke'''<br />
<br />
'''Keywords: video tutorial, Snake bite'''<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="background-color:#ffffff;border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| '''Visual Cue'''<br />
| style="background-color:#ffffff;border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| '''Narration'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children playing <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Many of you are familiar with this scene in your village-<br />
<br />
a group of children playing in an open area.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy chasing the ball<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Watch this boy, who is chasing the ball.<br />
<br />
<br />
He enters the nearby bushy area.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Snake coming out of the hide out<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| He spots a snake.<br />
<br />
<br />
In no time, it crawls out of its hide out.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy throwing stone on snake<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The scared boy tries to shoo away the snake by throwing a stone.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Snake biting the boy<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The snake does not crawl away.<br />
<br />
<br />
Instead it turns towards the boy and bites him on the foot.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Boy screaming and friends running towards him<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The boy screams for help.<br />
<br />
<br />
His friends runs to his side to help. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| After seeing two red spots friends are carrying him<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| They see two red spots on the foot.<br />
<br />
<br />
They carry the boy out of the bush. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children discussing<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| There is a commotion.<br />
<br />
<br />
All the children give different opinions about first aid.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Importance of first aid<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Here comes the importance of knowing the first aid in case of a snake bite. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Welcome to spoken tutorial on '''First Aid on Snake Bites.'''<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Welcome to spoken tutorial on '''First Aid on Snake Bites.'''<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Correct first aids<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| In this tutorial we will see<br />
<br />
* How important is first aid.<br />
* How to give the correct first aid in case of a snake bite.<br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Children surrounding the boy<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Before moving on to the first aid instructions, <br />
<br />
<br />
we will review what the group of boys did to save their friend. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| After making the boy lie down, they bring elders who is tying a cloth around the wound<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| They made the boy lie down.<br />
<br />
<br />
And then they sought the help of elders to shift him to the hospital.<br />
<br />
<br />
Then they tied a cloth around the wound. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Was it the right first aid? <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Was it the right first aid? <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| People carrying the boy into the hospital<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Yes! In a way it is correct.<br />
<br />
<br />
In this case, the hospital was not far away.<br />
<br />
<br />
So the boy got the medical aid in time.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The correct way to give first aid in case of a snake bite is - <br />
<br />
# Make the person lie down on a flat surface. <br />
# Roll a cloth on the affected area. <br />
<br />
<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The primary purpose of this first aid is to stop the poison from circulating throughout the body.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| And how should we roll the cloth around the wound? <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Cloth rolled on leg<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Start rolling from the lower portion of the leg and move upwards.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Hospital<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Shift the person quickly to the nearest hospital for further treatment.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| In this way, the first aid given in time prevented many damages.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Remember, wrong first aid can make one’s condition worse.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Do's <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Do’s in case of a snake bite.<br />
<br />
- First lay the victim down<br />
<br />
- When you roll the cloth apply some pressure<br />
<br />
- Use a piece of wood to prevent the movement of leg.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Dont's <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| And the Don’ts in case of a snake bite <br />
<br />
- Do Not Cut the skin or the flesh around the bite. <br />
<br />
- Do Not Put ice on or around the bite <br />
<br />
- Do Not Shock the person with electricity <br />
<br />
- Do Not Try to suck the blood or the venom out of the bite<br />
<br />
- Do Not Tie the cloth too tight. This could lead to gangrene.<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| End <br />
| style="background-color:#ffffff;border-top:0.1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| This brings to the end of the tutorial. Remember, timely first aid saves a life. <br />
<br />
Thanking you for listening and STAY SAFE. <br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial video<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Watch the video available at the following link<br />
<br />
It summaries the Spoken Tutorial project<br />
<br />
If u do not have a good bandwidth you can download and watch it<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial Workshops<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| The Spoken Tutorial project team conducts workshops using spoken tutorials. <br />
<br />
Gives certificates to those who pass an online test. <br />
<br />
For more details, please write to: <br />
<br />
contact@spoken-tutorial.org<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Acknowledgment<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Spoken Tutorial Project is a part of the Talk to a Teacher project<br />
<br />
It is Supported by the National Mission on Education through <br />
<br />
ICT, MHRD, Government of India<br />
<br />
More information on this mission is available at <br />
<br />
http://spoken-tutorial.org\NMEICT-Intro<br />
<br />
|-<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| About the contributors<br />
| style="background-color:#ffffff;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.095cm;"| Script & Narration by Prathamesh Salunke<br />
<br />
Animation is contributed by Arthi <br />
<br />
This is Prathamesh Salunke signing off from IIT Bombay<br />
<br />
Thanks for joining<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/RubyRuby2013-01-14T12:23:40Z<p>Pratham920: /* Basic Level */</p>
<hr />
<div>==Introduction to Ruby==<br />
<br />
'''Ruby''' has been described as an absolutely pure object-oriented scripting language and a genuine attempt to combine the best of everything in the scripting world.Its creator,''' Yukihiro “matz” Matsumoto''', blended parts of his favorite languages (Perl, Smalltalk, Eiffel, Ada, and Lisp) to form a new language that balanced functional programming with imperative programming.'''Ruby''' is written in '''C''', and it was designed with Perl and Python capabilities in mind.<br />
<br />
'''Ruby''' supports multiple programming paradigms including '''functional, object oriented, imperative and reflective.''' It also has a '''dynamic type system''' and '''automatic memory management'''.It's consistency and it's object model make it easy to use. The syntax is simple, clean, and readable, with an expressiveness that gives your code a natural flow. <br />
<br />
'''Ruby''' is also a great general purpose language. It can be used to write scripts and can be also used to create full scale, standalone GUI based applications.It is also great for serving web pages, generating dynamic web page content and excels at database access tasks. <br />
<br />
Being an interpreted language means that''' Ruby''' is''' portable'''. Once an application has been developed in Ruby it will run equally well on Ruby supported platforms such as '''Linux, UNIX, Windows and MacOS X. <br />
'''<br />
__TOC__<br />
<br />
==Basic Level==<br />
# Hello Ruby<br />
#* Introduction to Ruby <br />
#** What is Ruby?<br />
#** Features<br />
#** Ruby gems<br />
#** Help on ruby<br />
#* Installation <br />
#** Installation of ruby 1.9 through Ubuntu Software Centre<br />
#** Other methods to install ruby<br />
#***Rvm (ruby version manager)<br />
#***Rbenv<br />
#* Running ruby code <br />
#** Three ways to execute ruby code <br />
#*** Interactive ruby<br />
#*** As a file<br />
#*** From commandline<br />
#** Example :Hello World<br />
#*Commenting in Ruby <br />
#**How to add comments<br />
#***single line comments<br />
#***multiple line or block comments<br />
#* Difference between Puts and Print in ruby <br />
#**Explaining the difference by using example<br />
#Variables in Ruby<br />
#* Introduction <br />
#**Ruby and variable Dynamic typing<br />
#**Declaring a variable<br />
#**Changing variable type<br />
#**Converting the var value i.e to float,string,binary etc<br />
#*Scope of Variables <br />
#**What is variable scope<br />
#**Types of variables<br />
#***Global variable<br />
#***local variable<br />
#***class variable<br />
#***instance variable<br />
#***constant variable<br />
#Ruby Methods<br />
#* What is method<br />
#**Working with methods<br />
#**Declaring and Calling a method<br />
#*Passing arguments to a method <br />
#*Passing value to a method <br />
#*Returning value from a method<br />
#Arithmetic & Relational Operators in Ruby<br />
#*Arithmetic Operators<br />
#** Demostrating arithemtic operators like +,-,/,%,* using irb<br />
#*Operator Precedence<br />
#*Relational Operators<br />
#**Demostrating arithemtic operators like ==,!=,<,>,<= ,>= using irb<br />
#Logical & other operators <br />
#*Logical operator<br />
#**Demostrating logical operators like and (&&),or(||),not(!) using irb<br />
#*Parallel assignment<br />
#*Range operators<br />
#**Inclusive Operator(..)<br />
#**Exclusive operator (...)<br />
#Control Statements in Ruby<br />
#*What are control statements<br />
#*Syntax for<br />
#**if statement<br />
#**if..else statement<br />
#**if..elsif statement<br />
#**Examples on it<br />
#*Ternary Operator<br />
#*Syntax for case statement and example on it<br />
#*Comparison between if..elsif and case statement<br />
<br />
==Intermediate level== <br />
#Looping Statements<br />
#*Loops<br />
#**Understanding the flow of loop<br />
#*Syntax for<br />
#**while loop<br />
#**until<br />
#**unless<br />
#* Examples based on this loops<br />
#Looping Methods<br />
#*Syntax for <br />
#**for loop<br />
#**times method<br />
#**upto method<br />
#**downto method<br />
#*Examples based on the above methods<br />
#Creating Strings in Ruby<br />
#*What is string<br />
#**Learning to create and manipulate the strings<br />
#*Performing operation on string like<br />
#**String length <br />
#**String concatenation<br />
#**String Comparison<br />
#**String Replacement & substitution<br />
#**String conversion to<br />
#***Array<br />
#***Uppercase<br />
#***Other object type<br />
#Collections in Ruby<br />
#*Array<br />
#**What is an array<br />
#**Creating a new array<br />
#**Iterating the array using each loop<br />
#**Operation on array like sorting, reversing<br />
#*Hashes<br />
#**What is hash<br />
#**Difference between hash and array<br />
#**Creating and accessing the hash<br />
==Advanced level== <br />
#Ruby Object Oriented Programming<br />
#*Class<br />
#**What is Class<br />
#**What is Object<br />
#**Defining Ruby Class<br />
#**Creating Object from Class<br />
#*Variables<br />
#**Class Variable<br />
#**Instance Variable<br />
#*Methods<br />
#**Instance Methods<br />
#**Accessor Methods<br />
#*Access Control<br />
#**Explaining the access specifier<br />
#***public <br />
#***private<br />
#***protected<br />
#Class Inheritance & Duck typing<br />
#*Introduction<br />
#**What is inheritance<br />
#**Superclass & subclass<br />
#**Type of inheritance<br />
#*Single Inheritance <br />
#*Mixin in ruby<br />
#**Implementing multiple inheritance using module<br />
#*Duck typing<br />
#**What is duck typing<br />
#**Example<br />
#Files in Ruby<br />
#*Creating files<br />
#*Reading and Writing files<br />
#*Opening an existing file<br />
#*Delete and rename files<br />
#Exception Handling<br />
#*Introduction <br />
#**What is exception<br />
#**Exception class<br />
#**User Defined Exception<br />
#*Raising Exception<br />
#*Rescuing Exception<br />
#*Catch and throw</div>Pratham920https://script.spoken-tutorial.org/index.php/JavaJava2013-01-14T12:20:54Z<p>Pratham920: /* Basic Level */</p>
<hr />
<div>=Introduction=<br />
'''Welcome to online web tutorials for java'''<br><br />
Java[ http://java.sun.com ]is a free and open source high level programming language. It is simple as well as object oriented language. Till date, the Java platform has attracted more than 6.5 million software developers. Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as today's demanding Embedded and Real-Time environments.From laptops to mobile phones, game consoles to scientific supercomputers, music players to the Internet,Set-top boxes to printers, Web cams to medical devices,Ooops that is a huge list to follow,Java is everywhere!!!!!<br />
<br />
This set of tutorials will cover features and usage of Java version 1.6.x Please see the associated text box of individual spoken tutorials on the website to decide the versions of Java and OS to which it is applicable. <br />
<br />
The Spoken Tutorial Effort for Java is contributed jointly by '''TalentSprint, Hyderabad''' and the '''Spoken Tutorial Team, IIT Bombay'''. Other contributors who helped in the creation of the scripts are ............ <br />
<br />
<blockquote style="background-color: lemonchiffon; border: solid thin grey;"><br />
[[Media:JavaTemplate.zip | Java Slide Template]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
[[Glossary_for_Java | Glossary]]<br />
</blockquote><br />
<br />
__TOC__<br />
<br />
= Basic Level =<br />
<br />
1. Getting started with Java – installation <br />
* Install jdk from Synaptic Package Manager<br />
* Choose openjdk-6-jdk from the list of packages available <br />
* Mark it for installation<br />
* The installation will take a few seconds<br />
* Verify the installation<br />
* At the command prompt type java -version, so the version number of the jdk will be displayed<br />
* Run a simple java program and see if it works<br />
* Type javac TestProgram.java for compiling the code and java TestProgram for executing the code<br />
<br />
2. Java - First program<br />
<br />
* write simple java program <br />
* print “My First Java Program!” on Console<br />
* save the file<br />
* file name given to the java file<br />
* compile the file<br />
* run the file<br />
* correct the errors<br />
* naming conventions for class<br />
* naming conventions for method<br />
* naming conventions for variable<br />
<br />
= Eclipse =<br />
= 3. Installing Eclipse =<br />
* Install Eclipse on Ubuntu on the Terminal<br />
* Set up the proxy on the Terminal <br />
* Then fetch the list of all the available softwares<br />
* Type sudo apt-get update<br />
* Then install eclipse on the Terminal<br />
* Type sudo apt-get install eclipse<br />
* Verify if Eclipse is installed on the system<br />
* Installing Eclipse on Debian,Kubuntu,Xubuntu<br />
* Installing Eclipse on Redhat <br />
* Installing Eclipse on Fedora,centos and suse linux<br />
<br />
4. Getting started with Eclipse<br />
<br />
* Eclipse is an Integrated Development Environment<br />
* It is a tool on which one can write, debug and run java programs easily<br />
* Open Dash Home and type Eclipse in the search box.<br />
* We get Workspace Launcher<br />
* On clicking on Workbench we get the Eclipse IDE<br />
* Go to File->New->Project and select Java Project<br />
* Create a project named EclipseDemo and create a class inside DemoClass<br />
* Learn about Package Explorer and Editor portlet<br />
* Add the println statement in<br/> <br />
<br />
<br />
5. Hello World Program<br />
<br />
* Open Eclipse<br />
* Create a Java Project named DemoProject<br />
* Create a class named DemoClass<br />
* Class name and file name will be the same<br />
* Eclipse suggests various possibilities as we type a command<br />
* Eclipse also completes the parentheses by automatically adding the closing parentheses<br />
* Include the statement that we want to print<br />
* Eclipse also completes the quotes by adding the closing quote<br />
* Compile and execute the program<br />
* Change the code to print<br/> <br />
<br />
<br />
6. Errors and Debugging<br />
<br />
* When writing a Java Program, here is a list of typical errors:<br />
* Missing semicolon(;)<br />
* Missing double quotes(".")<br />
* Mis-match of filename and classname<br />
* Typing the print statement n lower case<br />
* The line which has the error will be indicated with a red cross mark on the left margin<br />
* The list of errors is displayed by hovering the mouse over the cross mark<br />
* Create a class ErrorFree with Errors, debug the code and run it<br />
* Eclipse also offers intelligent fixes<br/> <br />
<br />
<br />
7. Programming features of Eclipse<br />
<br />
* Auto completion<br />
* Sets the corresponding closing brace when we open the brace<br />
* Provides a drop-down list of methods when you start typing the code.<br />
* syntax highlighting<br />
* classname is highlighted in pink color and method in blue color.<br />
* keyboard shortcuts<br />
* F11 to debug a program and Ctrl plus H to search a specific file.<br />
* error highlighting<br />
* cross symbol in the program denotes errors<br />
* Remove semicolon and error details are displayed when mouse is hovered over cross symbol.<br />
<br />
= The Java Programming language -- Basic Level =<br />
== Fundamental Programming Structures in Java ==<br />
8. Numerical datatypes<br />
<br />
* define datatypes and numerical datatypes<br />
* int<br />
* float<br />
* byte<br />
* short<br />
* long<br />
* double<br />
* range of each numerical datatypes<br />
* declaration and initializationof numerical datatypes.<br />
* valid and invalid declaration<br />
<br />
9. Arithmetic Operations<br />
<br />
* define an operator<br />
* define arithmetic operators<br />
* addition<br />
* subtraction<br />
* multiplication<br />
* division<br />
* modulo<br />
* simple program to demonstrate arithmetic operators<br />
* appropriate datatypes for appropriate values<br />
* save, compile and run the program<br/> <br />
<br />
<br />
10. Strings<br />
<br />
* char datatype<br />
* letter, digit, punctuation marks, '''tab''', or a space are all characters.<br />
* Program explaining the variable and the character data.<br />
* Introduction to strings<br />
* Creating string by Direct Initialization<br />
* Creating string by using new operator<br />
* String length()<br />
* String concat()<br />
* String toUpperCase()<br />
* String toLowerCase()<br/> <br />
<br />
<br />
11. Primitive type conversions<br />
<br />
* define type conversion or type casting<br />
* higher order integer to lower order integer- Explicit type casting<br />
* program to show explicit type casting<br />
* common mistake in explicit type casting.<br />
* program to show common mistake in explicit type casting<br />
<br />
* lower order integer to higher order integer – Implicit type casting<br />
* program to show implicit type casting<br />
* char to integer<br />
* integer to char<br />
* program to show char to int type casting.<br />
<br />
== Control flow ==<br />
12. Relational Operations<br />
<br />
* bool datatype<br />
* equal to and not equal to<br />
* less than and less than or equal to<br />
* greater than and greater than or equal to<br/> <br />
<br />
<br />
13. Logical Operations<br />
<br />
* use of logical operators<br />
* and (&&) operator<br />
* example to explain '''and''' operator<br />
* program to demonstrate '''and''' operator<br />
* or (||) operator<br />
* example to explain '''or '''operator<br />
* program to demonstrate '''or '''operator<br />
* not (!) operator<br />
* program to demonstrate '''or '''operator<br />
* save, compile and run the programs<br/> <br />
<br />
<br />
14. if else construct<br />
<br />
* Conditional Statements and types of Conditional Statements<br />
* Use of if statement<br />
* Syntax for if statement<br />
* Program using if statement<br />
* Use of if else statement<br />
* Syntax for if else statement<br />
* Program using if else statement<br />
* Use of if else if statement<br />
* Syntax for if else if statement<br />
* Program using if else if statement<br/> <br />
<br />
<br />
15. nested if and ternary operator<br />
<br />
* explain nested if<br />
* nested if syntax<br />
* program to demonstrate nested if<br />
* explain the control flow of the program<br />
* explain ternary operator<br />
* syntax for ternary operator<br />
* explain the syntax<br />
* program to demonstrate ternary operator<br />
* comparison between ternary operator and nested if<br />
* save, compile and run the program<br/> <br />
<br />
<br />
16. switch statement<br />
<br />
* define switch case statement<br />
* compare switch and nested if<br />
* switch case syntax<br />
* working of a switch case statement<br />
* use of keyword switch<br />
* valid and invalid use of keyword '''case'''<br />
* use of keyword default<br />
* use of keyword break<br />
* program to demonstrate switch case statement<br />
* save, compile and run the program to check the output<br />
<br />
17. while loop<br />
<br />
* Loop control statement <br />
* types of loop control statements<br />
* Introduction to while loop<br />
* syntax of while loop<br />
* Program using while loop<br />
* Check the output.<br />
* Introduction to infinite loop<br />
* loop variable modification<br />
* Check the output<br />
* How to terminate the infinite loop<br/> <br />
<br />
<br />
18. for loop<br />
<br />
* syntax<br />
* loop continuing condition<br />
* loop variable modification<br/> <br />
<br />
<br />
19. do while loop<br />
<br />
* define do while <br />
* do while syntax<br />
* working of do while loop<br />
* example of do while loop<br />
* explain the do while programming<br />
* save, compile and run the program to check the output <br />
* how different is it from the while loop<br />
* program to demonstrate the differences<br />
<br />
== Arrays ==<br />
20. Introduction to Arrays<br />
<br />
* What are arrays<br />
* Types of arrays<br />
* How to create arrays<br />
<br />
21. Array operations<br />
<br />
* Accessing array items<br />
* Checking for bounds<br />
<br />
== Classes & Objects ==<br />
== 22. Creating class ==<br />
* Whatever we can see in this world are all objects<br />
* Objects can be categorized into groups known as class<br />
* This is class in real world<br />
* Human Being is an example of class in real world<br />
* Class in java is the blue print from which individual objects are created<br />
* Class consists defines a set of properties called variables and a set of behaviors called methods<br />
* Syntax for creating class<br />
* Create a simple class Student using Eclipse<br />
* The Student class can contain properties<br/> <br />
<br />
<br />
23. Creating Object<br />
<br />
* An object is an instance of a class<br />
* Each object consist of state and behavior<br />
* Object stores it state in fields or variables<br />
* It exposes its behavior through methods<br />
* Reference variables<br />
* Create a class named TestStudent<br />
* Create an object of the Student class<br />
* Use new operator<br />
* Check what the reference variable contains<br />
* Create one more object of the Student class and check what the reference variable contains<br />
<br />
24. Instance fields<br />
<br />
* Also known as non-static fields<br />
* Open the TestStudent class which we have created<br />
* Access the fields roll_number and name using dot operator<br />
* See the output<br />
* Initialize the field and see the output<br />
* Change the modifier of the fields to private<br />
* Debug the error that you get<br />
* Change the modifier to protected<br />
* Each object of a class will have unique values<br />
* Create two objects of the Student class <br />
<br />
25. methods<br />
<br />
* method definition <br />
* write simple method<br />
* method returning value<br />
* call a method in another method<br />
* flow of the program<br />
* call a static method<br />
* call a method from another class<br />
* method signature<br />
* method body <br />
<br />
== Constructors ==<br />
26. default constructor<br />
<br />
* what is a constructor?<br />
* what is a default constructor?<br />
* when is it called?<br />
* define a constructor<br />
* initialize the variables<br />
* call the constructor<br />
* difference between constructor and method<br/> <br />
<br />
<br />
27. parameterized constructors<br />
<br />
* What is a parameterized constructor?<br />
* create constructor without parameter<br />
* create a constructor with parameter<br />
* assign values to the variables in the constructor<br />
* pass arguments during the constructor call<br />
* working of parameterized constructor<br />
* show common errors<br />
* resolve the errors<br />
* create another parameterized constructor<br />
* why to use constructor?<br />
<br />
28. using this keyword<br />
<br />
* this is a reference to the current object<br />
* helps to avoid name conflicts<br />
* we can use this keyword inside a constructor to call another one<br />
* the constructors must be in the same class<br />
* explicit constructor invocation<br />
* Explain it using the parameterized constructor code<br />
* Make this statement the last one in the constructor<br />
* You will get an error<br />
* this statement should be the first one inside a constructor<br />
<br />
29. non-static block<br />
<br />
* Non-static block <br />
* Any code written between two curly brackets <br />
* Executed for each object that is created <br />
* Executes before constructor's execution <br />
* can initialize instance member variables of the class <br />
* create a class named NonStaticTest <br />
* Create a non-static block and a constructor inside it <br />
* Check the output <br />
* Include multiple non-static blocks <br />
* they will be executed in the sequence in which they appear in the class <br />
* Check the output <br />
* Non-static block is not a substitute for constructor<br />
<br />
30. constructor overloading<br />
<br />
* define multiple constructor<br />
* what is constructor overloading?<br />
* constructor with different number of parameters.<br />
* parameters with different datatypes.<br />
* how is constructor overloaded?<br />
* flow of overloading process.<br />
* advantage of constructor overloading.<br />
<br />
31. method overloading<br />
<br />
* define multiple methods.<br />
* methods with same name.<br />
* methods with different number of parameters.<br />
* methods with different datatypes of parameter.<br />
* what is method overloading?<br />
* example for overloadin method<br />
* how to overload method?<br />
* advantage of method overloading.<br />
* error in method overloading.<br />
<br />
== Intermediate Level ==<br />
<br />
== Advanced Level ==</div>Pratham920https://script.spoken-tutorial.org/index.php/JavaJava2013-01-14T12:20:27Z<p>Pratham920: /* Basic Level */</p>
<hr />
<div>=Introduction=<br />
'''Welcome to online web tutorials for java'''<br><br />
Java[ http://java.sun.com ]is a free and open source high level programming language. It is simple as well as object oriented language. Till date, the Java platform has attracted more than 6.5 million software developers. Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as today's demanding Embedded and Real-Time environments.From laptops to mobile phones, game consoles to scientific supercomputers, music players to the Internet,Set-top boxes to printers, Web cams to medical devices,Ooops that is a huge list to follow,Java is everywhere!!!!!<br />
<br />
This set of tutorials will cover features and usage of Java version 1.6.x Please see the associated text box of individual spoken tutorials on the website to decide the versions of Java and OS to which it is applicable. <br />
<br />
The Spoken Tutorial Effort for Java is contributed jointly by '''TalentSprint, Hyderabad''' and the '''Spoken Tutorial Team, IIT Bombay'''. Other contributors who helped in the creation of the scripts are ............ <br />
<br />
<blockquote style="background-color: lemonchiffon; border: solid thin grey;"><br />
[[Media:JavaTemplate.zip | Java Slide Template]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
[[Glossary_for_Java | Glossary]]<br />
</blockquote><br />
<br />
__TOC__<br />
<br />
= Basic Level =<br />
<br />
#. Getting started with Java – installation <br />
* Install jdk from Synaptic Package Manager<br />
* Choose openjdk-6-jdk from the list of packages available <br />
* Mark it for installation<br />
* The installation will take a few seconds<br />
* Verify the installation<br />
* At the command prompt type java -version, so the version number of the jdk will be displayed<br />
* Run a simple java program and see if it works<br />
* Type javac TestProgram.java for compiling the code and java TestProgram for executing the code<br />
<br />
2. Java - First program<br />
<br />
* write simple java program <br />
* print “My First Java Program!” on Console<br />
* save the file<br />
* file name given to the java file<br />
* compile the file<br />
* run the file<br />
* correct the errors<br />
* naming conventions for class<br />
* naming conventions for method<br />
* naming conventions for variable<br />
<br />
= Eclipse =<br />
= 3. Installing Eclipse =<br />
* Install Eclipse on Ubuntu on the Terminal<br />
* Set up the proxy on the Terminal <br />
* Then fetch the list of all the available softwares<br />
* Type sudo apt-get update<br />
* Then install eclipse on the Terminal<br />
* Type sudo apt-get install eclipse<br />
* Verify if Eclipse is installed on the system<br />
* Installing Eclipse on Debian,Kubuntu,Xubuntu<br />
* Installing Eclipse on Redhat <br />
* Installing Eclipse on Fedora,centos and suse linux<br />
<br />
4. Getting started with Eclipse<br />
<br />
* Eclipse is an Integrated Development Environment<br />
* It is a tool on which one can write, debug and run java programs easily<br />
* Open Dash Home and type Eclipse in the search box.<br />
* We get Workspace Launcher<br />
* On clicking on Workbench we get the Eclipse IDE<br />
* Go to File->New->Project and select Java Project<br />
* Create a project named EclipseDemo and create a class inside DemoClass<br />
* Learn about Package Explorer and Editor portlet<br />
* Add the println statement in<br/> <br />
<br />
<br />
5. Hello World Program<br />
<br />
* Open Eclipse<br />
* Create a Java Project named DemoProject<br />
* Create a class named DemoClass<br />
* Class name and file name will be the same<br />
* Eclipse suggests various possibilities as we type a command<br />
* Eclipse also completes the parentheses by automatically adding the closing parentheses<br />
* Include the statement that we want to print<br />
* Eclipse also completes the quotes by adding the closing quote<br />
* Compile and execute the program<br />
* Change the code to print<br/> <br />
<br />
<br />
6. Errors and Debugging<br />
<br />
* When writing a Java Program, here is a list of typical errors:<br />
* Missing semicolon(;)<br />
* Missing double quotes(".")<br />
* Mis-match of filename and classname<br />
* Typing the print statement n lower case<br />
* The line which has the error will be indicated with a red cross mark on the left margin<br />
* The list of errors is displayed by hovering the mouse over the cross mark<br />
* Create a class ErrorFree with Errors, debug the code and run it<br />
* Eclipse also offers intelligent fixes<br/> <br />
<br />
<br />
7. Programming features of Eclipse<br />
<br />
* Auto completion<br />
* Sets the corresponding closing brace when we open the brace<br />
* Provides a drop-down list of methods when you start typing the code.<br />
* syntax highlighting<br />
* classname is highlighted in pink color and method in blue color.<br />
* keyboard shortcuts<br />
* F11 to debug a program and Ctrl plus H to search a specific file.<br />
* error highlighting<br />
* cross symbol in the program denotes errors<br />
* Remove semicolon and error details are displayed when mouse is hovered over cross symbol.<br />
<br />
= The Java Programming language -- Basic Level =<br />
== Fundamental Programming Structures in Java ==<br />
8. Numerical datatypes<br />
<br />
* define datatypes and numerical datatypes<br />
* int<br />
* float<br />
* byte<br />
* short<br />
* long<br />
* double<br />
* range of each numerical datatypes<br />
* declaration and initializationof numerical datatypes.<br />
* valid and invalid declaration<br />
<br />
9. Arithmetic Operations<br />
<br />
* define an operator<br />
* define arithmetic operators<br />
* addition<br />
* subtraction<br />
* multiplication<br />
* division<br />
* modulo<br />
* simple program to demonstrate arithmetic operators<br />
* appropriate datatypes for appropriate values<br />
* save, compile and run the program<br/> <br />
<br />
<br />
10. Strings<br />
<br />
* char datatype<br />
* letter, digit, punctuation marks, '''tab''', or a space are all characters.<br />
* Program explaining the variable and the character data.<br />
* Introduction to strings<br />
* Creating string by Direct Initialization<br />
* Creating string by using new operator<br />
* String length()<br />
* String concat()<br />
* String toUpperCase()<br />
* String toLowerCase()<br/> <br />
<br />
<br />
11. Primitive type conversions<br />
<br />
* define type conversion or type casting<br />
* higher order integer to lower order integer- Explicit type casting<br />
* program to show explicit type casting<br />
* common mistake in explicit type casting.<br />
* program to show common mistake in explicit type casting<br />
<br />
* lower order integer to higher order integer – Implicit type casting<br />
* program to show implicit type casting<br />
* char to integer<br />
* integer to char<br />
* program to show char to int type casting.<br />
<br />
== Control flow ==<br />
12. Relational Operations<br />
<br />
* bool datatype<br />
* equal to and not equal to<br />
* less than and less than or equal to<br />
* greater than and greater than or equal to<br/> <br />
<br />
<br />
13. Logical Operations<br />
<br />
* use of logical operators<br />
* and (&&) operator<br />
* example to explain '''and''' operator<br />
* program to demonstrate '''and''' operator<br />
* or (||) operator<br />
* example to explain '''or '''operator<br />
* program to demonstrate '''or '''operator<br />
* not (!) operator<br />
* program to demonstrate '''or '''operator<br />
* save, compile and run the programs<br/> <br />
<br />
<br />
14. if else construct<br />
<br />
* Conditional Statements and types of Conditional Statements<br />
* Use of if statement<br />
* Syntax for if statement<br />
* Program using if statement<br />
* Use of if else statement<br />
* Syntax for if else statement<br />
* Program using if else statement<br />
* Use of if else if statement<br />
* Syntax for if else if statement<br />
* Program using if else if statement<br/> <br />
<br />
<br />
15. nested if and ternary operator<br />
<br />
* explain nested if<br />
* nested if syntax<br />
* program to demonstrate nested if<br />
* explain the control flow of the program<br />
* explain ternary operator<br />
* syntax for ternary operator<br />
* explain the syntax<br />
* program to demonstrate ternary operator<br />
* comparison between ternary operator and nested if<br />
* save, compile and run the program<br/> <br />
<br />
<br />
16. switch statement<br />
<br />
* define switch case statement<br />
* compare switch and nested if<br />
* switch case syntax<br />
* working of a switch case statement<br />
* use of keyword switch<br />
* valid and invalid use of keyword '''case'''<br />
* use of keyword default<br />
* use of keyword break<br />
* program to demonstrate switch case statement<br />
* save, compile and run the program to check the output<br />
<br />
17. while loop<br />
<br />
* Loop control statement <br />
* types of loop control statements<br />
* Introduction to while loop<br />
* syntax of while loop<br />
* Program using while loop<br />
* Check the output.<br />
* Introduction to infinite loop<br />
* loop variable modification<br />
* Check the output<br />
* How to terminate the infinite loop<br/> <br />
<br />
<br />
18. for loop<br />
<br />
* syntax<br />
* loop continuing condition<br />
* loop variable modification<br/> <br />
<br />
<br />
19. do while loop<br />
<br />
* define do while <br />
* do while syntax<br />
* working of do while loop<br />
* example of do while loop<br />
* explain the do while programming<br />
* save, compile and run the program to check the output <br />
* how different is it from the while loop<br />
* program to demonstrate the differences<br />
<br />
== Arrays ==<br />
20. Introduction to Arrays<br />
<br />
* What are arrays<br />
* Types of arrays<br />
* How to create arrays<br />
<br />
21. Array operations<br />
<br />
* Accessing array items<br />
* Checking for bounds<br />
<br />
== Classes & Objects ==<br />
== 22. Creating class ==<br />
* Whatever we can see in this world are all objects<br />
* Objects can be categorized into groups known as class<br />
* This is class in real world<br />
* Human Being is an example of class in real world<br />
* Class in java is the blue print from which individual objects are created<br />
* Class consists defines a set of properties called variables and a set of behaviors called methods<br />
* Syntax for creating class<br />
* Create a simple class Student using Eclipse<br />
* The Student class can contain properties<br/> <br />
<br />
<br />
23. Creating Object<br />
<br />
* An object is an instance of a class<br />
* Each object consist of state and behavior<br />
* Object stores it state in fields or variables<br />
* It exposes its behavior through methods<br />
* Reference variables<br />
* Create a class named TestStudent<br />
* Create an object of the Student class<br />
* Use new operator<br />
* Check what the reference variable contains<br />
* Create one more object of the Student class and check what the reference variable contains<br />
<br />
24. Instance fields<br />
<br />
* Also known as non-static fields<br />
* Open the TestStudent class which we have created<br />
* Access the fields roll_number and name using dot operator<br />
* See the output<br />
* Initialize the field and see the output<br />
* Change the modifier of the fields to private<br />
* Debug the error that you get<br />
* Change the modifier to protected<br />
* Each object of a class will have unique values<br />
* Create two objects of the Student class <br />
<br />
25. methods<br />
<br />
* method definition <br />
* write simple method<br />
* method returning value<br />
* call a method in another method<br />
* flow of the program<br />
* call a static method<br />
* call a method from another class<br />
* method signature<br />
* method body <br />
<br />
== Constructors ==<br />
26. default constructor<br />
<br />
* what is a constructor?<br />
* what is a default constructor?<br />
* when is it called?<br />
* define a constructor<br />
* initialize the variables<br />
* call the constructor<br />
* difference between constructor and method<br/> <br />
<br />
<br />
27. parameterized constructors<br />
<br />
* What is a parameterized constructor?<br />
* create constructor without parameter<br />
* create a constructor with parameter<br />
* assign values to the variables in the constructor<br />
* pass arguments during the constructor call<br />
* working of parameterized constructor<br />
* show common errors<br />
* resolve the errors<br />
* create another parameterized constructor<br />
* why to use constructor?<br />
<br />
28. using this keyword<br />
<br />
* this is a reference to the current object<br />
* helps to avoid name conflicts<br />
* we can use this keyword inside a constructor to call another one<br />
* the constructors must be in the same class<br />
* explicit constructor invocation<br />
* Explain it using the parameterized constructor code<br />
* Make this statement the last one in the constructor<br />
* You will get an error<br />
* this statement should be the first one inside a constructor<br />
<br />
29. non-static block<br />
<br />
* Non-static block <br />
* Any code written between two curly brackets <br />
* Executed for each object that is created <br />
* Executes before constructor's execution <br />
* can initialize instance member variables of the class <br />
* create a class named NonStaticTest <br />
* Create a non-static block and a constructor inside it <br />
* Check the output <br />
* Include multiple non-static blocks <br />
* they will be executed in the sequence in which they appear in the class <br />
* Check the output <br />
* Non-static block is not a substitute for constructor<br />
<br />
30. constructor overloading<br />
<br />
* define multiple constructor<br />
* what is constructor overloading?<br />
* constructor with different number of parameters.<br />
* parameters with different datatypes.<br />
* how is constructor overloaded?<br />
* flow of overloading process.<br />
* advantage of constructor overloading.<br />
<br />
31. method overloading<br />
<br />
* define multiple methods.<br />
* methods with same name.<br />
* methods with different number of parameters.<br />
* methods with different datatypes of parameter.<br />
* what is method overloading?<br />
* example for overloadin method<br />
* how to overload method?<br />
* advantage of method overloading.<br />
* error in method overloading.<br />
<br />
== Intermediate Level ==<br />
<br />
== Advanced Level ==</div>Pratham920https://script.spoken-tutorial.org/index.php/JavaJava2013-01-14T12:20:03Z<p>Pratham920: /* Basic Level */</p>
<hr />
<div>=Introduction=<br />
'''Welcome to online web tutorials for java'''<br><br />
Java[ http://java.sun.com ]is a free and open source high level programming language. It is simple as well as object oriented language. Till date, the Java platform has attracted more than 6.5 million software developers. Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as today's demanding Embedded and Real-Time environments.From laptops to mobile phones, game consoles to scientific supercomputers, music players to the Internet,Set-top boxes to printers, Web cams to medical devices,Ooops that is a huge list to follow,Java is everywhere!!!!!<br />
<br />
This set of tutorials will cover features and usage of Java version 1.6.x Please see the associated text box of individual spoken tutorials on the website to decide the versions of Java and OS to which it is applicable. <br />
<br />
The Spoken Tutorial Effort for Java is contributed jointly by '''TalentSprint, Hyderabad''' and the '''Spoken Tutorial Team, IIT Bombay'''. Other contributors who helped in the creation of the scripts are ............ <br />
<br />
<blockquote style="background-color: lemonchiffon; border: solid thin grey;"><br />
[[Media:JavaTemplate.zip | Java Slide Template]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
[[Glossary_for_Java | Glossary]]<br />
</blockquote><br />
<br />
__TOC__<br />
<br />
= Basic Level =<br />
<br />
#1. Getting started with Java – installation <br />
* Install jdk from Synaptic Package Manager<br />
* Choose openjdk-6-jdk from the list of packages available <br />
* Mark it for installation<br />
* The installation will take a few seconds<br />
* Verify the installation<br />
* At the command prompt type java -version, so the version number of the jdk will be displayed<br />
* Run a simple java program and see if it works<br />
* Type javac TestProgram.java for compiling the code and java TestProgram for executing the code<br />
<br />
2. Java - First program<br />
<br />
* write simple java program <br />
* print “My First Java Program!” on Console<br />
* save the file<br />
* file name given to the java file<br />
* compile the file<br />
* run the file<br />
* correct the errors<br />
* naming conventions for class<br />
* naming conventions for method<br />
* naming conventions for variable<br />
<br />
= Eclipse =<br />
= 3. Installing Eclipse =<br />
* Install Eclipse on Ubuntu on the Terminal<br />
* Set up the proxy on the Terminal <br />
* Then fetch the list of all the available softwares<br />
* Type sudo apt-get update<br />
* Then install eclipse on the Terminal<br />
* Type sudo apt-get install eclipse<br />
* Verify if Eclipse is installed on the system<br />
* Installing Eclipse on Debian,Kubuntu,Xubuntu<br />
* Installing Eclipse on Redhat <br />
* Installing Eclipse on Fedora,centos and suse linux<br />
<br />
4. Getting started with Eclipse<br />
<br />
* Eclipse is an Integrated Development Environment<br />
* It is a tool on which one can write, debug and run java programs easily<br />
* Open Dash Home and type Eclipse in the search box.<br />
* We get Workspace Launcher<br />
* On clicking on Workbench we get the Eclipse IDE<br />
* Go to File->New->Project and select Java Project<br />
* Create a project named EclipseDemo and create a class inside DemoClass<br />
* Learn about Package Explorer and Editor portlet<br />
* Add the println statement in<br/> <br />
<br />
<br />
5. Hello World Program<br />
<br />
* Open Eclipse<br />
* Create a Java Project named DemoProject<br />
* Create a class named DemoClass<br />
* Class name and file name will be the same<br />
* Eclipse suggests various possibilities as we type a command<br />
* Eclipse also completes the parentheses by automatically adding the closing parentheses<br />
* Include the statement that we want to print<br />
* Eclipse also completes the quotes by adding the closing quote<br />
* Compile and execute the program<br />
* Change the code to print<br/> <br />
<br />
<br />
6. Errors and Debugging<br />
<br />
* When writing a Java Program, here is a list of typical errors:<br />
* Missing semicolon(;)<br />
* Missing double quotes(".")<br />
* Mis-match of filename and classname<br />
* Typing the print statement n lower case<br />
* The line which has the error will be indicated with a red cross mark on the left margin<br />
* The list of errors is displayed by hovering the mouse over the cross mark<br />
* Create a class ErrorFree with Errors, debug the code and run it<br />
* Eclipse also offers intelligent fixes<br/> <br />
<br />
<br />
7. Programming features of Eclipse<br />
<br />
* Auto completion<br />
* Sets the corresponding closing brace when we open the brace<br />
* Provides a drop-down list of methods when you start typing the code.<br />
* syntax highlighting<br />
* classname is highlighted in pink color and method in blue color.<br />
* keyboard shortcuts<br />
* F11 to debug a program and Ctrl plus H to search a specific file.<br />
* error highlighting<br />
* cross symbol in the program denotes errors<br />
* Remove semicolon and error details are displayed when mouse is hovered over cross symbol.<br />
<br />
= The Java Programming language -- Basic Level =<br />
== Fundamental Programming Structures in Java ==<br />
8. Numerical datatypes<br />
<br />
* define datatypes and numerical datatypes<br />
* int<br />
* float<br />
* byte<br />
* short<br />
* long<br />
* double<br />
* range of each numerical datatypes<br />
* declaration and initializationof numerical datatypes.<br />
* valid and invalid declaration<br />
<br />
9. Arithmetic Operations<br />
<br />
* define an operator<br />
* define arithmetic operators<br />
* addition<br />
* subtraction<br />
* multiplication<br />
* division<br />
* modulo<br />
* simple program to demonstrate arithmetic operators<br />
* appropriate datatypes for appropriate values<br />
* save, compile and run the program<br/> <br />
<br />
<br />
10. Strings<br />
<br />
* char datatype<br />
* letter, digit, punctuation marks, '''tab''', or a space are all characters.<br />
* Program explaining the variable and the character data.<br />
* Introduction to strings<br />
* Creating string by Direct Initialization<br />
* Creating string by using new operator<br />
* String length()<br />
* String concat()<br />
* String toUpperCase()<br />
* String toLowerCase()<br/> <br />
<br />
<br />
11. Primitive type conversions<br />
<br />
* define type conversion or type casting<br />
* higher order integer to lower order integer- Explicit type casting<br />
* program to show explicit type casting<br />
* common mistake in explicit type casting.<br />
* program to show common mistake in explicit type casting<br />
<br />
* lower order integer to higher order integer – Implicit type casting<br />
* program to show implicit type casting<br />
* char to integer<br />
* integer to char<br />
* program to show char to int type casting.<br />
<br />
== Control flow ==<br />
12. Relational Operations<br />
<br />
* bool datatype<br />
* equal to and not equal to<br />
* less than and less than or equal to<br />
* greater than and greater than or equal to<br/> <br />
<br />
<br />
13. Logical Operations<br />
<br />
* use of logical operators<br />
* and (&&) operator<br />
* example to explain '''and''' operator<br />
* program to demonstrate '''and''' operator<br />
* or (||) operator<br />
* example to explain '''or '''operator<br />
* program to demonstrate '''or '''operator<br />
* not (!) operator<br />
* program to demonstrate '''or '''operator<br />
* save, compile and run the programs<br/> <br />
<br />
<br />
14. if else construct<br />
<br />
* Conditional Statements and types of Conditional Statements<br />
* Use of if statement<br />
* Syntax for if statement<br />
* Program using if statement<br />
* Use of if else statement<br />
* Syntax for if else statement<br />
* Program using if else statement<br />
* Use of if else if statement<br />
* Syntax for if else if statement<br />
* Program using if else if statement<br/> <br />
<br />
<br />
15. nested if and ternary operator<br />
<br />
* explain nested if<br />
* nested if syntax<br />
* program to demonstrate nested if<br />
* explain the control flow of the program<br />
* explain ternary operator<br />
* syntax for ternary operator<br />
* explain the syntax<br />
* program to demonstrate ternary operator<br />
* comparison between ternary operator and nested if<br />
* save, compile and run the program<br/> <br />
<br />
<br />
16. switch statement<br />
<br />
* define switch case statement<br />
* compare switch and nested if<br />
* switch case syntax<br />
* working of a switch case statement<br />
* use of keyword switch<br />
* valid and invalid use of keyword '''case'''<br />
* use of keyword default<br />
* use of keyword break<br />
* program to demonstrate switch case statement<br />
* save, compile and run the program to check the output<br />
<br />
17. while loop<br />
<br />
* Loop control statement <br />
* types of loop control statements<br />
* Introduction to while loop<br />
* syntax of while loop<br />
* Program using while loop<br />
* Check the output.<br />
* Introduction to infinite loop<br />
* loop variable modification<br />
* Check the output<br />
* How to terminate the infinite loop<br/> <br />
<br />
<br />
18. for loop<br />
<br />
* syntax<br />
* loop continuing condition<br />
* loop variable modification<br/> <br />
<br />
<br />
19. do while loop<br />
<br />
* define do while <br />
* do while syntax<br />
* working of do while loop<br />
* example of do while loop<br />
* explain the do while programming<br />
* save, compile and run the program to check the output <br />
* how different is it from the while loop<br />
* program to demonstrate the differences<br />
<br />
== Arrays ==<br />
20. Introduction to Arrays<br />
<br />
* What are arrays<br />
* Types of arrays<br />
* How to create arrays<br />
<br />
21. Array operations<br />
<br />
* Accessing array items<br />
* Checking for bounds<br />
<br />
== Classes & Objects ==<br />
== 22. Creating class ==<br />
* Whatever we can see in this world are all objects<br />
* Objects can be categorized into groups known as class<br />
* This is class in real world<br />
* Human Being is an example of class in real world<br />
* Class in java is the blue print from which individual objects are created<br />
* Class consists defines a set of properties called variables and a set of behaviors called methods<br />
* Syntax for creating class<br />
* Create a simple class Student using Eclipse<br />
* The Student class can contain properties<br/> <br />
<br />
<br />
23. Creating Object<br />
<br />
* An object is an instance of a class<br />
* Each object consist of state and behavior<br />
* Object stores it state in fields or variables<br />
* It exposes its behavior through methods<br />
* Reference variables<br />
* Create a class named TestStudent<br />
* Create an object of the Student class<br />
* Use new operator<br />
* Check what the reference variable contains<br />
* Create one more object of the Student class and check what the reference variable contains<br />
<br />
24. Instance fields<br />
<br />
* Also known as non-static fields<br />
* Open the TestStudent class which we have created<br />
* Access the fields roll_number and name using dot operator<br />
* See the output<br />
* Initialize the field and see the output<br />
* Change the modifier of the fields to private<br />
* Debug the error that you get<br />
* Change the modifier to protected<br />
* Each object of a class will have unique values<br />
* Create two objects of the Student class <br />
<br />
25. methods<br />
<br />
* method definition <br />
* write simple method<br />
* method returning value<br />
* call a method in another method<br />
* flow of the program<br />
* call a static method<br />
* call a method from another class<br />
* method signature<br />
* method body <br />
<br />
== Constructors ==<br />
26. default constructor<br />
<br />
* what is a constructor?<br />
* what is a default constructor?<br />
* when is it called?<br />
* define a constructor<br />
* initialize the variables<br />
* call the constructor<br />
* difference between constructor and method<br/> <br />
<br />
<br />
27. parameterized constructors<br />
<br />
* What is a parameterized constructor?<br />
* create constructor without parameter<br />
* create a constructor with parameter<br />
* assign values to the variables in the constructor<br />
* pass arguments during the constructor call<br />
* working of parameterized constructor<br />
* show common errors<br />
* resolve the errors<br />
* create another parameterized constructor<br />
* why to use constructor?<br />
<br />
28. using this keyword<br />
<br />
* this is a reference to the current object<br />
* helps to avoid name conflicts<br />
* we can use this keyword inside a constructor to call another one<br />
* the constructors must be in the same class<br />
* explicit constructor invocation<br />
* Explain it using the parameterized constructor code<br />
* Make this statement the last one in the constructor<br />
* You will get an error<br />
* this statement should be the first one inside a constructor<br />
<br />
29. non-static block<br />
<br />
* Non-static block <br />
* Any code written between two curly brackets <br />
* Executed for each object that is created <br />
* Executes before constructor's execution <br />
* can initialize instance member variables of the class <br />
* create a class named NonStaticTest <br />
* Create a non-static block and a constructor inside it <br />
* Check the output <br />
* Include multiple non-static blocks <br />
* they will be executed in the sequence in which they appear in the class <br />
* Check the output <br />
* Non-static block is not a substitute for constructor<br />
<br />
30. constructor overloading<br />
<br />
* define multiple constructor<br />
* what is constructor overloading?<br />
* constructor with different number of parameters.<br />
* parameters with different datatypes.<br />
* how is constructor overloaded?<br />
* flow of overloading process.<br />
* advantage of constructor overloading.<br />
<br />
31. method overloading<br />
<br />
* define multiple methods.<br />
* methods with same name.<br />
* methods with different number of parameters.<br />
* methods with different datatypes of parameter.<br />
* what is method overloading?<br />
* example for overloadin method<br />
* how to overload method?<br />
* advantage of method overloading.<br />
* error in method overloading.<br />
<br />
== Intermediate Level ==<br />
<br />
== Advanced Level ==</div>Pratham920https://script.spoken-tutorial.org/index.php/JavaJava2013-01-14T12:18:56Z<p>Pratham920: /* 1. Getting started with Java – installation */</p>
<hr />
<div>=Introduction=<br />
'''Welcome to online web tutorials for java'''<br><br />
Java[ http://java.sun.com ]is a free and open source high level programming language. It is simple as well as object oriented language. Till date, the Java platform has attracted more than 6.5 million software developers. Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as today's demanding Embedded and Real-Time environments.From laptops to mobile phones, game consoles to scientific supercomputers, music players to the Internet,Set-top boxes to printers, Web cams to medical devices,Ooops that is a huge list to follow,Java is everywhere!!!!!<br />
<br />
This set of tutorials will cover features and usage of Java version 1.6.x Please see the associated text box of individual spoken tutorials on the website to decide the versions of Java and OS to which it is applicable. <br />
<br />
The Spoken Tutorial Effort for Java is contributed jointly by '''TalentSprint, Hyderabad''' and the '''Spoken Tutorial Team, IIT Bombay'''. Other contributors who helped in the creation of the scripts are ............ <br />
<br />
<blockquote style="background-color: lemonchiffon; border: solid thin grey;"><br />
[[Media:JavaTemplate.zip | Java Slide Template]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
[[Glossary_for_Java | Glossary]]<br />
</blockquote><br />
<br />
__TOC__<br />
<br />
= Basic Level =<br />
<br />
1. Getting started with Java – installation <br />
* Install jdk from Synaptic Package Manager<br />
* Choose openjdk-6-jdk from the list of packages available <br />
* Mark it for installation<br />
* The installation will take a few seconds<br />
* Verify the installation<br />
* At the command prompt type java -version, so the version number of the jdk will be displayed<br />
* Run a simple java program and see if it works<br />
* Type javac TestProgram.java for compiling the code and java TestProgram for executing the code<br />
<br />
2. Java - First program<br />
<br />
* write simple java program <br />
* print “My First Java Program!” on Console<br />
* save the file<br />
* file name given to the java file<br />
* compile the file<br />
* run the file<br />
* correct the errors<br />
* naming conventions for class<br />
* naming conventions for method<br />
* naming conventions for variable<br />
<br />
= Eclipse =<br />
= 3. Installing Eclipse =<br />
* Install Eclipse on Ubuntu on the Terminal<br />
* Set up the proxy on the Terminal <br />
* Then fetch the list of all the available softwares<br />
* Type sudo apt-get update<br />
* Then install eclipse on the Terminal<br />
* Type sudo apt-get install eclipse<br />
* Verify if Eclipse is installed on the system<br />
* Installing Eclipse on Debian,Kubuntu,Xubuntu<br />
* Installing Eclipse on Redhat <br />
* Installing Eclipse on Fedora,centos and suse linux<br />
<br />
4. Getting started with Eclipse<br />
<br />
* Eclipse is an Integrated Development Environment<br />
* It is a tool on which one can write, debug and run java programs easily<br />
* Open Dash Home and type Eclipse in the search box.<br />
* We get Workspace Launcher<br />
* On clicking on Workbench we get the Eclipse IDE<br />
* Go to File->New->Project and select Java Project<br />
* Create a project named EclipseDemo and create a class inside DemoClass<br />
* Learn about Package Explorer and Editor portlet<br />
* Add the println statement in<br/> <br />
<br />
<br />
5. Hello World Program<br />
<br />
* Open Eclipse<br />
* Create a Java Project named DemoProject<br />
* Create a class named DemoClass<br />
* Class name and file name will be the same<br />
* Eclipse suggests various possibilities as we type a command<br />
* Eclipse also completes the parentheses by automatically adding the closing parentheses<br />
* Include the statement that we want to print<br />
* Eclipse also completes the quotes by adding the closing quote<br />
* Compile and execute the program<br />
* Change the code to print<br/> <br />
<br />
<br />
6. Errors and Debugging<br />
<br />
* When writing a Java Program, here is a list of typical errors:<br />
* Missing semicolon(;)<br />
* Missing double quotes(".")<br />
* Mis-match of filename and classname<br />
* Typing the print statement n lower case<br />
* The line which has the error will be indicated with a red cross mark on the left margin<br />
* The list of errors is displayed by hovering the mouse over the cross mark<br />
* Create a class ErrorFree with Errors, debug the code and run it<br />
* Eclipse also offers intelligent fixes<br/> <br />
<br />
<br />
7. Programming features of Eclipse<br />
<br />
* Auto completion<br />
* Sets the corresponding closing brace when we open the brace<br />
* Provides a drop-down list of methods when you start typing the code.<br />
* syntax highlighting<br />
* classname is highlighted in pink color and method in blue color.<br />
* keyboard shortcuts<br />
* F11 to debug a program and Ctrl plus H to search a specific file.<br />
* error highlighting<br />
* cross symbol in the program denotes errors<br />
* Remove semicolon and error details are displayed when mouse is hovered over cross symbol.<br />
<br />
= The Java Programming language -- Basic Level =<br />
== Fundamental Programming Structures in Java ==<br />
8. Numerical datatypes<br />
<br />
* define datatypes and numerical datatypes<br />
* int<br />
* float<br />
* byte<br />
* short<br />
* long<br />
* double<br />
* range of each numerical datatypes<br />
* declaration and initializationof numerical datatypes.<br />
* valid and invalid declaration<br />
<br />
9. Arithmetic Operations<br />
<br />
* define an operator<br />
* define arithmetic operators<br />
* addition<br />
* subtraction<br />
* multiplication<br />
* division<br />
* modulo<br />
* simple program to demonstrate arithmetic operators<br />
* appropriate datatypes for appropriate values<br />
* save, compile and run the program<br/> <br />
<br />
<br />
10. Strings<br />
<br />
* char datatype<br />
* letter, digit, punctuation marks, '''tab''', or a space are all characters.<br />
* Program explaining the variable and the character data.<br />
* Introduction to strings<br />
* Creating string by Direct Initialization<br />
* Creating string by using new operator<br />
* String length()<br />
* String concat()<br />
* String toUpperCase()<br />
* String toLowerCase()<br/> <br />
<br />
<br />
11. Primitive type conversions<br />
<br />
* define type conversion or type casting<br />
* higher order integer to lower order integer- Explicit type casting<br />
* program to show explicit type casting<br />
* common mistake in explicit type casting.<br />
* program to show common mistake in explicit type casting<br />
<br />
* lower order integer to higher order integer – Implicit type casting<br />
* program to show implicit type casting<br />
* char to integer<br />
* integer to char<br />
* program to show char to int type casting.<br />
<br />
== Control flow ==<br />
12. Relational Operations<br />
<br />
* bool datatype<br />
* equal to and not equal to<br />
* less than and less than or equal to<br />
* greater than and greater than or equal to<br/> <br />
<br />
<br />
13. Logical Operations<br />
<br />
* use of logical operators<br />
* and (&&) operator<br />
* example to explain '''and''' operator<br />
* program to demonstrate '''and''' operator<br />
* or (||) operator<br />
* example to explain '''or '''operator<br />
* program to demonstrate '''or '''operator<br />
* not (!) operator<br />
* program to demonstrate '''or '''operator<br />
* save, compile and run the programs<br/> <br />
<br />
<br />
14. if else construct<br />
<br />
* Conditional Statements and types of Conditional Statements<br />
* Use of if statement<br />
* Syntax for if statement<br />
* Program using if statement<br />
* Use of if else statement<br />
* Syntax for if else statement<br />
* Program using if else statement<br />
* Use of if else if statement<br />
* Syntax for if else if statement<br />
* Program using if else if statement<br/> <br />
<br />
<br />
15. nested if and ternary operator<br />
<br />
* explain nested if<br />
* nested if syntax<br />
* program to demonstrate nested if<br />
* explain the control flow of the program<br />
* explain ternary operator<br />
* syntax for ternary operator<br />
* explain the syntax<br />
* program to demonstrate ternary operator<br />
* comparison between ternary operator and nested if<br />
* save, compile and run the program<br/> <br />
<br />
<br />
16. switch statement<br />
<br />
* define switch case statement<br />
* compare switch and nested if<br />
* switch case syntax<br />
* working of a switch case statement<br />
* use of keyword switch<br />
* valid and invalid use of keyword '''case'''<br />
* use of keyword default<br />
* use of keyword break<br />
* program to demonstrate switch case statement<br />
* save, compile and run the program to check the output<br />
<br />
17. while loop<br />
<br />
* Loop control statement <br />
* types of loop control statements<br />
* Introduction to while loop<br />
* syntax of while loop<br />
* Program using while loop<br />
* Check the output.<br />
* Introduction to infinite loop<br />
* loop variable modification<br />
* Check the output<br />
* How to terminate the infinite loop<br/> <br />
<br />
<br />
18. for loop<br />
<br />
* syntax<br />
* loop continuing condition<br />
* loop variable modification<br/> <br />
<br />
<br />
19. do while loop<br />
<br />
* define do while <br />
* do while syntax<br />
* working of do while loop<br />
* example of do while loop<br />
* explain the do while programming<br />
* save, compile and run the program to check the output <br />
* how different is it from the while loop<br />
* program to demonstrate the differences<br />
<br />
== Arrays ==<br />
20. Introduction to Arrays<br />
<br />
* What are arrays<br />
* Types of arrays<br />
* How to create arrays<br />
<br />
21. Array operations<br />
<br />
* Accessing array items<br />
* Checking for bounds<br />
<br />
== Classes & Objects ==<br />
== 22. Creating class ==<br />
* Whatever we can see in this world are all objects<br />
* Objects can be categorized into groups known as class<br />
* This is class in real world<br />
* Human Being is an example of class in real world<br />
* Class in java is the blue print from which individual objects are created<br />
* Class consists defines a set of properties called variables and a set of behaviors called methods<br />
* Syntax for creating class<br />
* Create a simple class Student using Eclipse<br />
* The Student class can contain properties<br/> <br />
<br />
<br />
23. Creating Object<br />
<br />
* An object is an instance of a class<br />
* Each object consist of state and behavior<br />
* Object stores it state in fields or variables<br />
* It exposes its behavior through methods<br />
* Reference variables<br />
* Create a class named TestStudent<br />
* Create an object of the Student class<br />
* Use new operator<br />
* Check what the reference variable contains<br />
* Create one more object of the Student class and check what the reference variable contains<br />
<br />
24. Instance fields<br />
<br />
* Also known as non-static fields<br />
* Open the TestStudent class which we have created<br />
* Access the fields roll_number and name using dot operator<br />
* See the output<br />
* Initialize the field and see the output<br />
* Change the modifier of the fields to private<br />
* Debug the error that you get<br />
* Change the modifier to protected<br />
* Each object of a class will have unique values<br />
* Create two objects of the Student class <br />
<br />
25. methods<br />
<br />
* method definition <br />
* write simple method<br />
* method returning value<br />
* call a method in another method<br />
* flow of the program<br />
* call a static method<br />
* call a method from another class<br />
* method signature<br />
* method body <br />
<br />
== Constructors ==<br />
26. default constructor<br />
<br />
* what is a constructor?<br />
* what is a default constructor?<br />
* when is it called?<br />
* define a constructor<br />
* initialize the variables<br />
* call the constructor<br />
* difference between constructor and method<br/> <br />
<br />
<br />
27. parameterized constructors<br />
<br />
* What is a parameterized constructor?<br />
* create constructor without parameter<br />
* create a constructor with parameter<br />
* assign values to the variables in the constructor<br />
* pass arguments during the constructor call<br />
* working of parameterized constructor<br />
* show common errors<br />
* resolve the errors<br />
* create another parameterized constructor<br />
* why to use constructor?<br />
<br />
28. using this keyword<br />
<br />
* this is a reference to the current object<br />
* helps to avoid name conflicts<br />
* we can use this keyword inside a constructor to call another one<br />
* the constructors must be in the same class<br />
* explicit constructor invocation<br />
* Explain it using the parameterized constructor code<br />
* Make this statement the last one in the constructor<br />
* You will get an error<br />
* this statement should be the first one inside a constructor<br />
<br />
29. non-static block<br />
<br />
* Non-static block <br />
* Any code written between two curly brackets <br />
* Executed for each object that is created <br />
* Executes before constructor's execution <br />
* can initialize instance member variables of the class <br />
* create a class named NonStaticTest <br />
* Create a non-static block and a constructor inside it <br />
* Check the output <br />
* Include multiple non-static blocks <br />
* they will be executed in the sequence in which they appear in the class <br />
* Check the output <br />
* Non-static block is not a substitute for constructor<br />
<br />
30. constructor overloading<br />
<br />
* define multiple constructor<br />
* what is constructor overloading?<br />
* constructor with different number of parameters.<br />
* parameters with different datatypes.<br />
* how is constructor overloaded?<br />
* flow of overloading process.<br />
* advantage of constructor overloading.<br />
<br />
31. method overloading<br />
<br />
* define multiple methods.<br />
* methods with same name.<br />
* methods with different number of parameters.<br />
* methods with different datatypes of parameter.<br />
* what is method overloading?<br />
* example for overloadin method<br />
* how to overload method?<br />
* advantage of method overloading.<br />
* error in method overloading.<br />
<br />
== Intermediate Level ==<br />
<br />
== Advanced Level ==</div>Pratham920https://script.spoken-tutorial.org/index.php/JavaJava2013-01-14T12:18:19Z<p>Pratham920: /* Introduction to Java */</p>
<hr />
<div>=Introduction=<br />
'''Welcome to online web tutorials for java'''<br><br />
Java[ http://java.sun.com ]is a free and open source high level programming language. It is simple as well as object oriented language. Till date, the Java platform has attracted more than 6.5 million software developers. Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as today's demanding Embedded and Real-Time environments.From laptops to mobile phones, game consoles to scientific supercomputers, music players to the Internet,Set-top boxes to printers, Web cams to medical devices,Ooops that is a huge list to follow,Java is everywhere!!!!!<br />
<br />
This set of tutorials will cover features and usage of Java version 1.6.x Please see the associated text box of individual spoken tutorials on the website to decide the versions of Java and OS to which it is applicable. <br />
<br />
The Spoken Tutorial Effort for Java is contributed jointly by '''TalentSprint, Hyderabad''' and the '''Spoken Tutorial Team, IIT Bombay'''. Other contributors who helped in the creation of the scripts are ............ <br />
<br />
<blockquote style="background-color: lemonchiffon; border: solid thin grey;"><br />
[[Media:JavaTemplate.zip | Java Slide Template]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
[[Glossary_for_Java | Glossary]]<br />
</blockquote><br />
<br />
__TOC__<br />
<br />
= 1. Getting started with Java – installation =<br />
* Install jdk from Synaptic Package Manager<br />
* Choose openjdk-6-jdk from the list of packages available <br />
* Mark it for installation<br />
* The installation will take a few seconds<br />
* Verify the installation<br />
* At the command prompt type java -version, so the version number of the jdk will be displayed<br />
* Run a simple java program and see if it works<br />
* Type javac TestProgram.java for compiling the code and java TestProgram for executing the code<br />
<br />
2. Java - First program<br />
<br />
* write simple java program <br />
* print “My First Java Program!” on Console<br />
* save the file<br />
* file name given to the java file<br />
* compile the file<br />
* run the file<br />
* correct the errors<br />
* naming conventions for class<br />
* naming conventions for method<br />
* naming conventions for variable <br />
<br />
= Eclipse =<br />
= 3. Installing Eclipse =<br />
* Install Eclipse on Ubuntu on the Terminal<br />
* Set up the proxy on the Terminal <br />
* Then fetch the list of all the available softwares<br />
* Type sudo apt-get update<br />
* Then install eclipse on the Terminal<br />
* Type sudo apt-get install eclipse<br />
* Verify if Eclipse is installed on the system<br />
* Installing Eclipse on Debian,Kubuntu,Xubuntu<br />
* Installing Eclipse on Redhat <br />
* Installing Eclipse on Fedora,centos and suse linux<br />
<br />
4. Getting started with Eclipse<br />
<br />
* Eclipse is an Integrated Development Environment<br />
* It is a tool on which one can write, debug and run java programs easily<br />
* Open Dash Home and type Eclipse in the search box.<br />
* We get Workspace Launcher<br />
* On clicking on Workbench we get the Eclipse IDE<br />
* Go to File->New->Project and select Java Project<br />
* Create a project named EclipseDemo and create a class inside DemoClass<br />
* Learn about Package Explorer and Editor portlet<br />
* Add the println statement in<br/> <br />
<br />
<br />
5. Hello World Program<br />
<br />
* Open Eclipse<br />
* Create a Java Project named DemoProject<br />
* Create a class named DemoClass<br />
* Class name and file name will be the same<br />
* Eclipse suggests various possibilities as we type a command<br />
* Eclipse also completes the parentheses by automatically adding the closing parentheses<br />
* Include the statement that we want to print<br />
* Eclipse also completes the quotes by adding the closing quote<br />
* Compile and execute the program<br />
* Change the code to print<br/> <br />
<br />
<br />
6. Errors and Debugging<br />
<br />
* When writing a Java Program, here is a list of typical errors:<br />
* Missing semicolon(;)<br />
* Missing double quotes(".")<br />
* Mis-match of filename and classname<br />
* Typing the print statement n lower case<br />
* The line which has the error will be indicated with a red cross mark on the left margin<br />
* The list of errors is displayed by hovering the mouse over the cross mark<br />
* Create a class ErrorFree with Errors, debug the code and run it<br />
* Eclipse also offers intelligent fixes<br/> <br />
<br />
<br />
7. Programming features of Eclipse<br />
<br />
* Auto completion<br />
* Sets the corresponding closing brace when we open the brace<br />
* Provides a drop-down list of methods when you start typing the code.<br />
* syntax highlighting<br />
* classname is highlighted in pink color and method in blue color.<br />
* keyboard shortcuts<br />
* F11 to debug a program and Ctrl plus H to search a specific file.<br />
* error highlighting<br />
* cross symbol in the program denotes errors<br />
* Remove semicolon and error details are displayed when mouse is hovered over cross symbol.<br />
<br />
= The Java Programming language -- Basic Level =<br />
== Fundamental Programming Structures in Java ==<br />
8. Numerical datatypes<br />
<br />
* define datatypes and numerical datatypes<br />
* int<br />
* float<br />
* byte<br />
* short<br />
* long<br />
* double<br />
* range of each numerical datatypes<br />
* declaration and initializationof numerical datatypes.<br />
* valid and invalid declaration<br />
<br />
9. Arithmetic Operations<br />
<br />
* define an operator<br />
* define arithmetic operators<br />
* addition<br />
* subtraction<br />
* multiplication<br />
* division<br />
* modulo<br />
* simple program to demonstrate arithmetic operators<br />
* appropriate datatypes for appropriate values<br />
* save, compile and run the program<br/> <br />
<br />
<br />
10. Strings<br />
<br />
* char datatype<br />
* letter, digit, punctuation marks, '''tab''', or a space are all characters.<br />
* Program explaining the variable and the character data.<br />
* Introduction to strings<br />
* Creating string by Direct Initialization<br />
* Creating string by using new operator<br />
* String length()<br />
* String concat()<br />
* String toUpperCase()<br />
* String toLowerCase()<br/> <br />
<br />
<br />
11. Primitive type conversions<br />
<br />
* define type conversion or type casting<br />
* higher order integer to lower order integer- Explicit type casting<br />
* program to show explicit type casting<br />
* common mistake in explicit type casting.<br />
* program to show common mistake in explicit type casting<br />
<br />
* lower order integer to higher order integer – Implicit type casting<br />
* program to show implicit type casting<br />
* char to integer<br />
* integer to char<br />
* program to show char to int type casting.<br />
<br />
== Control flow ==<br />
12. Relational Operations<br />
<br />
* bool datatype<br />
* equal to and not equal to<br />
* less than and less than or equal to<br />
* greater than and greater than or equal to<br/> <br />
<br />
<br />
13. Logical Operations<br />
<br />
* use of logical operators<br />
* and (&&) operator<br />
* example to explain '''and''' operator<br />
* program to demonstrate '''and''' operator<br />
* or (||) operator<br />
* example to explain '''or '''operator<br />
* program to demonstrate '''or '''operator<br />
* not (!) operator<br />
* program to demonstrate '''or '''operator<br />
* save, compile and run the programs<br/> <br />
<br />
<br />
14. if else construct<br />
<br />
* Conditional Statements and types of Conditional Statements<br />
* Use of if statement<br />
* Syntax for if statement<br />
* Program using if statement<br />
* Use of if else statement<br />
* Syntax for if else statement<br />
* Program using if else statement<br />
* Use of if else if statement<br />
* Syntax for if else if statement<br />
* Program using if else if statement<br/> <br />
<br />
<br />
15. nested if and ternary operator<br />
<br />
* explain nested if<br />
* nested if syntax<br />
* program to demonstrate nested if<br />
* explain the control flow of the program<br />
* explain ternary operator<br />
* syntax for ternary operator<br />
* explain the syntax<br />
* program to demonstrate ternary operator<br />
* comparison between ternary operator and nested if<br />
* save, compile and run the program<br/> <br />
<br />
<br />
16. switch statement<br />
<br />
* define switch case statement<br />
* compare switch and nested if<br />
* switch case syntax<br />
* working of a switch case statement<br />
* use of keyword switch<br />
* valid and invalid use of keyword '''case'''<br />
* use of keyword default<br />
* use of keyword break<br />
* program to demonstrate switch case statement<br />
* save, compile and run the program to check the output<br />
<br />
17. while loop<br />
<br />
* Loop control statement <br />
* types of loop control statements<br />
* Introduction to while loop<br />
* syntax of while loop<br />
* Program using while loop<br />
* Check the output.<br />
* Introduction to infinite loop<br />
* loop variable modification<br />
* Check the output<br />
* How to terminate the infinite loop<br/> <br />
<br />
<br />
18. for loop<br />
<br />
* syntax<br />
* loop continuing condition<br />
* loop variable modification<br/> <br />
<br />
<br />
19. do while loop<br />
<br />
* define do while <br />
* do while syntax<br />
* working of do while loop<br />
* example of do while loop<br />
* explain the do while programming<br />
* save, compile and run the program to check the output <br />
* how different is it from the while loop<br />
* program to demonstrate the differences<br />
<br />
== Arrays ==<br />
20. Introduction to Arrays<br />
<br />
* What are arrays<br />
* Types of arrays<br />
* How to create arrays<br />
<br />
21. Array operations<br />
<br />
* Accessing array items<br />
* Checking for bounds<br />
<br />
== Classes & Objects ==<br />
== 22. Creating class ==<br />
* Whatever we can see in this world are all objects<br />
* Objects can be categorized into groups known as class<br />
* This is class in real world<br />
* Human Being is an example of class in real world<br />
* Class in java is the blue print from which individual objects are created<br />
* Class consists defines a set of properties called variables and a set of behaviors called methods<br />
* Syntax for creating class<br />
* Create a simple class Student using Eclipse<br />
* The Student class can contain properties<br/> <br />
<br />
<br />
23. Creating Object<br />
<br />
* An object is an instance of a class<br />
* Each object consist of state and behavior<br />
* Object stores it state in fields or variables<br />
* It exposes its behavior through methods<br />
* Reference variables<br />
* Create a class named TestStudent<br />
* Create an object of the Student class<br />
* Use new operator<br />
* Check what the reference variable contains<br />
* Create one more object of the Student class and check what the reference variable contains<br />
<br />
24. Instance fields<br />
<br />
* Also known as non-static fields<br />
* Open the TestStudent class which we have created<br />
* Access the fields roll_number and name using dot operator<br />
* See the output<br />
* Initialize the field and see the output<br />
* Change the modifier of the fields to private<br />
* Debug the error that you get<br />
* Change the modifier to protected<br />
* Each object of a class will have unique values<br />
* Create two objects of the Student class <br />
<br />
25. methods<br />
<br />
* method definition <br />
* write simple method<br />
* method returning value<br />
* call a method in another method<br />
* flow of the program<br />
* call a static method<br />
* call a method from another class<br />
* method signature<br />
* method body <br />
<br />
== Constructors ==<br />
26. default constructor<br />
<br />
* what is a constructor?<br />
* what is a default constructor?<br />
* when is it called?<br />
* define a constructor<br />
* initialize the variables<br />
* call the constructor<br />
* difference between constructor and method<br/> <br />
<br />
<br />
27. parameterized constructors<br />
<br />
* What is a parameterized constructor?<br />
* create constructor without parameter<br />
* create a constructor with parameter<br />
* assign values to the variables in the constructor<br />
* pass arguments during the constructor call<br />
* working of parameterized constructor<br />
* show common errors<br />
* resolve the errors<br />
* create another parameterized constructor<br />
* why to use constructor?<br />
<br />
28. using this keyword<br />
<br />
* this is a reference to the current object<br />
* helps to avoid name conflicts<br />
* we can use this keyword inside a constructor to call another one<br />
* the constructors must be in the same class<br />
* explicit constructor invocation<br />
* Explain it using the parameterized constructor code<br />
* Make this statement the last one in the constructor<br />
* You will get an error<br />
* this statement should be the first one inside a constructor<br />
<br />
29. non-static block<br />
<br />
* Non-static block <br />
* Any code written between two curly brackets <br />
* Executed for each object that is created <br />
* Executes before constructor's execution <br />
* can initialize instance member variables of the class <br />
* create a class named NonStaticTest <br />
* Create a non-static block and a constructor inside it <br />
* Check the output <br />
* Include multiple non-static blocks <br />
* they will be executed in the sequence in which they appear in the class <br />
* Check the output <br />
* Non-static block is not a substitute for constructor<br />
<br />
30. constructor overloading<br />
<br />
* define multiple constructor<br />
* what is constructor overloading?<br />
* constructor with different number of parameters.<br />
* parameters with different datatypes.<br />
* how is constructor overloaded?<br />
* flow of overloading process.<br />
* advantage of constructor overloading.<br />
<br />
31. method overloading<br />
<br />
* define multiple methods.<br />
* methods with same name.<br />
* methods with different number of parameters.<br />
* methods with different datatypes of parameter.<br />
* what is method overloading?<br />
* example for overloadin method<br />
* how to overload method?<br />
* advantage of method overloading.<br />
* error in method overloading.<br />
<br />
== Intermediate Level ==<br />
<br />
== Advanced Level ==</div>Pratham920https://script.spoken-tutorial.org/index.php/JavaJava2013-01-14T12:18:00Z<p>Pratham920: /* Java Spoken Tutorials - Outline */</p>
<hr />
<div>=Introduction=<br />
'''Welcome to online web tutorials for java'''<br><br />
Java[ http://java.sun.com ]is a free and open source high level programming language. It is simple as well as object oriented language. Till date, the Java platform has attracted more than 6.5 million software developers. Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as today's demanding Embedded and Real-Time environments.From laptops to mobile phones, game consoles to scientific supercomputers, music players to the Internet,Set-top boxes to printers, Web cams to medical devices,Ooops that is a huge list to follow,Java is everywhere!!!!!<br />
<br />
This set of tutorials will cover features and usage of Java version 1.6.x Please see the associated text box of individual spoken tutorials on the website to decide the versions of Java and OS to which it is applicable. <br />
<br />
The Spoken Tutorial Effort for Java is contributed jointly by '''TalentSprint, Hyderabad''' and the '''Spoken Tutorial Team, IIT Bombay'''. Other contributors who helped in the creation of the scripts are ............ <br />
<br />
<blockquote style="background-color: lemonchiffon; border: solid thin grey;"><br />
[[Media:JavaTemplate.zip | Java Slide Template]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
[[Glossary_for_Java | Glossary]]<br />
</blockquote><br />
<br />
__TOC__<br />
<br />
= Introduction to Java =<br />
= 1. Getting started with Java – installation =<br />
* Install jdk from Synaptic Package Manager<br />
* Choose openjdk-6-jdk from the list of packages available <br />
* Mark it for installation<br />
* The installation will take a few seconds<br />
* Verify the installation<br />
* At the command prompt type java -version, so the version number of the jdk will be displayed<br />
* Run a simple java program and see if it works<br />
* Type javac TestProgram.java for compiling the code and java TestProgram for executing the code<br />
<br />
2. Java - First program<br />
<br />
* write simple java program <br />
* print “My First Java Program!” on Console<br />
* save the file<br />
* file name given to the java file<br />
* compile the file<br />
* run the file<br />
* correct the errors<br />
* naming conventions for class<br />
* naming conventions for method<br />
* naming conventions for variable <br />
<br />
= Eclipse =<br />
= 3. Installing Eclipse =<br />
* Install Eclipse on Ubuntu on the Terminal<br />
* Set up the proxy on the Terminal <br />
* Then fetch the list of all the available softwares<br />
* Type sudo apt-get update<br />
* Then install eclipse on the Terminal<br />
* Type sudo apt-get install eclipse<br />
* Verify if Eclipse is installed on the system<br />
* Installing Eclipse on Debian,Kubuntu,Xubuntu<br />
* Installing Eclipse on Redhat <br />
* Installing Eclipse on Fedora,centos and suse linux<br />
<br />
4. Getting started with Eclipse<br />
<br />
* Eclipse is an Integrated Development Environment<br />
* It is a tool on which one can write, debug and run java programs easily<br />
* Open Dash Home and type Eclipse in the search box.<br />
* We get Workspace Launcher<br />
* On clicking on Workbench we get the Eclipse IDE<br />
* Go to File->New->Project and select Java Project<br />
* Create a project named EclipseDemo and create a class inside DemoClass<br />
* Learn about Package Explorer and Editor portlet<br />
* Add the println statement in<br/> <br />
<br />
<br />
5. Hello World Program<br />
<br />
* Open Eclipse<br />
* Create a Java Project named DemoProject<br />
* Create a class named DemoClass<br />
* Class name and file name will be the same<br />
* Eclipse suggests various possibilities as we type a command<br />
* Eclipse also completes the parentheses by automatically adding the closing parentheses<br />
* Include the statement that we want to print<br />
* Eclipse also completes the quotes by adding the closing quote<br />
* Compile and execute the program<br />
* Change the code to print<br/> <br />
<br />
<br />
6. Errors and Debugging<br />
<br />
* When writing a Java Program, here is a list of typical errors:<br />
* Missing semicolon(;)<br />
* Missing double quotes(".")<br />
* Mis-match of filename and classname<br />
* Typing the print statement n lower case<br />
* The line which has the error will be indicated with a red cross mark on the left margin<br />
* The list of errors is displayed by hovering the mouse over the cross mark<br />
* Create a class ErrorFree with Errors, debug the code and run it<br />
* Eclipse also offers intelligent fixes<br/> <br />
<br />
<br />
7. Programming features of Eclipse<br />
<br />
* Auto completion<br />
* Sets the corresponding closing brace when we open the brace<br />
* Provides a drop-down list of methods when you start typing the code.<br />
* syntax highlighting<br />
* classname is highlighted in pink color and method in blue color.<br />
* keyboard shortcuts<br />
* F11 to debug a program and Ctrl plus H to search a specific file.<br />
* error highlighting<br />
* cross symbol in the program denotes errors<br />
* Remove semicolon and error details are displayed when mouse is hovered over cross symbol.<br />
<br />
= The Java Programming language -- Basic Level =<br />
== Fundamental Programming Structures in Java ==<br />
8. Numerical datatypes<br />
<br />
* define datatypes and numerical datatypes<br />
* int<br />
* float<br />
* byte<br />
* short<br />
* long<br />
* double<br />
* range of each numerical datatypes<br />
* declaration and initializationof numerical datatypes.<br />
* valid and invalid declaration<br />
<br />
9. Arithmetic Operations<br />
<br />
* define an operator<br />
* define arithmetic operators<br />
* addition<br />
* subtraction<br />
* multiplication<br />
* division<br />
* modulo<br />
* simple program to demonstrate arithmetic operators<br />
* appropriate datatypes for appropriate values<br />
* save, compile and run the program<br/> <br />
<br />
<br />
10. Strings<br />
<br />
* char datatype<br />
* letter, digit, punctuation marks, '''tab''', or a space are all characters.<br />
* Program explaining the variable and the character data.<br />
* Introduction to strings<br />
* Creating string by Direct Initialization<br />
* Creating string by using new operator<br />
* String length()<br />
* String concat()<br />
* String toUpperCase()<br />
* String toLowerCase()<br/> <br />
<br />
<br />
11. Primitive type conversions<br />
<br />
* define type conversion or type casting<br />
* higher order integer to lower order integer- Explicit type casting<br />
* program to show explicit type casting<br />
* common mistake in explicit type casting.<br />
* program to show common mistake in explicit type casting<br />
<br />
* lower order integer to higher order integer – Implicit type casting<br />
* program to show implicit type casting<br />
* char to integer<br />
* integer to char<br />
* program to show char to int type casting.<br />
<br />
== Control flow ==<br />
12. Relational Operations<br />
<br />
* bool datatype<br />
* equal to and not equal to<br />
* less than and less than or equal to<br />
* greater than and greater than or equal to<br/> <br />
<br />
<br />
13. Logical Operations<br />
<br />
* use of logical operators<br />
* and (&&) operator<br />
* example to explain '''and''' operator<br />
* program to demonstrate '''and''' operator<br />
* or (||) operator<br />
* example to explain '''or '''operator<br />
* program to demonstrate '''or '''operator<br />
* not (!) operator<br />
* program to demonstrate '''or '''operator<br />
* save, compile and run the programs<br/> <br />
<br />
<br />
14. if else construct<br />
<br />
* Conditional Statements and types of Conditional Statements<br />
* Use of if statement<br />
* Syntax for if statement<br />
* Program using if statement<br />
* Use of if else statement<br />
* Syntax for if else statement<br />
* Program using if else statement<br />
* Use of if else if statement<br />
* Syntax for if else if statement<br />
* Program using if else if statement<br/> <br />
<br />
<br />
15. nested if and ternary operator<br />
<br />
* explain nested if<br />
* nested if syntax<br />
* program to demonstrate nested if<br />
* explain the control flow of the program<br />
* explain ternary operator<br />
* syntax for ternary operator<br />
* explain the syntax<br />
* program to demonstrate ternary operator<br />
* comparison between ternary operator and nested if<br />
* save, compile and run the program<br/> <br />
<br />
<br />
16. switch statement<br />
<br />
* define switch case statement<br />
* compare switch and nested if<br />
* switch case syntax<br />
* working of a switch case statement<br />
* use of keyword switch<br />
* valid and invalid use of keyword '''case'''<br />
* use of keyword default<br />
* use of keyword break<br />
* program to demonstrate switch case statement<br />
* save, compile and run the program to check the output<br />
<br />
17. while loop<br />
<br />
* Loop control statement <br />
* types of loop control statements<br />
* Introduction to while loop<br />
* syntax of while loop<br />
* Program using while loop<br />
* Check the output.<br />
* Introduction to infinite loop<br />
* loop variable modification<br />
* Check the output<br />
* How to terminate the infinite loop<br/> <br />
<br />
<br />
18. for loop<br />
<br />
* syntax<br />
* loop continuing condition<br />
* loop variable modification<br/> <br />
<br />
<br />
19. do while loop<br />
<br />
* define do while <br />
* do while syntax<br />
* working of do while loop<br />
* example of do while loop<br />
* explain the do while programming<br />
* save, compile and run the program to check the output <br />
* how different is it from the while loop<br />
* program to demonstrate the differences<br />
<br />
== Arrays ==<br />
20. Introduction to Arrays<br />
<br />
* What are arrays<br />
* Types of arrays<br />
* How to create arrays<br />
<br />
21. Array operations<br />
<br />
* Accessing array items<br />
* Checking for bounds<br />
<br />
== Classes & Objects ==<br />
== 22. Creating class ==<br />
* Whatever we can see in this world are all objects<br />
* Objects can be categorized into groups known as class<br />
* This is class in real world<br />
* Human Being is an example of class in real world<br />
* Class in java is the blue print from which individual objects are created<br />
* Class consists defines a set of properties called variables and a set of behaviors called methods<br />
* Syntax for creating class<br />
* Create a simple class Student using Eclipse<br />
* The Student class can contain properties<br/> <br />
<br />
<br />
23. Creating Object<br />
<br />
* An object is an instance of a class<br />
* Each object consist of state and behavior<br />
* Object stores it state in fields or variables<br />
* It exposes its behavior through methods<br />
* Reference variables<br />
* Create a class named TestStudent<br />
* Create an object of the Student class<br />
* Use new operator<br />
* Check what the reference variable contains<br />
* Create one more object of the Student class and check what the reference variable contains<br />
<br />
24. Instance fields<br />
<br />
* Also known as non-static fields<br />
* Open the TestStudent class which we have created<br />
* Access the fields roll_number and name using dot operator<br />
* See the output<br />
* Initialize the field and see the output<br />
* Change the modifier of the fields to private<br />
* Debug the error that you get<br />
* Change the modifier to protected<br />
* Each object of a class will have unique values<br />
* Create two objects of the Student class <br />
<br />
25. methods<br />
<br />
* method definition <br />
* write simple method<br />
* method returning value<br />
* call a method in another method<br />
* flow of the program<br />
* call a static method<br />
* call a method from another class<br />
* method signature<br />
* method body <br />
<br />
== Constructors ==<br />
26. default constructor<br />
<br />
* what is a constructor?<br />
* what is a default constructor?<br />
* when is it called?<br />
* define a constructor<br />
* initialize the variables<br />
* call the constructor<br />
* difference between constructor and method<br/> <br />
<br />
<br />
27. parameterized constructors<br />
<br />
* What is a parameterized constructor?<br />
* create constructor without parameter<br />
* create a constructor with parameter<br />
* assign values to the variables in the constructor<br />
* pass arguments during the constructor call<br />
* working of parameterized constructor<br />
* show common errors<br />
* resolve the errors<br />
* create another parameterized constructor<br />
* why to use constructor?<br />
<br />
28. using this keyword<br />
<br />
* this is a reference to the current object<br />
* helps to avoid name conflicts<br />
* we can use this keyword inside a constructor to call another one<br />
* the constructors must be in the same class<br />
* explicit constructor invocation<br />
* Explain it using the parameterized constructor code<br />
* Make this statement the last one in the constructor<br />
* You will get an error<br />
* this statement should be the first one inside a constructor<br />
<br />
29. non-static block<br />
<br />
* Non-static block <br />
* Any code written between two curly brackets <br />
* Executed for each object that is created <br />
* Executes before constructor's execution <br />
* can initialize instance member variables of the class <br />
* create a class named NonStaticTest <br />
* Create a non-static block and a constructor inside it <br />
* Check the output <br />
* Include multiple non-static blocks <br />
* they will be executed in the sequence in which they appear in the class <br />
* Check the output <br />
* Non-static block is not a substitute for constructor<br />
<br />
30. constructor overloading<br />
<br />
* define multiple constructor<br />
* what is constructor overloading?<br />
* constructor with different number of parameters.<br />
* parameters with different datatypes.<br />
* how is constructor overloaded?<br />
* flow of overloading process.<br />
* advantage of constructor overloading.<br />
<br />
31. method overloading<br />
<br />
* define multiple methods.<br />
* methods with same name.<br />
* methods with different number of parameters.<br />
* methods with different datatypes of parameter.<br />
* what is method overloading?<br />
* example for overloadin method<br />
* how to overload method?<br />
* advantage of method overloading.<br />
* error in method overloading.<br />
<br />
== Intermediate Level ==<br />
<br />
== Advanced Level ==</div>Pratham920https://script.spoken-tutorial.org/index.php/JavaJava2013-01-14T11:26:14Z<p>Pratham920: /* Constructors */</p>
<hr />
<div>=Introduction=<br />
'''Welcome to online web tutorials for java'''<br><br />
Java[ http://java.sun.com ]is a free and open source high level programming language. It is simple as well as object oriented language. Till date, the Java platform has attracted more than 6.5 million software developers. Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as today's demanding Embedded and Real-Time environments.From laptops to mobile phones, game consoles to scientific supercomputers, music players to the Internet,Set-top boxes to printers, Web cams to medical devices,Ooops that is a huge list to follow,Java is everywhere!!!!!<br />
<br />
This set of tutorials will cover features and usage of Java version 1.6.x Please see the associated text box of individual spoken tutorials on the website to decide the versions of Java and OS to which it is applicable. <br />
<br />
The Spoken Tutorial Effort for Java is contributed jointly by '''TalentSprint, Hyderabad''' and the '''Spoken Tutorial Team, IIT Bombay'''. Other contributors who helped in the creation of the scripts are ............ <br />
<br />
<blockquote style="background-color: lemonchiffon; border: solid thin grey;"><br />
[[Media:JavaTemplate.zip | Java Slide Template]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
[[Glossary_for_Java | Glossary]]<br />
</blockquote><br />
<br />
__TOC__<br />
<br />
= Java Spoken Tutorials - Outline =<br />
= Introduction to Java =<br />
= 1. Getting started with Java – installation =<br />
* Install jdk from Synaptic Package Manager<br />
* Choose openjdk-6-jdk from the list of packages available <br />
* Mark it for installation<br />
* The installation will take a few seconds<br />
* Verify the installation<br />
* At the command prompt type java -version, so the version number of the jdk will be displayed<br />
* Run a simple java program and see if it works<br />
* Type javac TestProgram.java for compiling the code and java TestProgram for executing the code<br />
<br />
2. Java - First program<br />
<br />
* write simple java program <br />
* print “My First Java Program!” on Console<br />
* save the file<br />
* file name given to the java file<br />
* compile the file<br />
* run the file<br />
* correct the errors<br />
* naming conventions for class<br />
* naming conventions for method<br />
* naming conventions for variable <br />
<br />
= Eclipse =<br />
= 3. Installing Eclipse =<br />
* Install Eclipse on Ubuntu on the Terminal<br />
* Set up the proxy on the Terminal <br />
* Then fetch the list of all the available softwares<br />
* Type sudo apt-get update<br />
* Then install eclipse on the Terminal<br />
* Type sudo apt-get install eclipse<br />
* Verify if Eclipse is installed on the system<br />
* Installing Eclipse on Debian,Kubuntu,Xubuntu<br />
* Installing Eclipse on Redhat <br />
* Installing Eclipse on Fedora,centos and suse linux<br />
<br />
4. Getting started with Eclipse<br />
<br />
* Eclipse is an Integrated Development Environment<br />
* It is a tool on which one can write, debug and run java programs easily<br />
* Open Dash Home and type Eclipse in the search box.<br />
* We get Workspace Launcher<br />
* On clicking on Workbench we get the Eclipse IDE<br />
* Go to File->New->Project and select Java Project<br />
* Create a project named EclipseDemo and create a class inside DemoClass<br />
* Learn about Package Explorer and Editor portlet<br />
* Add the println statement in<br/> <br />
<br />
<br />
5. Hello World Program<br />
<br />
* Open Eclipse<br />
* Create a Java Project named DemoProject<br />
* Create a class named DemoClass<br />
* Class name and file name will be the same<br />
* Eclipse suggests various possibilities as we type a command<br />
* Eclipse also completes the parentheses by automatically adding the closing parentheses<br />
* Include the statement that we want to print<br />
* Eclipse also completes the quotes by adding the closing quote<br />
* Compile and execute the program<br />
* Change the code to print<br/> <br />
<br />
<br />
6. Errors and Debugging<br />
<br />
* When writing a Java Program, here is a list of typical errors:<br />
* Missing semicolon(;)<br />
* Missing double quotes(".")<br />
* Mis-match of filename and classname<br />
* Typing the print statement n lower case<br />
* The line which has the error will be indicated with a red cross mark on the left margin<br />
* The list of errors is displayed by hovering the mouse over the cross mark<br />
* Create a class ErrorFree with Errors, debug the code and run it<br />
* Eclipse also offers intelligent fixes<br/> <br />
<br />
<br />
7. Programming features of Eclipse<br />
<br />
* Auto completion<br />
* Sets the corresponding closing brace when we open the brace<br />
* Provides a drop-down list of methods when you start typing the code.<br />
* syntax highlighting<br />
* classname is highlighted in pink color and method in blue color.<br />
* keyboard shortcuts<br />
* F11 to debug a program and Ctrl plus H to search a specific file.<br />
* error highlighting<br />
* cross symbol in the program denotes errors<br />
* Remove semicolon and error details are displayed when mouse is hovered over cross symbol.<br />
<br />
= The Java Programming language -- Basic Level =<br />
== Fundamental Programming Structures in Java ==<br />
8. Numerical datatypes<br />
<br />
* define datatypes and numerical datatypes<br />
* int<br />
* float<br />
* byte<br />
* short<br />
* long<br />
* double<br />
* range of each numerical datatypes<br />
* declaration and initializationof numerical datatypes.<br />
* valid and invalid declaration<br />
<br />
9. Arithmetic Operations<br />
<br />
* define an operator<br />
* define arithmetic operators<br />
* addition<br />
* subtraction<br />
* multiplication<br />
* division<br />
* modulo<br />
* simple program to demonstrate arithmetic operators<br />
* appropriate datatypes for appropriate values<br />
* save, compile and run the program<br/> <br />
<br />
<br />
10. Strings<br />
<br />
* char datatype<br />
* letter, digit, punctuation marks, '''tab''', or a space are all characters.<br />
* Program explaining the variable and the character data.<br />
* Introduction to strings<br />
* Creating string by Direct Initialization<br />
* Creating string by using new operator<br />
* String length()<br />
* String concat()<br />
* String toUpperCase()<br />
* String toLowerCase()<br/> <br />
<br />
<br />
11. Primitive type conversions<br />
<br />
* define type conversion or type casting<br />
* higher order integer to lower order integer- Explicit type casting<br />
* program to show explicit type casting<br />
* common mistake in explicit type casting.<br />
* program to show common mistake in explicit type casting<br />
<br />
* lower order integer to higher order integer – Implicit type casting<br />
* program to show implicit type casting<br />
* char to integer<br />
* integer to char<br />
* program to show char to int type casting.<br />
<br />
== Control flow ==<br />
12. Relational Operations<br />
<br />
* bool datatype<br />
* equal to and not equal to<br />
* less than and less than or equal to<br />
* greater than and greater than or equal to<br/> <br />
<br />
<br />
13. Logical Operations<br />
<br />
* use of logical operators<br />
* and (&&) operator<br />
* example to explain '''and''' operator<br />
* program to demonstrate '''and''' operator<br />
* or (||) operator<br />
* example to explain '''or '''operator<br />
* program to demonstrate '''or '''operator<br />
* not (!) operator<br />
* program to demonstrate '''or '''operator<br />
* save, compile and run the programs<br/> <br />
<br />
<br />
14. if else construct<br />
<br />
* Conditional Statements and types of Conditional Statements<br />
* Use of if statement<br />
* Syntax for if statement<br />
* Program using if statement<br />
* Use of if else statement<br />
* Syntax for if else statement<br />
* Program using if else statement<br />
* Use of if else if statement<br />
* Syntax for if else if statement<br />
* Program using if else if statement<br/> <br />
<br />
<br />
15. nested if and ternary operator<br />
<br />
* explain nested if<br />
* nested if syntax<br />
* program to demonstrate nested if<br />
* explain the control flow of the program<br />
* explain ternary operator<br />
* syntax for ternary operator<br />
* explain the syntax<br />
* program to demonstrate ternary operator<br />
* comparison between ternary operator and nested if<br />
* save, compile and run the program<br/> <br />
<br />
<br />
16. switch statement<br />
<br />
* define switch case statement<br />
* compare switch and nested if<br />
* switch case syntax<br />
* working of a switch case statement<br />
* use of keyword switch<br />
* valid and invalid use of keyword '''case'''<br />
* use of keyword default<br />
* use of keyword break<br />
* program to demonstrate switch case statement<br />
* save, compile and run the program to check the output<br />
<br />
17. while loop<br />
<br />
* Loop control statement <br />
* types of loop control statements<br />
* Introduction to while loop<br />
* syntax of while loop<br />
* Program using while loop<br />
* Check the output.<br />
* Introduction to infinite loop<br />
* loop variable modification<br />
* Check the output<br />
* How to terminate the infinite loop<br/> <br />
<br />
<br />
18. for loop<br />
<br />
* syntax<br />
* loop continuing condition<br />
* loop variable modification<br/> <br />
<br />
<br />
19. do while loop<br />
<br />
* define do while <br />
* do while syntax<br />
* working of do while loop<br />
* example of do while loop<br />
* explain the do while programming<br />
* save, compile and run the program to check the output <br />
* how different is it from the while loop<br />
* program to demonstrate the differences<br />
<br />
== Arrays ==<br />
20. Introduction to Arrays<br />
<br />
* What are arrays<br />
* Types of arrays<br />
* How to create arrays<br />
<br />
21. Array operations<br />
<br />
* Accessing array items<br />
* Checking for bounds<br />
<br />
== Classes & Objects ==<br />
== 22. Creating class ==<br />
* Whatever we can see in this world are all objects<br />
* Objects can be categorized into groups known as class<br />
* This is class in real world<br />
* Human Being is an example of class in real world<br />
* Class in java is the blue print from which individual objects are created<br />
* Class consists defines a set of properties called variables and a set of behaviors called methods<br />
* Syntax for creating class<br />
* Create a simple class Student using Eclipse<br />
* The Student class can contain properties<br/> <br />
<br />
<br />
23. Creating Object<br />
<br />
* An object is an instance of a class<br />
* Each object consist of state and behavior<br />
* Object stores it state in fields or variables<br />
* It exposes its behavior through methods<br />
* Reference variables<br />
* Create a class named TestStudent<br />
* Create an object of the Student class<br />
* Use new operator<br />
* Check what the reference variable contains<br />
* Create one more object of the Student class and check what the reference variable contains<br />
<br />
24. Instance fields<br />
<br />
* Also known as non-static fields<br />
* Open the TestStudent class which we have created<br />
* Access the fields roll_number and name using dot operator<br />
* See the output<br />
* Initialize the field and see the output<br />
* Change the modifier of the fields to private<br />
* Debug the error that you get<br />
* Change the modifier to protected<br />
* Each object of a class will have unique values<br />
* Create two objects of the Student class <br />
<br />
25. methods<br />
<br />
* method definition <br />
* write simple method<br />
* method returning value<br />
* call a method in another method<br />
* flow of the program<br />
* call a static method<br />
* call a method from another class<br />
* method signature<br />
* method body <br />
<br />
== Constructors ==<br />
26. default constructor<br />
<br />
* what is a constructor?<br />
* what is a default constructor?<br />
* when is it called?<br />
* define a constructor<br />
* initialize the variables<br />
* call the constructor<br />
* difference between constructor and method<br/> <br />
<br />
<br />
27. parameterized constructors<br />
<br />
* What is a parameterized constructor?<br />
* create constructor without parameter<br />
* create a constructor with parameter<br />
* assign values to the variables in the constructor<br />
* pass arguments during the constructor call<br />
* working of parameterized constructor<br />
* show common errors<br />
* resolve the errors<br />
* create another parameterized constructor<br />
* why to use constructor?<br />
<br />
28. using this keyword<br />
<br />
* this is a reference to the current object<br />
* helps to avoid name conflicts<br />
* we can use this keyword inside a constructor to call another one<br />
* the constructors must be in the same class<br />
* explicit constructor invocation<br />
* Explain it using the parameterized constructor code<br />
* Make this statement the last one in the constructor<br />
* You will get an error<br />
* this statement should be the first one inside a constructor<br />
<br />
29. non-static block<br />
<br />
* Non-static block <br />
* Any code written between two curly brackets <br />
* Executed for each object that is created <br />
* Executes before constructor's execution <br />
* can initialize instance member variables of the class <br />
* create a class named NonStaticTest <br />
* Create a non-static block and a constructor inside it <br />
* Check the output <br />
* Include multiple non-static blocks <br />
* they will be executed in the sequence in which they appear in the class <br />
* Check the output <br />
* Non-static block is not a substitute for constructor<br />
<br />
30. constructor overloading<br />
<br />
* define multiple constructor<br />
* what is constructor overloading?<br />
* constructor with different number of parameters.<br />
* parameters with different datatypes.<br />
* how is constructor overloaded?<br />
* flow of overloading process.<br />
* advantage of constructor overloading.<br />
<br />
31. method overloading<br />
<br />
* define multiple methods.<br />
* methods with same name.<br />
* methods with different number of parameters.<br />
* methods with different datatypes of parameter.<br />
* what is method overloading?<br />
* example for overloadin method<br />
* how to overload method?<br />
* advantage of method overloading.<br />
* error in method overloading.<br />
<br />
== Intermediate Level ==<br />
<br />
== Advanced Level ==</div>Pratham920https://script.spoken-tutorial.org/index.php/JavaJava2013-01-14T11:25:44Z<p>Pratham920: /* Basic Level */</p>
<hr />
<div>=Introduction=<br />
'''Welcome to online web tutorials for java'''<br><br />
Java[ http://java.sun.com ]is a free and open source high level programming language. It is simple as well as object oriented language. Till date, the Java platform has attracted more than 6.5 million software developers. Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as today's demanding Embedded and Real-Time environments.From laptops to mobile phones, game consoles to scientific supercomputers, music players to the Internet,Set-top boxes to printers, Web cams to medical devices,Ooops that is a huge list to follow,Java is everywhere!!!!!<br />
<br />
This set of tutorials will cover features and usage of Java version 1.6.x Please see the associated text box of individual spoken tutorials on the website to decide the versions of Java and OS to which it is applicable. <br />
<br />
The Spoken Tutorial Effort for Java is contributed jointly by '''TalentSprint, Hyderabad''' and the '''Spoken Tutorial Team, IIT Bombay'''. Other contributors who helped in the creation of the scripts are ............ <br />
<br />
<blockquote style="background-color: lemonchiffon; border: solid thin grey;"><br />
[[Media:JavaTemplate.zip | Java Slide Template]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
[[Glossary_for_Java | Glossary]]<br />
</blockquote><br />
<br />
__TOC__<br />
<br />
= Java Spoken Tutorials - Outline =<br />
= Introduction to Java =<br />
= 1. Getting started with Java – installation =<br />
* Install jdk from Synaptic Package Manager<br />
* Choose openjdk-6-jdk from the list of packages available <br />
* Mark it for installation<br />
* The installation will take a few seconds<br />
* Verify the installation<br />
* At the command prompt type java -version, so the version number of the jdk will be displayed<br />
* Run a simple java program and see if it works<br />
* Type javac TestProgram.java for compiling the code and java TestProgram for executing the code<br />
<br />
2. Java - First program<br />
<br />
* write simple java program <br />
* print “My First Java Program!” on Console<br />
* save the file<br />
* file name given to the java file<br />
* compile the file<br />
* run the file<br />
* correct the errors<br />
* naming conventions for class<br />
* naming conventions for method<br />
* naming conventions for variable <br />
<br />
= Eclipse =<br />
= 3. Installing Eclipse =<br />
* Install Eclipse on Ubuntu on the Terminal<br />
* Set up the proxy on the Terminal <br />
* Then fetch the list of all the available softwares<br />
* Type sudo apt-get update<br />
* Then install eclipse on the Terminal<br />
* Type sudo apt-get install eclipse<br />
* Verify if Eclipse is installed on the system<br />
* Installing Eclipse on Debian,Kubuntu,Xubuntu<br />
* Installing Eclipse on Redhat <br />
* Installing Eclipse on Fedora,centos and suse linux<br />
<br />
4. Getting started with Eclipse<br />
<br />
* Eclipse is an Integrated Development Environment<br />
* It is a tool on which one can write, debug and run java programs easily<br />
* Open Dash Home and type Eclipse in the search box.<br />
* We get Workspace Launcher<br />
* On clicking on Workbench we get the Eclipse IDE<br />
* Go to File->New->Project and select Java Project<br />
* Create a project named EclipseDemo and create a class inside DemoClass<br />
* Learn about Package Explorer and Editor portlet<br />
* Add the println statement in<br/> <br />
<br />
<br />
5. Hello World Program<br />
<br />
* Open Eclipse<br />
* Create a Java Project named DemoProject<br />
* Create a class named DemoClass<br />
* Class name and file name will be the same<br />
* Eclipse suggests various possibilities as we type a command<br />
* Eclipse also completes the parentheses by automatically adding the closing parentheses<br />
* Include the statement that we want to print<br />
* Eclipse also completes the quotes by adding the closing quote<br />
* Compile and execute the program<br />
* Change the code to print<br/> <br />
<br />
<br />
6. Errors and Debugging<br />
<br />
* When writing a Java Program, here is a list of typical errors:<br />
* Missing semicolon(;)<br />
* Missing double quotes(".")<br />
* Mis-match of filename and classname<br />
* Typing the print statement n lower case<br />
* The line which has the error will be indicated with a red cross mark on the left margin<br />
* The list of errors is displayed by hovering the mouse over the cross mark<br />
* Create a class ErrorFree with Errors, debug the code and run it<br />
* Eclipse also offers intelligent fixes<br/> <br />
<br />
<br />
7. Programming features of Eclipse<br />
<br />
* Auto completion<br />
* Sets the corresponding closing brace when we open the brace<br />
* Provides a drop-down list of methods when you start typing the code.<br />
* syntax highlighting<br />
* classname is highlighted in pink color and method in blue color.<br />
* keyboard shortcuts<br />
* F11 to debug a program and Ctrl plus H to search a specific file.<br />
* error highlighting<br />
* cross symbol in the program denotes errors<br />
* Remove semicolon and error details are displayed when mouse is hovered over cross symbol.<br />
<br />
= The Java Programming language -- Basic Level =<br />
== Fundamental Programming Structures in Java ==<br />
8. Numerical datatypes<br />
<br />
* define datatypes and numerical datatypes<br />
* int<br />
* float<br />
* byte<br />
* short<br />
* long<br />
* double<br />
* range of each numerical datatypes<br />
* declaration and initializationof numerical datatypes.<br />
* valid and invalid declaration<br />
<br />
9. Arithmetic Operations<br />
<br />
* define an operator<br />
* define arithmetic operators<br />
* addition<br />
* subtraction<br />
* multiplication<br />
* division<br />
* modulo<br />
* simple program to demonstrate arithmetic operators<br />
* appropriate datatypes for appropriate values<br />
* save, compile and run the program<br/> <br />
<br />
<br />
10. Strings<br />
<br />
* char datatype<br />
* letter, digit, punctuation marks, '''tab''', or a space are all characters.<br />
* Program explaining the variable and the character data.<br />
* Introduction to strings<br />
* Creating string by Direct Initialization<br />
* Creating string by using new operator<br />
* String length()<br />
* String concat()<br />
* String toUpperCase()<br />
* String toLowerCase()<br/> <br />
<br />
<br />
11. Primitive type conversions<br />
<br />
* define type conversion or type casting<br />
* higher order integer to lower order integer- Explicit type casting<br />
* program to show explicit type casting<br />
* common mistake in explicit type casting.<br />
* program to show common mistake in explicit type casting<br />
<br />
* lower order integer to higher order integer – Implicit type casting<br />
* program to show implicit type casting<br />
* char to integer<br />
* integer to char<br />
* program to show char to int type casting.<br />
<br />
== Control flow ==<br />
12. Relational Operations<br />
<br />
* bool datatype<br />
* equal to and not equal to<br />
* less than and less than or equal to<br />
* greater than and greater than or equal to<br/> <br />
<br />
<br />
13. Logical Operations<br />
<br />
* use of logical operators<br />
* and (&&) operator<br />
* example to explain '''and''' operator<br />
* program to demonstrate '''and''' operator<br />
* or (||) operator<br />
* example to explain '''or '''operator<br />
* program to demonstrate '''or '''operator<br />
* not (!) operator<br />
* program to demonstrate '''or '''operator<br />
* save, compile and run the programs<br/> <br />
<br />
<br />
14. if else construct<br />
<br />
* Conditional Statements and types of Conditional Statements<br />
* Use of if statement<br />
* Syntax for if statement<br />
* Program using if statement<br />
* Use of if else statement<br />
* Syntax for if else statement<br />
* Program using if else statement<br />
* Use of if else if statement<br />
* Syntax for if else if statement<br />
* Program using if else if statement<br/> <br />
<br />
<br />
15. nested if and ternary operator<br />
<br />
* explain nested if<br />
* nested if syntax<br />
* program to demonstrate nested if<br />
* explain the control flow of the program<br />
* explain ternary operator<br />
* syntax for ternary operator<br />
* explain the syntax<br />
* program to demonstrate ternary operator<br />
* comparison between ternary operator and nested if<br />
* save, compile and run the program<br/> <br />
<br />
<br />
16. switch statement<br />
<br />
* define switch case statement<br />
* compare switch and nested if<br />
* switch case syntax<br />
* working of a switch case statement<br />
* use of keyword switch<br />
* valid and invalid use of keyword '''case'''<br />
* use of keyword default<br />
* use of keyword break<br />
* program to demonstrate switch case statement<br />
* save, compile and run the program to check the output<br />
<br />
17. while loop<br />
<br />
* Loop control statement <br />
* types of loop control statements<br />
* Introduction to while loop<br />
* syntax of while loop<br />
* Program using while loop<br />
* Check the output.<br />
* Introduction to infinite loop<br />
* loop variable modification<br />
* Check the output<br />
* How to terminate the infinite loop<br/> <br />
<br />
<br />
18. for loop<br />
<br />
* syntax<br />
* loop continuing condition<br />
* loop variable modification<br/> <br />
<br />
<br />
19. do while loop<br />
<br />
* define do while <br />
* do while syntax<br />
* working of do while loop<br />
* example of do while loop<br />
* explain the do while programming<br />
* save, compile and run the program to check the output <br />
* how different is it from the while loop<br />
* program to demonstrate the differences<br />
<br />
== Arrays ==<br />
20. Introduction to Arrays<br />
<br />
* What are arrays<br />
* Types of arrays<br />
* How to create arrays<br />
<br />
21. Array operations<br />
<br />
* Accessing array items<br />
* Checking for bounds<br />
<br />
== Classes & Objects ==<br />
== 22. Creating class ==<br />
* Whatever we can see in this world are all objects<br />
* Objects can be categorized into groups known as class<br />
* This is class in real world<br />
* Human Being is an example of class in real world<br />
* Class in java is the blue print from which individual objects are created<br />
* Class consists defines a set of properties called variables and a set of behaviors called methods<br />
* Syntax for creating class<br />
* Create a simple class Student using Eclipse<br />
* The Student class can contain properties<br/> <br />
<br />
<br />
23. Creating Object<br />
<br />
* An object is an instance of a class<br />
* Each object consist of state and behavior<br />
* Object stores it state in fields or variables<br />
* It exposes its behavior through methods<br />
* Reference variables<br />
* Create a class named TestStudent<br />
* Create an object of the Student class<br />
* Use new operator<br />
* Check what the reference variable contains<br />
* Create one more object of the Student class and check what the reference variable contains<br />
<br />
24. Instance fields<br />
<br />
* Also known as non-static fields<br />
* Open the TestStudent class which we have created<br />
* Access the fields roll_number and name using dot operator<br />
* See the output<br />
* Initialize the field and see the output<br />
* Change the modifier of the fields to private<br />
* Debug the error that you get<br />
* Change the modifier to protected<br />
* Each object of a class will have unique values<br />
* Create two objects of the Student class <br />
<br />
25. methods<br />
<br />
* method definition <br />
* write simple method<br />
* method returning value<br />
* call a method in another method<br />
* flow of the program<br />
* call a static method<br />
* call a method from another class<br />
* method signature<br />
* method body <br />
<br />
== Constructors ==<br />
# default constructor<br />
<br />
* what is a constructor?<br />
* what is a default constructor?<br />
* when is it called?<br />
* define a constructor<br />
* initialize the variables<br />
* call the constructor<br />
* difference between constructor and method<br/> <br />
<br />
<br />
27. parameterized constructors<br />
<br />
* What is a parameterized constructor?<br />
* create constructor without parameter<br />
* create a constructor with parameter<br />
* assign values to the variables in the constructor<br />
* pass arguments during the constructor call<br />
* working of parameterized constructor<br />
* show common errors<br />
* resolve the errors<br />
* create another parameterized constructor<br />
* why to use constructor?<br />
<br />
28. using this keyword<br />
<br />
* this is a reference to the current object<br />
* helps to avoid name conflicts<br />
* we can use this keyword inside a constructor to call another one<br />
* the constructors must be in the same class<br />
* explicit constructor invocation<br />
* Explain it using the parameterized constructor code<br />
* Make this statement the last one in the constructor<br />
* You will get an error<br />
* this statement should be the first one inside a constructor<br />
<br />
29. non-static block<br />
<br />
* Non-static block <br />
* Any code written between two curly brackets <br />
* Executed for each object that is created <br />
* Executes before constructor's execution <br />
* can initialize instance member variables of the class <br />
* create a class named NonStaticTest <br />
* Create a non-static block and a constructor inside it <br />
* Check the output <br />
* Include multiple non-static blocks <br />
* they will be executed in the sequence in which they appear in the class <br />
* Check the output <br />
* Non-static block is not a substitute for constructor<br />
<br />
30. constructor overloading<br />
<br />
* define multiple constructor<br />
* what is constructor overloading?<br />
* constructor with different number of parameters.<br />
* parameters with different datatypes.<br />
* how is constructor overloaded?<br />
* flow of overloading process.<br />
* advantage of constructor overloading.<br />
<br />
31. method overloading<br />
<br />
* define multiple methods.<br />
* methods with same name.<br />
* methods with different number of parameters.<br />
* methods with different datatypes of parameter.<br />
* what is method overloading?<br />
* example for overloadin method<br />
* how to overload method?<br />
* advantage of method overloading.<br />
* error in method overloading.<br />
<br />
== Intermediate Level ==<br />
<br />
== Advanced Level ==</div>Pratham920https://script.spoken-tutorial.org/index.php/Java/C2/Array-Operations/EnglishJava/C2/Array-Operations/English2012-12-07T11:25:45Z<p>Pratham920: </p>
<hr />
<div>'''Title of script''': Array Operations<br />
<br />
'''Author''': TalentSprint<br />
<br />
'''Keywords:''' array operations, java, sort, fill, copy, video tutorial<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Visual Cue '''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Description'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 1<br />
<br />
'''Welcome'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Welcome to the spoken tutorial on '''Array Operations '''in java.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 2<br />
<br />
'''Learning Outcomes'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| In this tutorial, you will learn how to <br />
<br />
'''import the class Arrays '''and, <br />
<br />
'''perform basic operations on arrays'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 3<br />
<br />
'''Tools Used'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| For this tutorial we are using <br />
<br />
'''Ubuntu 11.10''', <br />
<br />
'''JDK 1.6''' and <br />
<br />
'''Eclipse 3.7.0'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 4<br />
<br />
'''Prerequisites'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| For this tutorial, you should have knowledge on''' arrays in Java.'''<br />
<br />
<br />
If not, for relevant tutorial please visit our website which is as shown [http://spoken-tutorial.org/ http][http://spoken-tutorial.org/ ://][http://spoken-tutorial.org/ spoken][http://spoken-tutorial.org/ -][http://spoken-tutorial.org/ tutorial][http://spoken-tutorial.org/ .][http://spoken-tutorial.org/ org]<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 5<br />
<br />
'''Array Operations'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| The methods for array operations are available in a '''class '''called '''Arrays'''. <br />
<br />
<br />
To access them, we need to import that '''class'''.<br />
<br />
<br />
It is done by the statement '''import java.util.Arrays'''.<br />
<br />
<br />
We can access a '''method '''from the '''class'''.<br />
<br />
<br />
We do it by adding a '''dot''' and the method name.<br />
<br />
<br />
So '''Arrays '''''dot '''''toString''' means '''toString''' method from the class '''Arrays.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Point to the code'''<br />
<br />
<br />
Minimize Slides and open Eclipse<br />
<br />
{Eclipse should contain the following code}<br />
<br />
'''public class ArraysDemo{'''<br />
<br />
'''public static void main(String<nowiki>[] </nowiki>args){'''<br />
<br />
'''}'''<br />
<br />
'''}'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Switch to eclipse.<br />
<br />
<br />
We have already created a '''class''' '''ArraysDemo'''.<br />
<br />
<br />
Let us now import the '''class Arrays'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Before the line '''public class...''', type<br />
<br />
'''import java.util.Arrays<nowiki>;</nowiki>'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| The '''import''' statement is given before the '''class '''definition.<br />
<br />
<br />
Before '''public class''', type<br />
<br />
<br />
import '''java.util.Arrays'''<br />
<br />
<br />
This statement says that '''java''' contains a '''package '''called '''util''' which contains the class '''Arrays''' and it has to be imported.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Inside the main function, type<br />
<br />
'''int marks<nowiki>[] = {2, 7, 5, 4, 8};</nowiki>'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Now let us add an '''array.'''<br />
<br />
<br />
Inside the '''main '''function,type<br />
<br />
<br />
'''int marks '''''open close square brackets''''' '''''equal to within brackets '''''2, 7, 5, 4, 8 '''''semicolon.''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| In next line, type<br />
<br />
'''String mStr = Arrays.toString(marks);'''<br />
<br />
<br />
'''System.out.println(mStr);'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Now we shall use a method available in the '''Arrays''' '''class''' to get a string representation of the array and print it.<br />
<br />
<br />
Type '''String mStr '''''equal to''''' Arrays '''''dot '''''toString '''''within brackets '''''marks '''''semicolon.''<br />
<br />
<br />
The '''toString''' method gives a string representation of the array.<br />
<br />
<br />
Now, we shall print the marks.<br />
<br />
<br />
So, type '''System '''''dot '''''out '''''dot '''''println '''''within brackets''''' mStr '''''semicolon.''<br />
<br />
<br />
Now let us run it.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| As we can see, the '''toString''' method has given a string representation of the '''array.'''<br />
<br />
<br />
Now let us look at sorting the elements of the '''array'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Before the line '''Arrays.toString''', type<br />
<br />
'''Arrays.sort(marks);'''<br />
<br />
<br />
'''Highlight sort.'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| So before the line '''Arrays '''''dot '''''toString '''''within brackets '''''marks '''type '''Arrays '''''dot '''''sort(marks);'''<br />
<br />
<br />
The '''sort '''method in the '''Arrays class''', sorts the elements of the array passed to it.<br />
<br />
<br />
Now we are sorting the array and then printing the string form of it.<br />
<br />
<br />
Let us look at the output.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| As we can see, the '''sort''' method has sorted the array.<br />
<br />
<br />
Note that the '''sort''' method has changed the array itself.<br />
<br />
<br />
This type of sorting is called''' inplace sorting'''. <br />
<br />
<br />
It means the array which contains the elements is changed as a result of sorting.<br />
<br />
<br />
The next method we are going to look at, is '''fill'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Remove the line '''Arrays.sort''' and type<br />
<br />
'''Arrays.fill(marks, 6);'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| The fill method takes two arguments. <br />
<br />
The first is the array to fill and the second is what should it be filled with.<br />
<br />
<br />
Remove the sorting line and<br />
<br />
<br />
Type '''Arrays '''''dot '''''fill '''''within brackets''''' marks, 6.'''<br />
<br />
<br />
Now let us look at the output.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| As we can see, as the name goes, the fill method fills the array with the given argument.<br />
<br />
<br />
The next method we are going to look at, is '''copyOf'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Remove the '''Arrays.fill..''' line and type<br />
<br />
'''int marksCopy<nowiki>[];</nowiki>'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We are going to copy all the elements of the array '''marks''' into the array '''marksCopy'''<br />
<br />
<br />
Type '''int marksCopy<nowiki>[];</nowiki>'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| In the next line, type<br />
<br />
<br />
'''marksCopy = copyOf(marks, 5);'''<br />
<br />
<br />
Change '''toString(marks)''' to '''toString(marksCopy)'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Type '''marksCopy = copyOf(marks, 5);'''<br />
<br />
<br />
The '''copyOf''' method takes two arguments. <br />
<br />
<br />
The first argument is the array to copy from.<br />
<br />
And the second is the no.of elements to copy.<br />
<br />
<br />
Now let us look at the contents of the new array.<br />
<br />
<br />
<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and Run the program<br />
<br />
We see that the elements of the array '''marks''' have been copied to the array '''marksCopy'''.<br />
<br />
<br />
<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''copyOf(marks, 5)''' to '''copyOf(marks, 3)'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Let us see what happens if we change the no.of elements to be copied.<br />
<br />
<br />
'''Change 5''' to '''3'''<br />
<br />
<br />
Let us now look at the new array.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and Run the program<br />
<br />
As we can see, only the first three elements have been copied.<br />
<br />
<br />
Let us see what happens if the no.of elements to be copied is greater than the total no.of elements in the array.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''copyOf(marks, 3)''' to '''copyOf(marks, 8)'''<br />
<br />
<br />
save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''3''' to '''8'''<br />
<br />
<br />
Save and Run the program<br />
<br />
<br />
As we can see, the extra elements have been set to the default value, which is 0.<br />
<br />
<br />
Next we'll see how to copy a range of values.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''copyOf(marks, 8)''' to '''copyOfRange(marks, 1, 4)'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''copyOf '''to''' copyOfRange '''and''' 8''' to '''1, 4'''<br />
<br />
<br />
'''copyOfRange(marks, 1, 4)''' copies all the elements starting from index 1 and stopping at index 3.<br />
<br />
<br />
Now let us look at the output.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Point to output.<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and Run the program<br />
<br />
<br />
As we can see, the elements from index 1 to index 3 have been copied.<br />
<br />
<br />
Note that we have given 1, 4 in the method.<br />
<br />
<br />
But even, then the element at index 4 has not been copied.<br />
<br />
<br />
Only the elements till index 3 have been copied.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.176cm;"| <br />
| style="border:1pt solid #000000;padding:0.176cm;"| This behaviour ensures that continuity of ranges is maintained.<br />
<br />
<br />
(0, 4) implies from index 0 to index 3<br />
<br />
(4, 6) implies from index 4 to index 6<br />
<br />
<br />
So it behaves as if (0, 4) + (4, 6) = (0, 6)<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Minimize the '''Eclipse''' window and switch to slides.<br />
<br />
<br />
Slide 6<br />
<br />
'''Summary'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We have come to the end of this tutorial. <br />
<br />
In this tutorial we have learnt<br />
<br />
how to '''import the class Arrays'''.<br />
<br />
Perform array operations like '''sort and copy'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 7'''Assignment'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| The assignment for this tutorial is,<br />
<br />
<br />
Read about the Arrays.equals method and find out what is does.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 8'''About the Spoken Tutorial Project'''<br />
<br />
* Watch the video available at[http://spoken-tutorial.org/What_is_a_Spoken_Tutorial ][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial http][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial ://][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial -][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial tutorial][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial .][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial org][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial /][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial What][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial is][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial a][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial Spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial Tutorial]<br />
<br />
* It summarises the Spoken Tutorial project<br />
<br />
* If you do not have good bandwidth, you can download and watch it<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| To know more about the '''Spoken Tutorial''' project, watch the video available at the following link, that summarises the project.<br />
<br />
If you do not have good bandwidth, you can download and watch it.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 9'''Spoken Tutorial Workshops'''The Spoken Tutorial Project Team<br />
<br />
* Conducts workshops using spoken tutorials<br />
<br />
* Gives certificates for those who pass an online test<br />
<br />
* For more details, please write to [mailto:contact@spoken-tutorial.org contact][mailto:contact@spoken-tutorial.org @][mailto:contact@spoken-tutorial.org spoken][mailto:contact@spoken-tutorial.org -][mailto:contact@spoken-tutorial.org tutorial][mailto:contact@spoken-tutorial.org .][mailto:contact@spoken-tutorial.org org]<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| The Spoken Tutorial Project Team. Conducts workshops using '''spoken tutorials''' and gives certificates for those who pass an online test. For more details, please write to '''contact AT spoken HYPHEN tutorial DOT org.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 10'''Acknowledgement'''<br />
<br />
* Spoken Tutorial Project is a part of the Talk to a Teacher project<br />
<br />
* It is supported by the National Mission on Education through ICT, MHRD, Government of India<br />
<br />
* More information on this Mission is available at<br />
<br />
* [http://spoken-tutorial.org/NMEICT-Intro http][http://spoken-tutorial.org/NMEICT-Intro ://][http://spoken-tutorial.org/NMEICT-Intro spoken][http://spoken-tutorial.org/NMEICT-Intro -][http://spoken-tutorial.org/NMEICT-Intro tutorial][http://spoken-tutorial.org/NMEICT-Intro .][http://spoken-tutorial.org/NMEICT-Intro org][http://spoken-tutorial.org/NMEICT-Intro /][http://spoken-tutorial.org/NMEICT-Intro NMEICT][http://spoken-tutorial.org/NMEICT-Intro -][http://spoken-tutorial.org/NMEICT-Intro Intro]<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Spoken Tutorial '''Project is a part of the '''Talk to a Teacher''' project and is supported by the '''National Mission on Education through ICT, MHRD, Government of India. '''More information on this Mission is available at '''spoken HYPHEN tutorial DOT org SLASH NMEICT HYPHEN Intro'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 11'''About the contributor'''<br />
<br />
* This tutorial has been contributed by '''TalentSprint'''<br />
* '''www.talentsprint.com'''<br />
<br />
* Thanks for joining<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| This tutorial has been contributed by '''TalentSprint'''. Thanks for joining.<br />
<br />
<br />
<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Java/C2/Introduction-to-Array/EnglishJava/C2/Introduction-to-Array/English2012-12-07T11:20:27Z<p>Pratham920: Created page with ''''Title of script''': Introduction to Arrays '''Author''': TalentSprint '''Keywords:''' arrays, java, video tutorial {| style="border-spacing:0;" | style="border:1pt solid …'</p>
<hr />
<div>'''Title of script''': Introduction to Arrays<br />
<br />
'''Author''': TalentSprint<br />
<br />
'''Keywords:''' arrays, java, video tutorial<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Visual Cue '''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Description'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 1<br />
<br />
'''Welcome'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Welcome to the spoken tutorial on '''Introduction to Arrays'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 2<br />
<br />
'''Learning Outcomes'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| In this tutorial, you will learn how<br />
<br />
* to '''create arrays''' and<br />
* access elements in '''arrays'''.<br />
<br />
<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 3<br />
<br />
'''Tools Used'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| For this tutorial we are using<br />
<br />
* '''Ubuntu 11.10'''<br />
* '''JDK 1.6''' and <br />
* '''Eclipse 3.7.0'''<br />
<br />
<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 4<br />
<br />
'''Prerequisites'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| For this tutorial, you should have knowledge of '''data types in Java'''<br />
<br />
<br />
If not, for relevant tutorial please visit our website which as shown.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 5 and 6<br />
<br />
'''Arrays'''<br />
<br />
<br />
Highlight index column as you explain.<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Arrays are a collection of data. <br />
<br />
<br />
For example, a list of marks, a list of names, a list of temperatures or as shown on the slide, a list of numbers.<br />
<br />
<br />
Each item has an index based on its position. <br />
<br />
<br />
The index of the first element is 0.<br />
<br />
<br />
The second element has index 1 and so on.<br />
<br />
<br />
Let us now see how to store this data.<br />
<br />
<br />
So switch to '''Eclipse.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Minimize Slides and open Eclipse<br />
<br />
Eclipse should contain the following code<br />
<br />
'''public class ArraysDemo{'''<br />
<br />
'''public static void main(String<nowiki>[] </nowiki>args){'''<br />
<br />
'''}'''<br />
<br />
'''}'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| A '''class''' named '''ArraysDemo '''has already been created.<br />
<br />
<br />
Within the main method, let us add the rainfall data.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Inside main function, type<br />
<br />
'''int rainfall<nowiki>[] = {25, 31, 29, 13, 27, 35, 12};</nowiki>'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Inside main function, type<br />
<br />
<br />
'''int rainfall '''''open close square brackets equal to''''' '''''within curly brackets''''' 25, 31, 29, 13, 27, 35, 12 '''''semicolon.''<br />
<br />
<br />
Note the square braces after the '''variable '''name''' rainfall'''. <br />
<br />
<br />
This declares '''rainfall''' as an '''array''' of '''integers'''.<br />
<br />
<br />
The braces are used to specify the elements of the array.<br />
<br />
<br />
Now let us access data.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| In the next line, type<br />
<br />
'''System.out.println(rainfall<nowiki>[2]);</nowiki>'''<br />
<br />
<br />
Highlight as you explain.<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Next line, type <br />
<br />
<br />
'''System '''''dot '''''out '''''dot'' '''println '''within brackets''' rainfall '''then within square brackets 2 semicolon.<br />
<br />
<br />
We are printing the element with index 2.<br />
<br />
<br />
In other words, the third element in the array.<br />
<br />
<br />
Let us now run the code.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. <br />
<br />
<br />
Highlight the ouput<br />
| style="border:1pt solid #000000;padding:0.097cm;"| As we can see, the output is the third value, '''29'''. <br />
<br />
<br />
Now let us try a different index.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''rainfall<nowiki>[2]</nowiki>''' to '''rainfall<nowiki>[0]</nowiki>'''<br />
<br />
<br />
save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''2''' to '''0'''<br />
<br />
<br />
As we can see, the output is the first value.<br />
<br />
<br />
Now let us modify a value.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Before the '''Syste...''' line, type<br />
<br />
'''rainfall<nowiki>[0] = 11;</nowiki>'''<br />
<br />
<br />
save and run. Point to output<br />
<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We shall change the value of the first item.<br />
<br />
<br />
Type '''rainfall<nowiki>[0] = 11;</nowiki>'''<br />
<br />
<br />
Now let us see its value.<br />
<br />
<br />
As we can see, the value has been changed to 11.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| <br />
| style="border:1pt solid #000000;padding:0.097cm;"| Now what if we only know the size of the array and do not know the values.<br />
<br />
<br />
Let us see how to create such array.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Remove everything in main function and type<br />
<br />
'''int squares<nowiki>[] = </nowiki>new int<nowiki>[10];</nowiki>'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Type int squares '''''equal to '''''new int''''' in square brackets''''' 10'''<br />
<br />
<br />
This statement creates an array of 10 inetgers called '''squares.'''<br />
<br />
<br />
Now let us add some values.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| In the next line, type<br />
<br />
'''squares<nowiki>[0] = 1;</nowiki>'''<br />
<br />
'''squares<nowiki>[1] = 4;</nowiki>'''<br />
<br />
'''squares<nowiki>[2] = 9;</nowiki>'''<br />
<br />
'''squares<nowiki>[3] = 16;</nowiki>'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Type'''<br />
<br />
<br />
'''squares<nowiki>[0] = 1;</nowiki>'''<br />
<br />
'''squares<nowiki>[1] = 4;</nowiki>'''<br />
<br />
'''squares<nowiki>[2] = 9;</nowiki>'''<br />
<br />
'''squares<nowiki>[3] = 16;</nowiki>'''<br />
<br />
<br />
We have entered the squares of first four numbers. Now what about the other elements of the array. Let us see what they contain.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| In the next line, type<br />
<br />
'''System.out.println(squares<nowiki>[5]);</nowiki>'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We shall print the sixth value in the array.<br />
<br />
<br />
Type '''System.out.println(squares<nowiki>[5]);</nowiki>'''<br />
<br />
<br />
<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We see that the value is zero. This is because when we create an array of integers, all the values are initialized to 0. Similarly an array of floats will have all its values initialized to 0.0.<br />
<br />
<br />
It would be a long process if we have to type each value into the array. Instead, let us use a for loop.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| After the '''squares<nowiki>[3]</nowiki>''' line, type<br />
<br />
'''int n, x<nowiki>;</nowiki>'''<br />
<br />
'''for(x = 4, x<nowiki> < 10, </nowiki>x = x + 1){'''<br />
<br />
'''n = x + 1;'''<br />
<br />
'''squares<nowiki>[</nowiki>x] = n * n'''<br />
<br />
'''}'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Type'''<br />
<br />
<br />
'''int n, x<nowiki>;</nowiki>'''<br />
<br />
'''for(x = 4, x<nowiki> < 10, </nowiki>x = x + 1){'''<br />
<br />
'''n = x + 1;'''<br />
<br />
'''squares<nowiki>[</nowiki>x] = n * n'''<br />
<br />
'''} '''<br />
<br />
<br />
We iterate over numbers from 4 to 9 and set the corresponding element in the array.<br />
<br />
<br />
Now let us see the output.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| As we can see, the sixth element now is the square of 6, which is 36.<br />
<br />
<br />
In fact now we can set all the values inside the for loop.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Remove all the lines from<br />
<br />
'''squares<nowiki>[0]... </nowiki>'''to '''squares<nowiki>[3]...</nowiki>'''<br />
<br />
<br />
Change '''x = 4''' to '''x = 0'''<br />
<br />
<br />
Change '''println(squares<nowiki>[5])</nowiki>''' to<br />
<br />
'''println(squares<nowiki>[2])</nowiki>'''<br />
<br />
<br />
save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Remove the lines that set the values manually and change '''4''' to '''0'''<br />
<br />
<br />
This way all the elements from index 0 to index 9 are set to the corresponding squares.<br />
<br />
<br />
We shall now see the value of the third element.<br />
<br />
<br />
change '''5 '''to '''2'''<br />
<br />
<br />
Save and run<br />
<br />
<br />
As we can see, the value of third element has been set in the loop and it is 9.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.176cm;"| <br />
| style="border:1pt solid #000000;padding:0.176cm;"| This way, arrays can be created and used.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Minimize the '''Eclipse''' window and switch to slides.<br />
<br />
<br />
Slide 7<br />
<br />
'''Summary'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We have come to the end of this tutorial. <br />
<br />
In this tutorial we have learnt how to '''use for loop in java.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 8'''Assignment'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| The assignment for this tutorial is,<br />
<br />
<br />
Given an array of integers, find the sum of all the elements in the array.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 9'''About the Spoken Tutorial Project'''<br />
<br />
* Watch the video available at[http://spoken-tutorial.org/What_is_a_Spoken_Tutorial ][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial http][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial ://][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial -][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial tutorial][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial .][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial org][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial /][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial What][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial is][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial a][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial Spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial Tutorial]<br />
<br />
* It summarises the Spoken Tutorial project<br />
<br />
* If you do not have good bandwidth, you can download and watch it<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| To know more about the '''Spoken Tutorial''' project, watch the video available at the following link. It summarises the project.If you do not have good bandwidth, you can download and watch it.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 10'''Spoken Tutorial Workshops'''The Spoken Tutorial Project Team<br />
<br />
* Conducts workshops using spoken tutorials<br />
<br />
* Gives certificates for those who pass an online test<br />
<br />
* For more details, please write to [mailto:contact@spoken-tutorial.org contact][mailto:contact@spoken-tutorial.org @][mailto:contact@spoken-tutorial.org spoken][mailto:contact@spoken-tutorial.org -][mailto:contact@spoken-tutorial.org tutorial][mailto:contact@spoken-tutorial.org .][mailto:contact@spoken-tutorial.org org]<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| The Spoken Tutorial Project Team. Conducts workshops using '''spoken tutorials''' and gives certificates for those who pass an online test. For more details, please write to '''contact AT spoken HYPHEN tutorial DOT org.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 11'''Acknowledgement'''<br />
<br />
* Spoken Tutorial Project is a part of the Talk to a Teacher project<br />
<br />
* It is supported by the National Mission on Education through ICT, MHRD, Government of India<br />
<br />
* More information on this Mission is available at<br />
<br />
* [http://spoken-tutorial.org/NMEICT-Intro http][http://spoken-tutorial.org/NMEICT-Intro ://][http://spoken-tutorial.org/NMEICT-Intro spoken][http://spoken-tutorial.org/NMEICT-Intro -][http://spoken-tutorial.org/NMEICT-Intro tutorial][http://spoken-tutorial.org/NMEICT-Intro .][http://spoken-tutorial.org/NMEICT-Intro org][http://spoken-tutorial.org/NMEICT-Intro /][http://spoken-tutorial.org/NMEICT-Intro NMEICT][http://spoken-tutorial.org/NMEICT-Intro -][http://spoken-tutorial.org/NMEICT-Intro Intro]<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Spoken Tutorial '''Project is a part of the '''Talk to a Teacher''' project and is supported by the '''National Mission on Education through ICT, MHRD, Government of India. '''More information on this Mission is available at '''spoken HYPHEN tutorial DOT org SLASH NMEICT HYPHEN Intro'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 12'''About the contributor'''<br />
<br />
* This script has been contributed by '''TalentSprint'''<br />
* '''www.talentsprint.com'''<br />
<br />
* Thanks for joining<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| This script has been contributed by '''TalentSprint'''. <br />
<br />
This is Prathamesh Salunke signing off. Thanks for joining.<br />
<br />
<br />
<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Java/C2/For-Loop/EnglishJava/C2/For-Loop/English2012-12-07T11:14:30Z<p>Pratham920: Created page with ''''Title of script''': for loop in Java '''Author''': TalentSprint '''Keywords:''' conditions, loops, for loop, video tutorial {| style="border-spacing:0;" | style="border:1…'</p>
<hr />
<div>'''Title of script''': for loop in Java<br />
<br />
'''Author''': TalentSprint<br />
<br />
'''Keywords:''' conditions, loops, for loop, video tutorial<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Visual Cue '''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Description'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 1<br />
<br />
'''Welcome'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Welcome to the spoken tutorial on '''for loop'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 2<br />
<br />
'''Learning Outcomes'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| In this tutorial, you will learn how to use the '''for loop in Java.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 3<br />
<br />
'''Tools Used'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| For this tutorial we are using <br />
<br />
* '''Ubuntu 11.10''', <br />
* '''JDK 1.6''' and <br />
* '''Eclipse 3.7.0'''<br />
<br />
<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 4<br />
<br />
'''Prerequisites'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| For this tutorial, you should have knowledge on '''relational operators in Java.'''<br />
<br />
<br />
If not, please go through the tutorials on these topics available at our website [http://spoken-tuitorial.org/ http][http://spoken-tuitorial.org/ ://][http://spoken-tuitorial.org/ spoken][http://spoken-tuitorial.org/ -][http://spoken-tuitorial.org/ tutorial][http://spoken-tuitorial.org/ .][http://spoken-tuitorial.org/ org][http://spoken-tuitorial.org/ .]<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 5<br />
<br />
'''Syntax'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Here is the syntax of the '''for loop'''.<br />
<br />
<br />
Now, let us try out an example in '''Eclipse.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Minimize Slides and open Eclipse<br />
<br />
Eclipse should contain the following code<br />
<br />
'''public class ForLoopDemo{'''<br />
<br />
'''public static void main(String<nowiki>[] </nowiki>args){'''<br />
<br />
'''}'''<br />
<br />
'''}'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We have the skeleton required.<br />
<br />
<br />
We have a '''class''' named '''ForLoopDemo'''.<br />
<br />
<br />
Let us add the '''for loop''' inside the '''main method'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Inside the main function, type<br />
<br />
'''int i<nowiki>;</nowiki>'''<br />
<br />
'''for (i = 0; i<nowiki> < 10; </nowiki>i = i + 1)'''<br />
<br />
<br />
Highlight''' '''when you explain.<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Inside the main function, type '''int i '''''semicolon''.<br />
<br />
<br />
Then type '''for '''''within brackets'' '''i '''''equal to''''' 0 '''''semicolon'' '''i '''''less than '''''10''' ''semicolon''''' i '''''equal to'' '''i '''''plus '''''1'''.<br />
<br />
<br />
This statement decides how the loop is going to progress.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Highlight i = 0<br />
| style="border:1pt solid #000000;padding:0.097cm;"| This is the starting condition for the loop.<br />
<br />
<br />
This condition allows the variable to be initialized.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.176cm;"| Highlight i<nowiki> < 10</nowiki><br />
| style="border:1pt solid #000000;padding:0.176cm;"| This is the loop running condition.<br />
<br />
<br />
If the condition is true then the for block will be executed. <br />
<br />
<br />
Else it will be ignored.<br />
<br />
<br />
That means when i becomes more than or equal to 10, the block is not executed.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.176cm;"| Highlight i = i + 1<br />
| style="border:1pt solid #000000;padding:0.176cm;"| This states how the loop variable is going to change.<br />
<br />
<br />
Here, the value of i starts with 1.<br />
<br />
<br />
It keeps increasing by 1 for every iteration of the loop until it becomes 10.<br />
<br />
<br />
Now let us do something with i.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change for (i = 0; i<nowiki> < 10; </nowiki>i = i + 1) to for (i = 0; i<nowiki> < 10; </nowiki>i = i + 1) {<br />
<br />
System.out.println( i * i );<br />
<br />
}<br />
<br />
<br />
Highlight the println statement and explain.<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Now, open curly brackets.<br />
<br />
<br />
Next line type '''System''' ''dot''''' out '''''dot '''''println''' within brackets '''i''' ''into'' '''i'''.<br />
<br />
<br />
This will print the square of each number from 1 to 10.<br />
<br />
<br />
Let us see the output.<br />
<br />
<br />
So '''save''' and '''run''' the file.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| As we can see, the loop ran over numbers from 1 to 10.<br />
<br />
<br />
The square of the number has been printed in each iteration.<br />
<br />
<br />
Now let us print all the 2 digit numbers that are multiples of 3 or 5.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''i = 0''' to '''i = 10'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| So, '''i '''should have values from 10 to 99.<br />
<br />
<br />
So change''' i''' ''equal to'' '''0''' to '''i '''''equal to '''''10'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''i<nowiki> < 10</nowiki>''' to '''i<nowiki> < 100</nowiki>'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''i '''''less than'' '''10''' to '''i '''''less than'' '''100'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''System.out.println( i * i )''' to <br />
<br />
'''if ((i % 3 == 0) || (i % 5 == 0)){'''<br />
<br />
'''System.out.println(i);'''<br />
<br />
'''}'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Delete '''System''' ''dot'' '''out''' ''dot'' '''println '''within brackets '''i''' ''into'' '''i'''.<br />
<br />
<br />
We print the number only if it is a multiple of 3 or 5.<br />
<br />
<br />
So type,<br />
<br />
'''if '''within brackets '''i''' ''mod'' '''3''' ''double equal to'' '''0 '''or''' i '''''mod'' '''5 '''''double equal to '''''0'''.<br />
<br />
<br />
This statement checks whether '''i '''is divisible by '''3 '''or by '''5'''.<br />
<br />
<br />
Then, next line type '''System''' ''dot'' '''out '''''dot'' '''println''' within brackets '''i'''.<br />
<br />
<br />
Now, let us see the output.<br />
<br />
<br />
<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Highlight the output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We can see that the numbers are either multiples of 3 or of 5.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Minimize the '''Eclipse''' window and switch to slides.<br />
<br />
<br />
Slide 6<br />
<br />
'''Summary'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We have come to the end of this tutorial. <br />
<br />
In this tutorial we have learnt how to '''use for loop in java.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 7'''Assignment'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| A three digit number is called Armstrong Number if it is equal to the sum of cubes of its digits.<br />
<br />
<br />
For example, 153 is equal to 1 cube plus 5 cube plus 3 cube.<br />
<br />
<br />
Find all such 3 digit numbers.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 8'''About the Spoken Tutorial Project'''<br />
<br />
* Watch the video available at[http://spoken-tutorial.org/What_is_a_Spoken_Tutorial ][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial http][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial ://][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial -][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial tutorial][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial .][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial org][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial /][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial What][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial is][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial a][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial Spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial Tutorial]<br />
<br />
* It summarises the Spoken Tutorial project<br />
<br />
* If you do not have good bandwidth, you can download and watch it<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| To know more about the '''Spoken Tutorial''' project, watch the video available at the following link, that summarises the project.Alternatively, you can download and watch it.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 9'''Spoken Tutorial Workshops'''The Spoken Tutorial Project Team<br />
<br />
* Conducts workshops using spoken tutorials<br />
<br />
* Gives certificates for those who pass an online test<br />
<br />
* For more details, please write to [mailto:contact@spoken-tutorial.org contact][mailto:contact@spoken-tutorial.org @][mailto:contact@spoken-tutorial.org spoken][mailto:contact@spoken-tutorial.org -][mailto:contact@spoken-tutorial.org tutorial][mailto:contact@spoken-tutorial.org .][mailto:contact@spoken-tutorial.org org]<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| The Spoken Tutorial Project Team. Conducts workshops using '''spoken tutorials''' and gives certificates for those who pass an online test. For more details, please write to '''contact AT spoken HYPHEN tutorial DOT org.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 10'''Acknowledgement'''<br />
<br />
* Spoken Tutorial Project is a part of the Talk to a Teacher project<br />
<br />
* It is supported by the National Mission on Education through ICT, MHRD, Government of India<br />
<br />
* More information on this Mission is available at<br />
<br />
* [http://spoken-tutorial.org/NMEICT-Intro http][http://spoken-tutorial.org/NMEICT-Intro ://][http://spoken-tutorial.org/NMEICT-Intro spoken][http://spoken-tutorial.org/NMEICT-Intro -][http://spoken-tutorial.org/NMEICT-Intro tutorial][http://spoken-tutorial.org/NMEICT-Intro .][http://spoken-tutorial.org/NMEICT-Intro org][http://spoken-tutorial.org/NMEICT-Intro /][http://spoken-tutorial.org/NMEICT-Intro NMEICT][http://spoken-tutorial.org/NMEICT-Intro -][http://spoken-tutorial.org/NMEICT-Intro Intro]<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Spoken Tutorial '''Project is a part of the '''Talk to a Teacher''' project and is supported by the '''National Mission on Education through ICT, MHRD, Government of India. '''More information on this Mission is available at '''spoken HYPHEN tutorial DOT org SLASH NMEICT HYPHEN Intro'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 11'''About the contributor'''<br />
<br />
* This script has been contributed by '''TalentSprint'''<br />
* '''www.talentsprint.com'''<br />
<br />
* Thanks for joining<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| This script has been contributed by '''TalentSprint'''. <br />
<br />
This is Prathamesh Salunke signing off.<br />
<br />
Thanks for joining.<br />
<br />
<br />
<br />
<br />
|}</div>Pratham920https://script.spoken-tutorial.org/index.php/Java/C2/Array-Operations/EnglishJava/C2/Array-Operations/English2012-12-07T11:10:12Z<p>Pratham920: Created page with ''''Title of script''': for loop in Java '''Author''': TalentSprint '''Keywords:''' conditions, loops, for loop, video tutorial {| style="border-spacing:0;" | style="border:1…'</p>
<hr />
<div>'''Title of script''': for loop in Java<br />
<br />
'''Author''': TalentSprint<br />
<br />
'''Keywords:''' conditions, loops, for loop, video tutorial<br />
<br />
<br />
<br />
{| style="border-spacing:0;"<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Visual Cue '''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Description'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 1<br />
<br />
'''Welcome'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Welcome to the spoken tutorial on '''for loop'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 2<br />
<br />
'''Learning Outcomes'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| In this tutorial, you will learn how to use the '''for loop in Java.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 3<br />
<br />
'''Tools Used'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| For this tutorial we are using <br />
<br />
* '''Ubuntu 11.10''', <br />
* '''JDK 1.6''' and <br />
* '''Eclipse 3.7.0'''<br />
<br />
<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 4<br />
<br />
'''Prerequisites'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| For this tutorial, you should have knowledge on '''relational operators in Java.'''<br />
<br />
<br />
If not, please go through the tutorials on these topics available at our website [http://spoken-tuitorial.org/ http][http://spoken-tuitorial.org/ ://][http://spoken-tuitorial.org/ spoken][http://spoken-tuitorial.org/ -][http://spoken-tuitorial.org/ tutorial][http://spoken-tuitorial.org/ .][http://spoken-tuitorial.org/ org][http://spoken-tuitorial.org/ .]<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 5<br />
<br />
'''Syntax'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Here is the syntax of the '''for loop'''.<br />
<br />
<br />
Now, let us try out an example in '''Eclipse.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Minimize Slides and open Eclipse<br />
<br />
Eclipse should contain the following code<br />
<br />
'''public class ForLoopDemo{'''<br />
<br />
'''public static void main(String<nowiki>[] </nowiki>args){'''<br />
<br />
'''}'''<br />
<br />
'''}'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We have the skeleton required.<br />
<br />
<br />
We have a '''class''' named '''ForLoopDemo'''.<br />
<br />
<br />
Let us add the '''for loop''' inside the '''main method'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Inside the main function, type<br />
<br />
'''int i<nowiki>;</nowiki>'''<br />
<br />
'''for (i = 0; i<nowiki> < 10; </nowiki>i = i + 1)'''<br />
<br />
<br />
Highlight''' '''when you explain.<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Inside the main function, type '''int i '''''semicolon''.<br />
<br />
<br />
Then type '''for '''''within brackets'' '''i '''''equal to''''' 0 '''''semicolon'' '''i '''''less than '''''10''' ''semicolon''''' i '''''equal to'' '''i '''''plus '''''1'''.<br />
<br />
<br />
This statement decides how the loop is going to progress.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Highlight i = 0<br />
| style="border:1pt solid #000000;padding:0.097cm;"| This is the starting condition for the loop.<br />
<br />
<br />
This condition allows the variable to be initialized.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.176cm;"| Highlight i<nowiki> < 10</nowiki><br />
| style="border:1pt solid #000000;padding:0.176cm;"| This is the loop running condition.<br />
<br />
<br />
If the condition is true then the for block will be executed. <br />
<br />
<br />
Else it will be ignored.<br />
<br />
<br />
That means when i becomes more than or equal to 10, the block is not executed.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.176cm;"| Highlight i = i + 1<br />
| style="border:1pt solid #000000;padding:0.176cm;"| This states how the loop variable is going to change.<br />
<br />
<br />
Here, the value of i starts with 1.<br />
<br />
<br />
It keeps increasing by 1 for every iteration of the loop until it becomes 10.<br />
<br />
<br />
Now let us do something with i.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change for (i = 0; i<nowiki> < 10; </nowiki>i = i + 1) to for (i = 0; i<nowiki> < 10; </nowiki>i = i + 1) {<br />
<br />
System.out.println( i * i );<br />
<br />
}<br />
<br />
<br />
Highlight the println statement and explain.<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Now, open curly brackets.<br />
<br />
<br />
Next line type '''System''' ''dot''''' out '''''dot '''''println''' within brackets '''i''' ''into'' '''i'''.<br />
<br />
<br />
This will print the square of each number from 1 to 10.<br />
<br />
<br />
Let us see the output.<br />
<br />
<br />
So '''save''' and '''run''' the file.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Point to output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| As we can see, the loop ran over numbers from 1 to 10.<br />
<br />
<br />
The square of the number has been printed in each iteration.<br />
<br />
<br />
Now let us print all the 2 digit numbers that are multiples of 3 or 5.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''i = 0''' to '''i = 10'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| So, '''i '''should have values from 10 to 99.<br />
<br />
<br />
So change''' i''' ''equal to'' '''0''' to '''i '''''equal to '''''10'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''i<nowiki> < 10</nowiki>''' to '''i<nowiki> < 100</nowiki>'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''i '''''less than'' '''10''' to '''i '''''less than'' '''100'''.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Change '''System.out.println( i * i )''' to <br />
<br />
'''if ((i % 3 == 0) || (i % 5 == 0)){'''<br />
<br />
'''System.out.println(i);'''<br />
<br />
'''}'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Delete '''System''' ''dot'' '''out''' ''dot'' '''println '''within brackets '''i''' ''into'' '''i'''.<br />
<br />
<br />
We print the number only if it is a multiple of 3 or 5.<br />
<br />
<br />
So type,<br />
<br />
'''if '''within brackets '''i''' ''mod'' '''3''' ''double equal to'' '''0 '''or''' i '''''mod'' '''5 '''''double equal to '''''0'''.<br />
<br />
<br />
This statement checks whether '''i '''is divisible by '''3 '''or by '''5'''.<br />
<br />
<br />
Then, next line type '''System''' ''dot'' '''out '''''dot'' '''println''' within brackets '''i'''.<br />
<br />
<br />
Now, let us see the output.<br />
<br />
<br />
<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Save and run. Highlight the output<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We can see that the numbers are either multiples of 3 or of 5.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Minimize the '''Eclipse''' window and switch to slides.<br />
<br />
<br />
Slide 6<br />
<br />
'''Summary'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| We have come to the end of this tutorial. <br />
<br />
In this tutorial we have learnt how to '''use for loop in java.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 7'''Assignment'''<br />
| style="border:1pt solid #000000;padding:0.097cm;"| A three digit number is called Armstrong Number if it is equal to the sum of cubes of its digits.<br />
<br />
<br />
For example, 153 is equal to 1 cube plus 5 cube plus 3 cube.<br />
<br />
<br />
Find all such 3 digit numbers.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 8'''About the Spoken Tutorial Project'''<br />
<br />
* Watch the video available at[http://spoken-tutorial.org/What_is_a_Spoken_Tutorial ][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial http][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial ://][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial -][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial tutorial][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial .][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial org][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial /][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial What][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial is][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial a][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial Spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial Tutorial]<br />
<br />
* It summarises the Spoken Tutorial project<br />
<br />
* If you do not have good bandwidth, you can download and watch it<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| To know more about the '''Spoken Tutorial''' project, watch the video available at the following link, that summarises the project.Alternatively, you can download and watch it.<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 9'''Spoken Tutorial Workshops'''The Spoken Tutorial Project Team<br />
<br />
* Conducts workshops using spoken tutorials<br />
<br />
* Gives certificates for those who pass an online test<br />
<br />
* For more details, please write to [mailto:contact@spoken-tutorial.org contact][mailto:contact@spoken-tutorial.org @][mailto:contact@spoken-tutorial.org spoken][mailto:contact@spoken-tutorial.org -][mailto:contact@spoken-tutorial.org tutorial][mailto:contact@spoken-tutorial.org .][mailto:contact@spoken-tutorial.org org]<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| The Spoken Tutorial Project Team. Conducts workshops using '''spoken tutorials''' and gives certificates for those who pass an online test. For more details, please write to '''contact AT spoken HYPHEN tutorial DOT org.'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 10'''Acknowledgement'''<br />
<br />
* Spoken Tutorial Project is a part of the Talk to a Teacher project<br />
<br />
* It is supported by the National Mission on Education through ICT, MHRD, Government of India<br />
<br />
* More information on this Mission is available at<br />
<br />
* [http://spoken-tutorial.org/NMEICT-Intro http][http://spoken-tutorial.org/NMEICT-Intro ://][http://spoken-tutorial.org/NMEICT-Intro spoken][http://spoken-tutorial.org/NMEICT-Intro -][http://spoken-tutorial.org/NMEICT-Intro tutorial][http://spoken-tutorial.org/NMEICT-Intro .][http://spoken-tutorial.org/NMEICT-Intro org][http://spoken-tutorial.org/NMEICT-Intro /][http://spoken-tutorial.org/NMEICT-Intro NMEICT][http://spoken-tutorial.org/NMEICT-Intro -][http://spoken-tutorial.org/NMEICT-Intro Intro]<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| '''Spoken Tutorial '''Project is a part of the '''Talk to a Teacher''' project and is supported by the '''National Mission on Education through ICT, MHRD, Government of India. '''More information on this Mission is available at '''spoken HYPHEN tutorial DOT org SLASH NMEICT HYPHEN Intro'''<br />
<br />
|-<br />
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 11'''About the contributor'''<br />
<br />
* This script has been contributed by '''TalentSprint'''<br />
* '''www.talentsprint.com'''<br />
<br />
* Thanks for joining<br />
<br />
<br />
| style="border:1pt solid #000000;padding:0.097cm;"| This script has been contributed by '''TalentSprint'''. <br />
<br />
This is Prathamesh Salunke signing off.<br />
<br />
Thanks for joining.<br />
<br />
<br />
<br />
<br />
|}</div>Pratham920