IT441 Network Services Administration

Slides:



Advertisements
Similar presentations
Arrays A list is an ordered collection of scalars. An array is a variable that holds a list. Arrays have a minimum size of 0 and a very large maximum size.
Advertisements

WALT: Know the months of the year poem. Answer questions about the months.
Chubaka Producciones Presenta :.
2012 JANUARY Sun Mon Tue Wed Thu Fri Sat
P Pathophysiology Calendar. SundayMondayTuesdayWednesdayThursdayFridaySaturday January 2012.
Chicas, este calendario si es pa' nosotras !!!!!.
Prof. Alfred J Bird, Ph.D., NBCT Office – McCormick 3rd floor 607 Office Hours – Tuesday and.
Prof. Alfred J Bird, Ph.D., NBCT Office – Wheatly 2nd floor Office Hours – MW 3:00PM to 4:00PM.
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSAT/SUN Note: You can print this template to use as a wall calendar. You can also copy the slide for any month to add.
You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation. If you’d like to change.
2008 Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation. If you’d.
School Year Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation.
School Year Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation.
You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation. If you’d like to change.
2007 Monthly Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation.
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSAT/SUN Note: You can print this template to use as a wall calendar. You can also copy the slide for any month to add.
You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation. If you’d like to change.
You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation. If you’d like to change.
Prof. Alfred J Bird, Ph.D., NBCT Office – McCormick 3rd floor 607 Office Hours – Tuesday and.
Prof. Alfred J Bird, Ph.D., NBCT Door Code for IT441 Students – * Office – Wheatly.
Prof. Alfred J Bird, Ph.D., NBCT Door Code: * Office – McCormick 3rd floor 607 Office.
Prof. Alfred J Bird, Ph.D., NBCT -bird.wikispaces.umb.edu/ Office – McCormick 3rd floor.
Lists CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
WORD JUMBLE. Months of the year Word in jumbled form e r r f b u y a Word in jumbled form e r r f b u y a february Click for the answer Next Question.
Prof. Alfred J Bird, Ph.D., NBCT Office – McCormick 3rd floor 607 Office Hours – Tuesday and.
DATE POWER 2 INCOME JANUARY 100member X 25.00P2, FEBRUARY 200member X 25.00P5, MARCH 400member X 25.00P10, APRIL 800member.
Prof. Alfred J Bird, Ph.D., NBCT Door Code for IT441 Students.
2011 Calendar Important Dates/Events/Homework. SunSatFriThursWedTuesMon January
Prof. Alfred J Bird, Ph.D., NBCT Door Code for IT441 Students.
CALENDAR 2015: “THIS PROJECT HAS BEEN FUNDED WITH SUPPORT FROM THE EUROPEAN COMMISSION. THIS PUBLICATION [COMMUNICATION] REFLECTS THE VIEWS ONLY OF THE.
TEMPORAL VISUALIZATION OF DATA FROM THE FRENCH SENTINEL NETWORK.
July 2007 SundayMondayTuesdayWednesdayThursdayFridaySaturday
Mnemonics Using letters to make up phrases that help you remember.
Prof. Alfred J Bird, Ph.D., NBCT Office – McCormick 3rd floor 607.
School Year Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own.
Calendar.
IT441 Network Services Administration
An introduction to outlining in PowerPoint
Dictation practice 2nd Form Ms. Micaela-Ms. Verónica.
TIMELINES PHOTOS This is an example text
TIMELINES PHOTOS This is an example text
McDonald’s Kalender 2009.
McDonald’s Kalender 2009.
Year 2 Autumn Term Week 12 Lesson 1
School Year Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation.
1   1.テキストの入れ替え テキストを自由に入れ替えることができます。 フチなし全面印刷がおすすめです。 印刷のポイント.
2017/18 Payment Calendar Due Date Cut-off Day 1st of every month
McDonald’s Kalender 2009.
0845 Analysis I have only very recently taken over responsibility for the 0845 number and whilst questions were asked of Derrick some months ago, we have.
Problem Gambling Clicks to Opgr.org
2300 (11PM) September 21 Blue line is meridian..
McDonald’s calendar 2007.
Year 2 Autumn Term Week 12 Lesson 1
1 - January - Sun Mon The Wed Thu Fri Sat
Proud As A Peacock! We are very proud of__________________
Capitalization of Months and Days
Teacher name August phone: Enter text here.
School Year Calendar You can print this template to use it as a wall calendar, or you can copy the page for any month to add it to your own presentation.
Tropical cyclones movement
February 2007 Note: Source:.
January 2015 Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Who Wants to be a Millionaire?
MONTHS OF THE YEAR January February April March June May July August
McDonald’s calendar 2007.
Production Month Sun Hours K Monthly Kwh Tou Peak Value After Kwh
Habitat Changes and Fish Migration
2015 January February March April May June July August September
Habitat Changes and Fish Migration
UNITS OF TIME QUESTIONS.
Presentation transcript:

IT441 Network Services Administration Prof. Alfred J Bird, Ph.D., NBCT abird@cs.umb.edu http://it441-f12.wikispaces.umb.edu/ Office – Wheatly 2nd floor 096-03 Office Hours – MW 3:00PM to 4:00PM

