compsci 340 & softeng 370 semester 2 - 2014

30
COMPSCI 340 & SOFTENG 370 Semester 2 - 2014 Tutorial 1

Upload: hisano

Post on 06-Feb-2016

148 views

Category:

Documents


1 download

DESCRIPTION

COMPSCI 340 & SOFTENG 370 Semester 2 - 2014. Tutorial 1. About the tutor. Name: Ahmad Obidat Qualifications: PhD in Information System, the University of Auckland, 2011 – Present Education Specialist in Computer Science Education, Florida Institute of Tech., 2009 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

COMPSCI 340 & SOFTENG 370

Semester 2 - 2014

Tutorial 1

Page 2: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

About the tutor

• Name: Ahmad Obidat• Qualifications:– PhD in Information System, the University of

Auckland, 2011 – Present– Education Specialist in Computer Science

Education, Florida Institute of Tech., 2009– Master of Science in Computer Science Education,

Florida Institute of Tech., 2006

Page 3: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

How and where can you meet me ?

• Email: [email protected]

How can you contact me?

• Weekly office hours on Monday from 12 pm to 2 pm – Location: in the area across from Room 303.488

• By appointment: please, email me to set time and place

Page 4: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Today’s Agenda

• Installing Ubuntu• Java vs. Python • Installing necessary apps for the course

Page 5: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Linux Distributions

• The most popular are Ubuntu, Red Hat, Fedora, SuSE, PCLinuxOS, and MEPIS

• Which one to use?– Any one should be fine

• Which one are we going to use?– Ubuntu

• Why Ubuntu?– User friendly– Large user community

Page 6: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Installation

• Mainly, Ubuntu can be configured using three different ways:– To run Ubuntu without installing it on your hard drive, the

best way is to run it from CD/DVD https://help.ubuntu.com/community/BurningIsoHowto

– Dual-boot system. Namely, you will have both Windows and Linux available for booting http://www.ubuntu.com/download/help/install-ubuntu-with-windows

– Using VMware Player: it creates isolated virtual machines (we are going to use this method)

Page 7: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Installation using VMware Player

• Download the appropriate version of Ubuntu to your hard drive from: http://www.ubuntu.com/download/desktop

• Download VMware Player for Windows 32-bit and 64-bit from:http://www.vmware.com/download/player/download.html

• Double click on VMware-player-6.0.3-1895310 exe file

• Make sure you change the hardware settings when installing (see next slides)

Page 8: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Select create New Virtual Machine

Page 9: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Select the second option and browse to the iso file you downloaded.

Page 10: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Personal data

Page 11: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Enter a name for the virtual machine

Page 12: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Specify Disk Capacity

Give it up to 30 GB

Page 13: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

New Virtual Machine Wizard

Select Customize Hardware

Page 14: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Specify the amount of memory allocated for the virtual machine

Use the slider to choose the appropriate size as it is advised by the legend.

Page 15: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Processor

Select number of processor cores.

Page 16: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

3D Graphics

Make sure that the “Accelerate 3D graphics” checkbox is checked.

Page 17: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Java vs. Python

• Python programs are typically 3-5 times shorter than equivalent Java programs

• Python programs take much less time to develop than Java ones

• Python is built-in high-level data types and dynamic typing

• Python provides an operating system module which gives connection to Unix system calls.

Page 18: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Java vs. Python

Javapublic class HelloWorld{ public static void main (String[] args) { System.out.println("Hello, world!"); }}

Pythonprint("Hello, world!")

Page 19: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Java vs. Python

Java public class MainClass {public static void main(String[] args) {int start = 1;int end = 100;int theSum = sumRange( start, end );System.out.println ("The sum of the integers between " + start + " and " + end + " is " + theSum);

}public static int sumRange(int first, int last) {int total = 0;int i = first;while (i <= last ){total+= i;i ++;}return total;}}

Pythondef sumRange( first, last ) : total = 0 i = first while i <= last : total = total + i i = i + 1 return totalstart = 1end = 100theSum = sumRange( start, end )print ("The sum of the integers between", start,\ "and", end, "is", theSum)

Page 20: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Java vs. Python

Java public class PrintList {public static void main(String[] args) {int [] gradeList = { 85, 90, 87, 65, 91 };System.out.print( "[" ); for( int i = 0; i < gradeList.length; i++ ) { System.out.print( gradeList[ i ] ); if( i < gradeList.length-1 ) System.out.print( ", " ); } System.out.println( "]" );}}

Python gradeList = [ 85, 90, 87, 65, 91 ]print (gradeList)

Page 21: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Installing Python 3

Page 22: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Installing Python3 cont.

Click on “Developer

Tools”

Page 23: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Installing Python3 cont.

Click on

“Python”

Page 24: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Installing Python3 cont.

IDLE (using Python-3.4)

Page 25: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Installing Python3 cont.

Click on

“Install”

Page 26: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Installing Python3 cont.

Page 27: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Editing python code with gedit and running it from the command line

• Search for “gedit” and then click on the “Text Editor” icon

Page 28: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Editing python code with gedit and running it from the command line cont.

Page 29: COMPSCI 340 & SOFTENG 370  Semester 2 - 2014

Editing python code with gedit and running it from the command line cont.