Download CISC 124: Introduction To Computing Science II instructor

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CISC 124: Introduction To
Computing Science II
instructor: Margaret Lamb
course web site: www.cs.queensu.ca/home/cisc124
office: Goodwin 554
office hour this week:
Monday 12-1
Wednesday 2-3
Friday 1-2
vote on Moodle for office hours for rest of term
CISC 124, winter 2014, set 1: introduction
1
Moodle vs. Web Site
Web site on CISC server:
http://cs.queensu.ca/home/cisc124/index_w14.html
Option 1:
• Read web site for basic information
(content/admin)
• Go to Moodle for extras (forums, etc.)
Option 2:
• Use Moodle as front page (links to everything in
web page)
CISC 124, winter 2014, set 1: introduction
2
Reading Assignment For Wednesday
Read administrative info on web site.
Pay special attention to syllabus & bring questions to
class on Wednesday.
Look at schedule, tell me about any problems with
quiz dates
CISC 124, winter 2014, set 1: introduction
3
Reading Assignment For Friday
Chapters 1-3 of the Java text.
See web site for sections you may skip.
Complete Moodle survey about the reading by noon on
Friday.
I expect you to:
• Do readings as assigned.
• Complete surveys to tell me your reactions.
CISC 124, winter 2014, set 1: introduction
4
Marking Scheme
quizzes (best 3 of 4): 50%
final exam: 34%
assignments (best 7 of 8): 10%
participation: 6%
(questionnaires, forums, in-class activities)
You must pass quizzes+final exam to pass the course.
CISC 124, winter 2014, set 1: introduction
5
Academic Integrity
• Everything you hand in must be your own work
(assignments, quizzes, final)
• Exception: may do assignments in group (2-4 students),
all names must be on submission
• Why?
• It's only fair!
• Queen's reputation, value of degrees
CISC 124, winter 2014, set 1: introduction
6
What's This Course About?
• Gaining more programming experience
• Learning about Object-Oriented Programming (OOP)
Language used: Java
CISC 124, winter 2014, set 1: introduction
7
A Brief History of Java
Predecessors:
• CPL, BCPL (1960s)
• B (1969)
• C (early 1970s)
• C++ (1980s, object-oriented)
Java:
• Sun Microsystems (now part of Oracle)
• first public version 1995
• design team led by Jim Gosling (Canadian!)
• initial target: embedded systems
• goals included: portability & reliability
• 1994: World Wide Web!
CISC 124, winter 2014, set 1: introduction
8
Computer Languages & Translation
Computers speak machine language – binary codes for
very simple operations.
Very cumbersome for humans to read and write!
No standard: every make/model has its own language.
Assembly Language:
• Symbolic form of machine language
• Easier for humans to handle
• Simple program ("assembler") translates to machine
language
• Still involves a lot of detail
• Still machine-dependent
CISC 124, winter 2014, set 1: introduction
9
High-Level Languages
Idea: Languages that are closer to the way we think:
logic, data types, mathematical notation
Advantages:
• Easier/faster to read & write
• Can be translated into different machine languages
Disadvantages:
• Needs a complicated translation program
• Not always completely portable – depends on
language design and translation programs
CISC 124, winter 2014, set 1: introduction
10
Translation Methods
• Interpreter (Python, Basic)
• Compiler (C, C++)
• Hybrid Approach (Java)
CISC 124, winter 2014, set 1: introduction
11
Interpreter
Reads & executes a program in a high-level language.
• Read a line or statement
• Figure out what it means
• Make it happen
• Repeat!
Python
Program
Python
Interpreter
output of
program
input to
program
CISC 124, winter 2014, set 1: introduction
12
Compiler
Reads a program in a high-level language.
Creates an equivalent program in machine language.
Step 1:
C
Program
C
Compiler
machine
language
program
machine
language
program
output of
program
Step 2:
input to
program
CISC 124, winter 2014, set 1: introduction
13
Pros & Cons
Need For Extra Program:
• Compiler: Program is compiled once. You don't need the
compiler to run the program.
• Interpreter: You need the interpreter each time you run the
program.
Efficiency: Interpreted languages traditionally viewed as less
efficient. Changing with clever new technology ("just in time"
compilation).
Portability:
• Compilers: You need to write a compiler for every
"platform" (hardware & OS)
• Interpreters: Not always necessary
Both: Great care is needed to make a language truly portable
(same results on all kinds of computers)
CISC 124, winter 2014, set 1: introduction
14
Java's Hybrid Approach
JVM = Java Virtual Machine
A hypothetical computer
"Bytecode": the machine language of the JVM.
Designed to suit the Java language, still pretty low-level.
Step 1: (once)
Java Program
(.java)
Java
Compiler
bytecode program
(.class)
Step 2: (every time you run the program)
bytecode program
(.class)
Java
Interpreter
Program Output
Program Input
CISC 124, winter 2014, set 1: introduction
15