Upload
simone-stefani
View
218
Download
0
Embed Size (px)
DESCRIPTION
Java
Citation preview
Programming and Data Structures
1DV007
Tobias Andersson Gidlund
December 16, 2014
Department of Computer Science
Programming and Data Structures 1(20)
Agenda
Course Information
Moodle
Lectures
Literature
Practical Assignments
Examination
Cheating
Registration
Course Content
Inheritance and Interfaces
Algorithms
Data Structures
JavaFX
Department of Computer Science
Programming and Data Structures 2(20)
Course Information
◮ In total ten (10) lectures.
◮ Teacher: Tobias Andersson Gidlund◮ You can find me in room B3010.◮ In case of questions, please use e-mail.◮ [email protected]
◮ Teaching Assistants:◮ You reach them via e-mail as well.
◮ Please come talk to us before anything
(mainly assignments) go out of hand. . .
Course Information Department of Computer Science
Programming and Data Structures 3(20)
Moodle
◮ Our main means of communicating toyou is by Moodle.
◮ You find it at http://lnu.se/student
◮ Any updates or changes to the schedule
is posted there, so please visit Moodle
before all lectures.
◮ Please notice that we mainly use Moodleas a way to communicate to you.
◮ If you want to contact us, please usee-mail.
◮ If you wish, we can open forums for youto discuss between yourselves.
◮ On Moodle we will post all lectures and
assignments.
◮ You also and in your assignments on
Moodle.
Course Information Department of Computer Science
Programming and Data Structures 4(20)
Lectures
1. Introduction
2. Inheritance and Interfaces
3. Recursion and External Packages
4. Graphical User Interfaces 1 – Now with JavaFX
5. Basic Data Structures
6. Graphical User Interfaces 2 – More JavaFX
7. Algorithms 1
8. Algorithms 2
9. Collection Classes
10. Generic Classes
Course Information Department of Computer Science
Programming and Data Structures 5(20)
Lecture Times and Assignments
◮ English Group◮ Lectures: Monday 10 – 12 and Thursday 10 – 12◮ Assignments:
Group 1: Software Technology, Applied MathematicsGroup 2: Computer Security, others
◮ Swedish Group◮ Lectures: Monday 13 – 15 and Wednesday 10 – 12◮ Assignments:
Group 1: Programvaruteknik, Natverkssakerhet, ovriga
Group 2: Hogskoleingenjor i datateknik, Tillampadmatematik, Fysik
◮ Notice that if few students show up at the assignments, we
will make it only one group per language.
Course Information Department of Computer Science
Programming and Data Structures 6(20)
Literature
◮ The book to use is the same as forthe previous course.
◮ Horstmann, Big Java, LateObjects.
◮ This course will cover chapters
nine and forward.
◮ The book covers the older GUI
technology called Swing but in the
course we will introduce JavaFX.
◮ For learning about JavaFX, we
recommend
http://docs.oracle.com/javase/8/javase-clienttechnologies.htm
Course Information Department of Computer Science
Programming and Data Structures 7(20)
Practical Assignments
◮ There will be four practical assignments.
◮ All assignments will have separate deadlines.
◮ All assignments are individual
◮ Each assignment will be given a grade based on ETCS (A – F)
◮ Assignments that are correct are only graded once.◮ You cannot re-submit your code to get a higher grade.
◮ If the assignment is handed in after the deadline, the gradewill be lowered.
◮ Important: If you have a valid reason not to hand in your
assignment on time, talk to the teaching assistant well beforethe deadline.
◮ If you cannot tell us before the deadline, you need to be able
to back up your claims well.
Course Information Department of Computer Science
Programming and Data Structures 8(20)
Assignment content
◮ The assignments will be available via Moodle.
◮ You also hand in your solutions via Moodle.
◮ The overview of the assignments is as follows:
Assignment Scope Deadline
Inheritance, recursion and GUI 1 Lectures 1 – 4 February 6
Basic data structures and GUI 2 Lectures 5 – 6 February 20
Algorithms 1 Lecture 7 – 8 March 6
Algorithms 2 Lecture 9 – 10 March 20
◮ For those who do not finish in time, there will be a secondand third chance as well.
◮ Notice that you should only hand in complete solutions, notparts of it (only individual tasks).
Course Information Department of Computer Science
Programming and Data Structures 9(20)
Examination
◮ The course will end with a written exam.
◮ The exam will have 50 points in about five questions.◮ Each question could have sub-questions.
◮ To pass, you need to have 50% (or 25 points).◮ To pass with distinction, you need 80% (or 40 points).
◮ The first exam will be in week 12, the second in week 19 or
20.
◮ After that, there will be an additional exam in August.
Course Information Department of Computer Science
Programming and Data Structures 10(20)
Cheating
◮ All kinds of cheating will be reported!◮ In case of a hearing, you can be suspended
from further studies.
◮ You may, however, discuss solutions with each
others.
◮ You may not copy or transcribe other student’ssolutions.
◮ This goes for both parts and whole programs.
◮ We have sophisticated programs to detectplagiarism even if you make a lot of namingchanges.
◮ Also, we have seen hand-ins from students for
years and years and years
Course Information Department of Computer Science
Programming and Data Structures 11(20)
Registration
◮ We will have a head count to see if you are here. . .
◮ However, to attend the course you need to be admitted.
◮ If you are not – contact Admissions Office in the mainbuilding.
◮ It is their decision if you can attend or not.
◮ If you are admitted, you also need to register.◮ You do that at the student page on lnu.se
◮ Everyone needs to register.
◮ If you don’t register, you will not be able to take the written
exam or to be given a grade.
Course Information Department of Computer Science
Programming and Data Structures 12(20)
COURSE CONTENT
Course Content Department of Computer Science
Programming and Data Structures 13(20)
About the content of the course
◮ The course is about data structures.
◮ Data structures are everywhere in programming and this
course is about using them in the right context.
◮ To do this, we will look at algorithms on those data
structures.
◮ In addition to that, we will also look at programminggraphical user interfaces.
◮ This is done, to a large extent by using data structures.
◮ But, to begin with there is some things left over from objectorientation.
◮ Inheritance and interfaces.◮ Used by the collection classes of data structures.
Course Content Department of Computer Science
Programming and Data Structures 14(20)
Inheritance and interfaces
◮ One of the promises made by object orientation is that of
reuse.
◮ Inheritance is an object oriented mechanism that allows for
structure and behaviour to be “given down” and “shared” by
objects in a hierarchy.
◮ It is a powerful mechanism that is important to know and use.
◮ The original form of inheritance did have some problems,
though.◮ Some of them were solved by interfaces.
◮ A way of specifying only the intended behaviour but not the
implementation.
◮ It is important to understand the foundations of object
orientation from the previous course before adding
inheritance and interfaces.
Course Content Department of Computer Science
Programming and Data Structures 15(20)
Algorithms
◮ An algorithm is a detailed description of how to solve a
problem.◮ Example: Find the largest number:
Input: A non-empty list L containing numbers
Result: The largest number in list L
MAX = first number in L
for each NUMBER in L repeat
if NUMBER > MAX then
MAX = NUMBER
return MAX
◮ An algorithm is a programming language independent
method to describe and explain solutions to problems of a
general nature.
◮ In this course, we are going to look further to searching and
sorting algorithms and many more.
Course Content Department of Computer Science
Programming and Data Structures 16(20)
Data Structures
◮ Data structures are used to organise data to be used aseffectively as possible.
◮ The List L in the previous example is a data structure.
◮ A data structure can be implemented in different ways.◮ Each implementation has its own pros and cons.
◮ Insertion might be fast but look up slow.◮ Look up might be slow but insertion fast.◮ There is no data structure implementation that is good at
everything.
◮ An important part of being a programmer is to choose
between different implementations.
◮ In addition to different lists, we will also look at tree
structures.
Course Content Department of Computer Science
Programming and Data Structures 17(20)
Programming graphical user interfaces
◮ The course will introduce JavaFX for creating GUIs.
◮ In the book, only the older toolkit called Swing is covered.◮ With Java 8 from last year, Oracle decided to drop
development on Swing in favour of JavaFX.
◮ JavaFX is a modern and hardware accelerated toolkit for
creating flexible GUIs.
◮ In addition to components like buttons and menus, it also hassupport for animations, effects and much more.
◮ It is also good looking and a lot easier to style than Swing.
◮ Programming JavaFX is also easier than with Swing.
◮ Today, there are a few books about JavaFX, and more
coming, but for this course the material online is sufficient.
Course Content Department of Computer Science
Programming and Data Structures 18(20)
Example application using JavaFX
Course Content Department of Computer Science
Programming and Data Structures 19(20)
After the course
◮ When this course is done, you will have learned most ofJava.
◮ Missing is threads for concurrency.◮ Also missing are the new lambda features of Java 8.
◮ You will be able to create projects of about 8 – 10 classes.
◮ With this you will be prepared for exploring more of Java.◮ We are only using Standard Edition in this course, but there is
also an Enterprise Edition.◮ Java EE deals mainly, but not only, with web applications.
◮ The rest of Java development is mostly to work with different
packages and APIs.
Course Content Department of Computer Science
Programming and Data Structures 20(20)