that's introduced for Students at Al-Azhar university Faculty of Engineering .
it talk about :
- what is programming .
- Java ?
- Data types .
- Operations .
- if condition
- loops
for any inquiries don't be hesitate to Contact me.
4. - What is Programming ??
Programming languages such as : C++ , C , Python ,
Java … [high . low].
Java Technology:
Programming Language
● As a programming language, Java can create all
kinds of applications that you could create using
any conventional programming language.
6. A computer can’t understand our language It’s just understand
Something called : Binary System 0 (s) & 1 (s) .
So we have something called Compiler {Transelator}
What is Compiler (translator from our language to Computer’s Language ..
)
JVM {java Virtual machine}.
What is JDK “java Development Kit ” ?
It’s include the Compiler , Interpreter and most tools that it’s necessary to
complier our code .
Also it’s include the libraries and classes which we going to use like “Scanner ,
System ” .
You can download it from .. Oracle.com
7. • Conversion from Decimal to binary :
For Example : 130 , 300 .
- From left to right >> with every sub process put 1 .
128
27
64
26
32
25
16
24
8
23
4
22
2
21
1
20
130 – 128 = 2
1
0 0 0 0 0 2 – 2 = 0
1
0
300 – 128 =
172 !!
8.
9. IDE’s {Editor’s}
Note pad & any word pad
The most Famous is “Net Beans & Eclipse”
10.
11.
12. How to create any Project ??
1. Press file >> New Project
2. Java Application
3. Project Name
4. Main class
Note : your file will be in your workspace …
14. Hello ,World “First Program”
System.out,println(x); just print the value of x ..
System.out.println(“x”) ; print litter x ..
Sout the Tab “Short cut ”
15. Println = print then make a new line .
Print = just print .
We can make a new Line also by n “inside quotes” .
We can make any operation in the printing statement .
such as : 1+2 ,, 1*5 ,, an so on .
- (your name) every part in separate line by using println and n .
- print something like that“1 + 5 =” 6 .
Your turn
17. Printf :
It’s a method for printing but it’s easier
For Example
Note the Difference :
18. %s >> it means you are going to Enter String Value .
%d >> means that you are going to Enter Decimal number .
%n = n >> to Make a new line ..
NOW LET’s Try ..
Welcome to
Java Programming!
5+5 = 10
Your turn
20. For right Number
Byte
Short
Int
Long
Decimal Number :
Float
Double
Character >> char
Boolean {true or false }
String …
Example .. Sum
Variables & identifiers .. : )
24. Comparison Operations
When you make any comparison you will need some of these Operands :
x == y , x >= y , x <= y , x > y , x < y .
Logic Operations : { && , || , ! }
25. Examples on if Condition and logic Operations
,,
Calculator again { + , - , * , % , / }
Fail & pass { if <50 : Fail ,, }
Comparison between two numbers x , y ;
Even or Odd
Absolute
number divisible by 5 or no ..
Comparison between three Numbers
Your turn
29. Imagine that you want to print your
name 50 times ..
System.out.println(“Ahmed Ayman ”);
System.out.println(“Ahmed Ayman ”);
System.out.println(“Ahmed Ayman ”);
System.out.println(“Ahmed Ayman ”);
System.out.println(“Ahmed Ayman ”);
System.out.println(“Ahmed Ayman ”);
System.out.println(“Ahmed Ayman ”);
System.out.println(“Ahmed Ayman ”);
…………………………….
30.
31. Loops !
FOR, NESTED LOOPS
FOR STRUCTURE
FOR(INT COUNTER = 1 ; COUNTER <= 50;COUNTER++) //+1
{
//CODE SUCH AS PRINT (“AHMED AYMAN”);
}
32. For Structure
for(INITIALIZATION ; CONDITION ; ITERATING STEP)
{
//Loop body
}
Examples
Print your Name 10 Times .. Try it
From 1 to 100 with printf .. And reverse it .
Numbers which can divide by 5 .
Multiplication table
المربع الازرق دا بيت واحد صاحبك و انت متفق معاه تقابله بعربييتك و تروحوا الكلية سوا و انت جاى مع اتجاه السهم .. بس لما وصلت عند البيت اتصلت بيه و لقيته لسا بيلبس و منزلش و المشكلة الأكبر إن الطريق حارة واحدة ومش هينفع تركن تستناه علشان متوقفش الشارع .. هتعمل ايه ؟!