Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1 Chapter 2 Chapter 3 Code Gone Wrong Random 5 pt 5 pt 5 pt

Similar presentations


Presentation on theme: "Chapter 1 Chapter 2 Chapter 3 Code Gone Wrong Random 5 pt 5 pt 5 pt"— Presentation transcript:

1 Chapter 1 Chapter 2 Chapter 3 Code Gone Wrong Random 5 pt 5 pt 5 pt
Eleanor M. Savko Chapter 1 Chapter 2 Chapter 3 4/11/2017 Code Gone Wrong Random 5 pt 5 pt 5 pt 5 pt 5 pt 10 pt 10 pt 10 pt 10 pt 10 pt 15 pt 15 pt 15 pt 15 pt 15 pt 20 pt 20 pt 20 pt 20 pt 20 pt 25 pt 25 pt 25 pt 25 pt 25 pt

2 What is the difference between Application and System Software
What is the difference between Application and System Software? Give one example of each.

3 System: supports basic operations examples: operating system, compiler Application: accomplish specialized tasks examples: word processor, spreadsheet, etc

4 Convert to base 10:

5 57

6 What is the difference between ASCII and Unicode?

7 ASCII = 1 byte per character Unicode = 2 bytes per character

8 Which is oldest? (i) Assembly Language (ii) High-Level Language (iii) Machine Language

9 Machine Language

10 Name the stages of the Software Development Life Cycle (in order)

11 1) Customer Request 2) Analysis 3) Design 4) Implementation 5) Integration 6) Maintenance

12 What is the JVM, and what does it do?

13 Java Virtual Machine. It acts as an interpreter for the machine.

14 What is source code? What is byte code? What are their extensions?

15 Source Code: file written by programmer (
Source Code: file written by programmer (.java extension) Byte Code: created by compiler (.class extension)

16 Give an example of “storage” and an example of “memory”

17 Storage: hard drive, floppy, cd-rom, etc. Memory: RAM, ROM

18 Name three primitive data types.

19 int, double, boolean

20 Declare and instantiate an object of class KeyboardReader.

21 KeyboardReader reader = new KeyboardReader();

22 Declare three integer variables (a,b,c) in a single declaration and initialize b to 4.

23 int a, b=4, c;

24 What is wrong with this code. How can you fix it
What is wrong with this code? How can you fix it? int inches; inches = reader.readInt(); double feet = inches/12;

25 int/int = int Fixed with casting

26 String x = “number “ + 3 + 4; String y = “number “ + 3
String x = “number “ ; String y = “number “ + 3 * 4; String z = “number “ + (3 + 4);

27 x = “number 34” y = “number 12” z = “number 7”

28 What is the value of s2? int x = 8, y=10; String s1 = “hey”; x = x + y; String s2; s2 = x + y + s1 + x + y;

29 28hey1810

30 double z = 9. 0; int x=4, y=13; double a, b, c; a = y / x
double z = 9.0; int x=4, y=13; double a, b, c; a = y / x * z; b = (double) (y / x) * z; c = y % x / 3;

31 a = 27.0 b = 27.0 c = 0.0

32 Find the Syntax Error int x = 20, y = 15, z; double u=2. 1, v=33
Find the Syntax Error int x = 20, y = 15, z; double u=2.1, v=33.3; z = x/y; u = x; z = (int)(u/v); w = u + v; u = x/y*u*v;

33 w is not declared

34 Find the Syntax Error: int a=5, b=10, c=2; double d=2. 2, e=33
Find the Syntax Error: int a=5, b=10, c=2; double d=2.2, e=33.1; String s=“bob”; a = a/b; d = a/b; b = c/b + e; s = a + s + e;

35 b = c/b + e; double assigned to int

36 Find the Syntax Error: String one = “you”; String two = “smell”; String three = “funny”; String four; four = one + two + three; four = “four”+“four”+four; four = one + two + three + too!; four = two;

37 four = one + two + three + too!; String literal not in quotes!!!

38 Find the Syntax Error: int x =5, y=10, z; double a=1. 2, b=2, c=4
Find the Syntax Error: int x =5, y=10, z; double a=1.2, b=2, c=4.1; a = x/y; x = (int)c / b + y; a = (double)(x/y); c = c + y; z = (int)c / x;

39 x = (int)c / b + y; Assigning double into int variable!

40 Find the Syntax Error: int x =5, y=10, z; double a=1. 2, b=2, c=4
Find the Syntax Error: int x =5, y=10, z; double a=1.2, b=2, c=4.1; a = x/y; x = (int)(c / b) + y; a = (double)(x/y); c = c + z; z = (int)c / x;

41 c = c + z; z has not been initialized

42 double x =(double) (1/4) * 4; System.out.println(x);

43 0.0

44 Convert to Base

45 143

46 String blah = “I”; String blah2 = “Can”; String blah3 = “Program”; blah = blah + blah2; blah2 = blah; System.out.println(blah + “\n” + blah3 + “\n” + blah2 );

47 ICan Program ICan

48 Convert from hexadecimal to base 10: 59AF

49 22959

50 Which of the following expressions does NOT evaluate to 0. 4
Which of the following expressions does NOT evaluate to 0.4? (A)   (int)4.5 / (double)10; (B)   (double)(4/10); (C)   4.0 / 10.0; (D)   4 / 10.0; (E)    (double)4 / (double)10;

51 (B)   (double)(4/10);


Download ppt "Chapter 1 Chapter 2 Chapter 3 Code Gone Wrong Random 5 pt 5 pt 5 pt"

Similar presentations


Ads by Google