1 purposes: learn java 1.what is programming languages 2.how to solve problems by computers 1.a cs...
TRANSCRIPT
![Page 1: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/1.jpg)
1
Purposes:
Learn JAVA1. What is programming languages2. How to solve problems by computers
1. a CS major student, get a degree in BS2. a programmer system manager project leader3. a computer scientist
is worthwhile and doable.
Being
![Page 2: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/2.jpg)
2
Hardware SoftwareTheory1800 AD
Architecture1945 AD
What is Computer Science?
Languages1960 AD
![Page 3: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/3.jpg)
3
Alan Turing (1912-1954) – The Enigma
The man who invented the computer
Image from http://ei.cs.vt.edu/~history/Turing.html
Turing Machines
Turing Award: the Nobel Prize in CS
![Page 4: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/4.jpg)
4
Said:
“Turing Machines are human that compute.”
“In logic nothing is accidental”
Ludwig Wittgenstein (1889-1951)
Image from http://www.ags.uci.edu/~bcarver/wgallery.html
![Page 5: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/5.jpg)
5
Hardware
Input device Output device
Central Processor Unit:
Internal Storage
Control Unit+
Arithmetic-Logic Unit(ALU)
![Page 6: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/6.jpg)
6
Software
0 1 1 00 0 0 11 1 0 0
24=16
![Page 7: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/7.jpg)
7
A bit logical, Adder (half adder)
1
+) 11 0
1
+) 0
1
0
+) 1
1
0
+) 0
0
A
+) Bc S
A B c S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
A
BS
c
Adder
AB
![Page 8: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/8.jpg)
8
Full Adder
Ci
A
+) B
Co S
Ci A B Co S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
AB
S
Co
FullAdder
Ci
![Page 9: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/9.jpg)
9
4 bits Adder
Full Adder
Full Adder
Full Adder
Full Adder
A
B 0
1 1 0 1
0 1 0
1 0 1 1
0
0 1 0
0 1 0
0
1 0 1 1
+) 0 0 1 0
1 1 0 1
10 0
![Page 10: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/10.jpg)
10
Logical Gates for an Adder (half adder)
A
+) Bc S
A B c S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0AND
OR
AND
NOT
B
A
S
c
1
1
0
11 1
11
1
1
10
0
Half-Adder
![Page 11: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/11.jpg)
11
Software: 1. Operation systems2. Applications
XP,Unix,VAX
Words
Excel
E.I.
Hello
Java
Hello.javajavacHello.class
(class loader)
Eclipse,NetBean IDE, Sun
![Page 12: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/12.jpg)
12
IDE (Integrated Development Environment)1. A customized plain text editor2. Compiler3. Loader4. Debugging tool
Java 2 Software Development Kit (J2SDK)
Eclipse
1. notepad2. javac hello.java3. java hello4. ......
![Page 13: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/13.jpg)
13
Solving a problems by computers.
1+2+3+4+..............+98+99+100 = ?
0 + 1 = sum1;
sum1+2=sum2
sum2+3=sum3
sum3+4=sum4
sum4+5=sum5
sum5+6=sum6.............sum99+100 = sum100
0+1=1
1+2=3
3+3=6
6+4=10
10+5=15
15+6=21...............4950+100=5050
![Page 14: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/14.jpg)
14
Solving a problems by computers. 0 + 1 = sum1
sum1+2=sum2
sum2+3=sum3
sum3+4=sum4
sum4+5=sum5
sum5+6=sum6.............sum99+100 = sum100
sum = 0sum = sum+1
sum = sum+2
sum = sum+3
sum = sum +4
sum = sum +5.............sum = sum+100
computercan do the samething againand againfast
![Page 15: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/15.jpg)
15
Algorithm: a procedure of calculating (manipulate) data
1+2+3+4+ .............. +98+99+100 = ?
sum = 0sum = sum+1sum = sum+2sum = sum+3sum = sum +4sum = sum +5......sum = sum+100
sum = 0;i = 1;while (i <= 100) do the following{
sum = sum + i;i = i+1;
}sum is the answer;
![Page 16: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/16.jpg)
16
Graph Reachability
G: (V,E) V: the set of verticesE: the set of edges
15
463
27
V = {1,2,3,4,5,6,7}E = {(1,2), (1,3), (1,4) (3,6),(5,6), (5,7)}
Is there a path from 1 to 6 in G?Is there a path from 1 to 7 in G?
![Page 17: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/17.jpg)
17
Algorithm for Graph Reachability:
Input G: (V,E), a,b;let S = {a};mark a;while (s {}) do the following
select one element from S; let it be x;remove x from S;
let N = { y : (x,y) in E };if b in N, say “yes” and stop;mark every b in X;set S = S union N;
say “no”;
Is there a path from a to b in G?
JavaC++CFortranFortran90LispAdaCOBOLBASICPascalPolog
![Page 18: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/18.jpg)
18
Pr8oblemsSolutions cycle
Problems
System analyst, Project leader
Algorithms
Senior Programmers
Programs in C++ (or any high level Programming Language)
compiler
AssemblyAssembler
Machine code
linkerResults
Customers
ProgrammersSyntaxSemantics
95%(human)
IDE5%(computers)
![Page 19: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/19.jpg)
19
Procedure vs ObjectTo write a program is:
To find a way to manipulate data --
• We design procedures • Procedure-Oriented Programming
Statements + functions programs
To find data to manipulate –
• We choose data (object) • Object-Oriented Programming
Classes + Objects programs
(interfaces, methods, attributes…)
![Page 20: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/20.jpg)
20
Classes:A class is a concept of something
Vehicle4 wheels, seat, engine, windows……
Truck…………
Sedan…………
SUV…………
![Page 21: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/21.jpg)
21
Method & Attribute
class: Method &Attribute
Method: behaviors (operation, functionalities)
Field (attribute): the properties the class
![Page 22: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/22.jpg)
22
Objects
Vehicle
SUV
Honda Pilot
011-JAV
instantiation
Class
Object
![Page 23: 1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer system](https://reader036.vdocuments.mx/reader036/viewer/2022062518/56649e115503460f94afc6d0/html5/thumbnails/23.jpg)
23
A Java Program:// Fig. 2.1: Welcome1.java// Text-printing program.
public class Welcome1 {
// main method begins execution of Java application
public static void main( String args[] ) { System.out.println( "Welcome to Java Programming!" );
} // end method main
} // end class Welcome1
/**********************************************************(C) Copyright 1992-2003 by Deitel & Associates, Inc. and ** Prentice Hall. All Rights Reserved. ***********************************************************/