Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 1020: Introduction to Computer Science I

Similar presentations


Presentation on theme: "CSE 1020: Introduction to Computer Science I"— Presentation transcript:

1 CSE 1020: Introduction to Computer Science I
Mark Shtern

2 Course Objective Developing development skills
Writing Java Multiclass application Introducing the software engineering concern Study UML, OOP, API

3 Example 01 Write application that calculates rectangle area

4 Example 02 Write application that calculates volume of rectangle couboid

5 Math & Computers Algebraic laws (a*b) /c is equal to a * (b/c)

6 Ex 1.16 What is program output? char grade= ‘B’;
System.out.print(grade); { grade = ‘C’; } System.out.println(grade);

7 Ex 1.17 Explain the compile-time error
long speed = 1; int size = 7; { boolean even = false; long speed = 5; size = 2; } int even = 3; System.out.println(speed); System.out.println(size); System.out.println(even);

8 Ex 1.17 What is output? long speed = 1; int size = 7; { boolean even = false; size = 2; } int even = 3; System.out.println(speed); System.out.println(size); System.out.println(even);

9 Summary Types Declaration Arithmetic Operations Casting Scope
+,-,/,* ,% (remainder) Casting Scope

10 Shortcuts a++  a=a+1 a  a=a-1 a+=6  a=a+6 a*=6 a=a*6

11 Literal Real Boolean Character 7D or 7d  7 is double
2.5E  2.5*10^3 or Boolean true or false Character ‘\t’ , ‘\n’, \’, ‘\\’,’\”’

12 Program Execution Edit Compile Run

13 Java Program Byte code Compile-time Errors VM CPU Byte code javac java
instruction

14 Ex 1.18 Is it true that expression a * b * c/d (1) is evaluated as

15 Ex 1.21 Explain the compile-time error int i = 6; long l = 4;
double d = 12; l = i + i; d = i + i; i = l + l; l = d + d;

16 Ex 1.22 Explain the compile-time error or predict its output
int x = 3; int y = 14; double pie = x + y / 100.0; int z = (5 % 4) + 6 / 8; System.out.println (pie); System.out.println(z);

17 Math & Computer sqrt(x^2) vs (sqrt(x))^2 (1/x) * x vs x * 1/x

18 Char Type What is output? char letter = ‘D’;
letter = (char) (letter +1); System.out.println(letter); char letter2 = ‘A’; System.out.println(letter2 - letter);


Download ppt "CSE 1020: Introduction to Computer Science I"

Similar presentations


Ads by Google