Data Types Remember there are three basic data types in Perl Numeric String Boolean (Logical) I differentiate between data types and data structures. Not every author or teacher does. Some books use the terms interchangeably so watch out!

Data Structures In PERL there are three types of data structures: Scalars Arrays Hashes Each structure has it own naming syntax. $scalar @array %hash

Scalars We talked about scalars two weeks ago. Scalars are a data type that contain one element. It can be a number such as 1 It can be a string such as “Hello World! \n” It can be a boolean such as true or false It can be stored in a variable with a name such as $i. It is the most primitive of the data structures.

Lists We talked about lists last meeting. A list is defined as an ordered set of scalar values. Lists are delimited by parentheses such as () (1) (“a”) (1, 2, 3, 4, 5) (“a”, “b”, “c”, “d”, “e”) (‘e’, ‘d’, ‘c’, ‘b’, ‘a’) Remember that a list is ordered!

Another Data Structure The problem with a list is that it cannot be named! We need to retype the list every time we want to use it. To solve this difficulty we have a data structure called an array. We can give an array a name that starts with a @.

Arrays An array is a data structure that has the characteristics of a list but can be named! To store a scalar into a variable we use an assignment statement $a = 1; To store a list into an array we do the same thing: @a = (1,2,3,4,5); @l = (‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’); @m = qw<az x c v b n m>;

Accessing Individual Elements How do we access an individual element in an array? Just like we did in a list. Using a list if we code: print ((‘now’, ‘is’, ‘the’, ‘time’)[2]); It will print out the Likewise if we define an array: @s = (‘now’, ‘is’, ‘the’, ‘time’); print @s[2]; Will also print out the What about print $s[2];? What will it print out?

Scalar vs. List Context Why does the statement print $s[2]; work? Use the prefix for what you want not what you have. This is referred to as list vs. scalar context. It can become a very important concept later.

A Coding Problem. Write a program that: Creates an array called @months with the names of the months and use it in a print statement to print out the month you were born.

A Coding Problem. Write a program that: Creates an array called @months with the names of the months and use it in a print statement to print out the month you were born. #!/usr/bin/perl/ @ month = qw#January February March April May June July August September October November December#; print (@month[4]);

Another Coding Problem. Write a program that: Asks you the numeric value of the month you were born, creates an array called @months with the names of the months and use this array in a print statement to print out the month you were born based on the data value you entered.

Another Coding Problem. Write a program that: Asks you the numeric value of the month you were born, creates an array called @months with the names of the months and use this array in a print statement to print out the month you were born based on the data value you entered. #!/usr/bin/perl/ print “Enter the number of the month you were born: “; chomp ($month = <STDIN>); @month = qw&January February March April May June July August September October November December&; print @month[$month-1]);

A Third Coding Problem. Write a program that: Asks you the numeric value of the month you were born, creates an array called @months with the names of the months and use this array in a print statement to print out the month before you were born, the month you were born and the month after you were born based on the data value you entered.

A Third Coding Problem. Write a program that: Asks you the numeric value of the month you were born, creates an array called @months with the names of the months and use this array in a print statement to print out the month before you were born, the month you were born and the month after you were born based on the data value you entered. #!/usr/bin/perl/ print “Enter the number of the month you were born: “; chomp ($month = <STDIN>); @months = qw&January February March April May June July August September October November December&; print (@month[$month-2..$month]);

Another Coding Problem Write a program that: Asks you the numeric value of the month and the year you were born, creates an array called @months with the names of the months and an array called @numDays that contains the number of days in a month (remember leap years) and use these arrays in a print statement to print out the month, the year and how many days are in the month you were born based on the info you entered.

Write a program that: Asks you the numeric value of the month and the year you were born, creates an array called @months with the names of the months and an array called @numDays that contains the number of days in a month (remember leap years) and use these arrays in a print statement to print out the month, the year and how many days are in the month you were born based on the info you entered. #!/usr/bin/perl/ print “Enter the number of the month you were born: “; chomp ($month = <STDIN>); print “Enter year you were born: “; chomp ($year = <STDIN>) @months = qw&January February March April May June July August September October November December&; @numDays = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); $numDays = @numDays[1]; if ($month==2 && $year%4==0){$numDays=29;} print (@month[$month-1], “, $year has ”, $numDays, “ days \n”);

Array Functions How do we add data to an array? @array = (@array, $scalar); #is one way! But there is a better way!! push @array, $scalar; #will do the same thing! push will append the value in $scalar to the top of @array Likewise pop will take the last value in an array and do something with it. $scalar = pop @array

Array Functions push() and pop() act on the top of an array (the highest indexed end) shift() and unshift() act on the bottom of an array and perform the same function. We already know what reverse() does.

Array Functions Another function is sort(). What do you think it does? Write a simple program to try it with your array of months. Predict the output before you try it. What happened? Now write a simple program to try it with your array of number of days. What happened????? Why?????

For next time Read pages 95 to 114 in the textbook.