aliaga

Friday, July 22, 2005

Java1 Table of Contents

Table of Contents
Preface i
Chapter 1: Computers and Programming 1
1.1 What is a Computer? 1
1.2 Computer Programming 2
1.3 Programs Are Objects 5
1.4 Operating Systems and Windows 6
1.5 Software Architecture 8
1.5.1 Class Diagrams 9
1.6 Summary 11
1.7 Beyond the Basics 13
1.7.1 Stepwise Re¯nement 14
1.7.2 Object-Oriented Design 15
1.7.3 Classes Generate Objects 17
1.7.4 Frameworks and Inheritance 18

Chapter 2: Simple Java Applications 20
2.1 An Application and its Architecture 20
2.2 How to Build and Execute an Application 23
2.2.1 Using an IDE 23
2.2.2 Using the JDK 28
2.3 How the Application Works 30
2.3.1 An Execution Trace of the Application 33
2.4 How One Object Constructs Another 35
2.5 Repairing Compiler Error Messages 41
2.6 Summary 43
2.7 Programming Exercises 46
2.8 Beyond the Basics 47
2.8.1 Syntax 47
2.8.2 Semantics 49
2.8.3 Java Packages 51
2.8.4 Java API 51

Chapter 3: Arithmetic and Variables 56
3.1 Integer Arithmetic 57
3.2 Named Quantities: Variables 59
3.2.1 Variables Can Vary: Assignments 63
3.3 Arithmetic with Fractions: Doubles 68
3.4 Booleans 72
3.5 Operator Precedences 74
3.6 Strings, Characters, and their Operations 75
3.7 Data-Type Checking 80
3.8 Input via Program Arguments 83
3.8.1 Converting between Strings and Numbers and Formatting 86
3.8.2 Temperature Conversion with Input 88
3.9 Diagnosing Errors in Expressions and Variables 92
3.10 Java Keywords and Identi¯ers 95
3.11 Summary 95
3.12 Programming Projects 97
3.13 Beyond the Basics 102
3.13.1 Longs, Bytes, and Floats 102
3.13.2 Helper Methods for Mathematics 103
3.13.3 Syntax and Semantics of Expressions and Variables 105

Chapter 4: Input, Output, and State 107
4.1 Interactive Input 108
4.1.1 Dialog Output 112
4.2 Graphical Output 113
4.2.1 Panels and their Frames 113
4.2.2 Customizing Panels with Inheritance 115
4.3 Format and Methods for Painting 122
4.3.1 Constructor Methods and this Object 124
4.4 Objects with State: Field Variables 130
4.4.1 Using Fields to Remember Inputs and Answers 135
4.4.2 Scope of Variables and Fields 140
4.5 Testing a Program that Uses Input 142
4.6 Summary 144
4.7 Programming Projects 147
4.8 Beyond the Basics 151
4.8.1 Scope of Variables and Fields 151
4.8.2 Partial API for JFrame 152
4.8.3 Methods for GregorianCalendar 152
4.8.4 Colors for Graphics 152
5.8.5 Applets 153

Chapter 5: Component Structure: Method and Class Building 157
5.1 Methods 158
5.2 Public Methods 159
5.2.1 Basic Public Methods 160
5.2.2 Constructor Methods 164
5.3 Parameters to Methods 168
5.3.1 Forms of Parameters 173
5.4 Case Study: General Purpose Output Frame 179
5.5 Results from Methods: Functions 186
5.6 Private Methods 193
5.7 Summary 200
5.8 Programming Projects 203
5.9 Beyond the Basics 212
5.9.1 Naming Variables, Methods, and Classes 212
5.9.2 Generating Web Documentation with javadoc 213
5.9.3 Static Methods 217
5.9.4 How the Java Compiler Checks Typing of Methods 220
5.9.5 Formal Description of Methods 221
5.9.6 Revised Syntax and Semantics of Classes 227

Chapter 6: Control Structure: Conditional Statements 229
6.1 Control Flow and Control Structure 230
6.2 Condtional Control Structure 231
6.2.1 Nested Conditional Statements 235
6.2.2 Syntax Problems with Conditionals 240
6.3 Relational Operations 241
6.4 Uses of Conditionals 245
6.5 Altering Control Flow 249
6.5.1 Exceptions 250
6.5.2 System Exit 251
6.5.3 Premature Method Returns 252
6.6 The Switch Statement 252
6.7 Model and Controller Components 255
6.7.1 Designing an Application with a Model-View-Controller Architecture 257
6.8 Case Study: Bank Accounts Manager 259
6.8.1 Collecting Use-Case Behaviors 259
6.8.2 Selecting a Software Architecture 261
6.8.3 Specifying the Model 261
6.8.4 Writing and Testing the Model 261
6.8.5 Specifying the View Components 265
6.8.6 A Second Look at the Software Architecture 265
6.8.7 Writing the View Classes 265
6.8.8 Controller Construction and Testing 272
6.8.9 Testing the Assembled Application 276
6.8.10 Multiple Objects from the Same Class 277
6.9 More about Testing Methods and Classes 283
6.9.1 Testing Individual Methods 283
6.9.2 Testing Methods and Attributes Together 283
6.9.3 Testing a Suite of Methods 284
6.9.4 Execution Traces 285
6.10 Summary 286
6.11 Programming Projects 290
6.12 Beyond the Basics 295
6.12.1 The Logic of the Conditional Statement 295
6.12.2 Interface Speci¯cations and Integration 300

Mat.Diskrete

Matematika Diskrete
Lënda Matematika Diskrete ligjërohet në vitin e parë në drejtimin e shkencës kompjuterike.
Lënda ndahet në këto njësi:
Elemente nga teoria e bashkësive
Unioni. Prerja. Ndryshimi. Bashkësia parititive.
Relacionet
Funksionet
Vargjet
Induksioni matematik
Rekursioni
Elemente të logjikës matematike
Algjebra e gjykimeve. Kuantorët. Lidhja e kuntorëve me negacionin.
Sistemet numerike
Aritmetika e sistemeve të ndryshme
Sistemi binar, oktal dhe heksadecimal
Algoritmet për kalimin nga njëri sistem në tjetrin
Strukturat algjebrike
Gjysmëgrupet. Grupet. Nëngrupet.
Homomorfizmet.
Unazat dhe fushat.
Algjebra e Bulit
Parimi i dualitetit
Funksionet buleane. Forma kanonike dhe forma duale e funskioneve buleane
Qarqet digjitale
Elemente të kombinatorikës
Ligji i shumës dhe prodhimit
Permutacionet dhe kombinacionet
Elemente nga teoria e grafeve
Nëngrafet
Izomorfizmi i grafeve. Diagrafi.
Grafi komplet, regular, ciklik.
Matrica e fqinjësisë dhe amtrica e incidencës së një grafi.
Grafet e lidhur.
Drurët dhe shkurret.
Shtigjet, qarqet dhe ciklet e një grafi.
Grafi i Eulerit dhe grafi i Hamiltonit
Elemente të teorisë së numrave
Unaza e numrave të plotë.
Plotpjestueshmëria
Algoritmi i Euklidit.
Literatura e cila shërben për përgatitjen e lëndës është: [1] E. Gashi, Teoria e bashkësive dhe logjika, Prishtinë, 2000 [2] P, Grassman, Discrete mathematics for computing, New York, 1997 [3] S. Lipschutz, M. Lipson, Discrete mathematics, New York 1997