8. Levels of Programming Languages:
High-level program
class Triangle {
...
float surface()
return b*h/2;
}
Low-level program
LOAD r1,b
LOAD r2,h
MUL r1,r2
DIV r1,#2
RET
Machine code
000100100100010100100100111011001010
1101001...
24. Strings
سلسلة:طباعتها سيتم التي األحرف من سلسلة.
بحرف وينتهي يبدأ"االقتباس."
اإلخراج في االقتباس عالمات تظهر ال.
Examples:
"hello" "This is a string. It's very long!"
القيود:
متعددة خطوط تمتد ال قد.
"This is not
a legal String."
الحرف على تحتوي ال قد."
"This is not a "legal" String either."
25. Escape sequences
escape sequence: A special sequence of characters used
to represent certain special characters in a string.
t tab character
n new line character
" quotation mark character
backslash character
Example: System.out.println("hellonhowtare
"you"?");
Output: hello how are "you"?
26. Questions
What is the output of the following
println statements?
System.out.println("tatbtc");
System.out.println("");
System.out.println("'");
System.out.println(""""");
System.out.println("C:ninthe
downward spiral");
Write a println statement to produce
this output:
//////