Presentation is loading. Please wait.

Presentation is loading. Please wait.

MCS 220: Concepts of Programming (focus on Object-Oriented Programming) Class Hour: Section 1: MWF 11:00AM - 11:50AM. Hyland 3202.

Similar presentations


Presentation on theme: "MCS 220: Concepts of Programming (focus on Object-Oriented Programming) Class Hour: Section 1: MWF 11:00AM - 11:50AM. Hyland 3202."— Presentation transcript:

1 MCS 220: Concepts of Programming (focus on Object-Oriented Programming) Class Hour: Section 1: MWF 11:00AM - 11:50AM. Hyland 3202

2 A little bit about the instructor Graduated from the University of Connecticut (05 Class), Ph.D in Computer Science and Engineering Bachelor of Science from Hanoi University of Technology (86-91) Master of Computer Science from UW-Milwaukee (96-99) Associate professor at UWW

3 A little bit about the instructor Research Experience: –User Modeling, Information Retrieval, Decision Theory, Collaborative Filtering, Human Factors Teaching Experience: –MCS 231, 220, COMPSCI 172, 173, 222, 181, 271,381 at UWW –Introductory courses at UOP and Devry –TA for Computer Architecture, OO Design, Compiler, Artificial Intelligence

4 Contact information nguyenh@uww.edu (fastest way to contact me) MG 106 Office Hours: 9am – 10:45am MWF, 9-10am online on skype (Tuesday) or by appointment 262 472 5170

5 Course Objectives Able to design a real-world application using Object-Oriented Design concepts Able to implement, write professional documentation, and conduct tests Be familiar with professional software development environment (strict deadlines, team work, high standard)

6 Technology Requirement J2SE Software Development Kit (SDK): ): http://www.oracle.com/technetwork/java/java se/downloads/index.html http://www.oracle.com/technetwork/java/java se/downloads/index.html Eclipse: : http://www.eclipse.org/downloads/http://www.eclipse.org/downloads/

7 Course detail - Topics Design, implement, document, testing a real world application Understand business Requirement and Design Implementation focusing On code reuse Documentation Testing

8 Course detail - Evaluation GRADABLEPOINTS Labs140 Mid term Exam160 6 Projects420 Final Exam200 HW/Quizzes80 Total1000

9 Grading (+/-)

10 Quiz and Homework Quiz is used to measure: - class attendance - class preparation Homework is used to measure: -Daily reading/practice -Class preparation Not all material will be covered in a 75-minute class –Book complements the lectures

11 Fall 06 grade distribution

12 Spring 07 grade distribution

13 Fall 07 Grade Distribution

14 Spring 11 Grade Distribution

15 Must-have for success Reading textbookPracticing (labs+projects)Devote time) ++ =

16 Must-have for success Time management: working at least 8 hours a week for this class. Can-do attitude: Reading/practicing/participating in class.

17 Getting started… Prerequisite: COMPSCI 172, What do we still remember or know about Java and Object-Oriented Design?

18 Assessment 1. Java is the only object-oriented programming language a. True b. False

19 Assessment 2. The differences between a constant and a variable in Java is: a. a data value for a variable can be changed and a data value for a constant can not be changed b. a data value for a constant can be changed and a data value for a variable can not be changed c. a data value for a constant sometimes can be changed and a data value for a variable sometimes can not be changed d. None of the above

20 Assessment 3. Which of the following statements about a do…while repetition statement is true? a. The body of a do…while loop is executed only if the terminating condition is true. b. The body of a do…while loop is executed only once. c. The body of a do…while loop is always executed at least once. d. None of the above

21 Assessment 4. Which of the following is the constructor of class ToughQuestion: a. public String ToughQuestion(String question) { ….} b. public ToughQuestion(String question) {…} c. public static void ToughQuestion(String question) {….} d. void ToughQuestion(String question) {….}

22 Assessment 5. Commands to compile and execute a java program are: a. run and java b. execute and javac c. javac and java d. compile and run

23 Assessment 6. What are the two ways that a Java array can be declared? a. [ ] ; ; b. [ ]; [ ] ; c. [ ] ; [ ] ; d. [ ] ; ; [ ]

24 Assessment 7. When would a programmer be forced to pick a linear search over a binary search? (assuming that we can’t do anything on the given array) a. When the items in the array are in ascending order b. When the items in the array are unsorted c. When the items in the array are in descending order d. None of the above

25 Assessment 8. Which of the following for-loop control results in equivalent numbers of iterations: A and B. C and D. A and B have equivalent iterations and C and D have equivalent iterations. None of the loops have equivalent iterations.

26 Assessment 9. What is the value of result after the following Java statements execute? int a, b, c, d, result; a = 4; b = 12; c = 37; d = 51; result = d + a * c + a % b + a; 207

27 Assessment 10. Which of the following group(s) does (do) NOT contain any object-oriented programming language: a. Visual Basic, C++ b. Pascal, C c. C++, Java d. Lisp, Fortran

28 Assessment 11. Using the File class, how would you open a file named “Jenny.data” that is stored in the directory, “C:\mystuff” (assuming that we are working with Windows Operating System)? a. File x = new File(“mystuff”,”Jenny.data”); b. File x = new File(“mystuff/Jenny.data”); c. File x = new File(“Jenny.data”, “C:\\mystuff”); d. File x = new File(“C:\\mystuff”, “Jenny.data”);

29 Assessment 12. Assume we want to write a program that calculates the sum of two numbers. Fill in the blank: public int getSum(int a, int b){ int sum = a + b; _____________ } a. return a;b. return; c. return sum; d. return getSum;

30 Assessment 13. public boolean Faculty( ) { id = “unknown”; return true; } 1.No return data type for constructors 2.No return statement allowed in a constructor

31 Assessment 14. What is wrong with this loop (semantically)? int product = 0, count=0; while (product == 0){ product /= 5; count ++; } 1.Endless loop. Product will be zero forever.

32 Assessment 15. Question15a and 15b 2

33 Class Focus Professional software development Strict deadlines, high standard, ridiculous demands (some times)

34 History Programming languages – Low level programming language: CPU instruction sets. – High level programming languages: Compiled (C/C++, Pascal) and interpreted language (Basic) Procedural (Pascal, C) and object oriented language (C++, Java)

35 A look at other languages FORTRAN –FORmula TRANslator COBOL –COmmon Business Oriented Language Pascal –Structured programming Ada –Multitasking

36 A look at other languages BASIC –Beginner’s All-Purpose Symbolic Instruction Code.NET –.NET platform Visual Basic.NET –Based on BASIC Visual C++ –Based on C++ C# –Based on C++ and Java

37 History of Java Java –Originally for intelligent consumer-electronic devices –Then used for creating Web pages with dynamic content –Now also used to: Develop large-scale enterprise applications Enhance WWW server functionality Provide applications for consumer devices (cell phones, etc.)

38 More stories… Oak: a reimplementation of C++ in the early 1990s by James Gosling et al. –Intended for intelligent consumer devices. Oak became Java in 1995. –Portability and Security of primary concern. –Eminently suitable for Web applets. –Also a powerful language in its own right.

39 Novelty from Software engineering perspective Software reuse: Avoid reinventing the wheel—use existing pieces wherever possible. This practice is central to object- oriented programming. –Classes and methods from class libraries. –Classes and methods you create yourself –Classes and methods that others create and make available to you.

40 Typical Java Development Environment Java programs normally undergo five phases –Edit Programmer writes program (and stores program on disk) –Compile Compiler creates bytecodes from program –Load Class loader stores bytecodes in memory –Verify Bytecode Verifier confirms bytecodes do not violate security restrictions –Execute JVM translates bytecodes into machine language

41 Example of UML

42 Portability Theory: Platform-independent dent (portability) –The JVM is an imaginary CPU with bytecode instructions. Java programs are translated to bytecodes by the Java compiler Practice: differences between compilers, JVMs and computers can make portability difficult to achieve. Simply writing programs in Java does not guarantee portability.

43 Testing Always test your Java programs on all systems on which you intend to run them, to ensure that they will work correctly for their intended audiences.

44 Introduction to Object Technology and the UML Unified Modeling Language (UML) –Graphical language that uses common notation –Allows developers to represent object-oriented designs

45 Introduction to Object Technology and the UML Unified Modeling Language (UML) –Graphical language that uses common notation –Allows developers to represent object-oriented designs Objects –Reusable software components that model real-world items –Look all around you People, animals, plants, cars, etc. –Attributes Size, shape, color, weight, etc. –Behaviors Babies cry, crawl, sleep, etc.

46 OOD and OOP Object-oriented design (OOD) –Models real-world objects –Models communication among objects –Encapsulates attributes and operations (behaviors) Information hiding Communication through well-defined interfaces Object-oriented language (OOP) –Programming in object-oriented languages is called object-oriented programming (OOP) –Example: C++, Java

47 OOD/A continues Object-Oriented Analysis and Design (OOA/D) –Essential for large programs –Analyze program requirements, then develop solution –UML Unified Modeling Language

48 UML History of the UML –Need developed for process with which to approach OOA/D –Brainchild of Booch, Rumbaugh and Jacobson –Object Management Group (OMG) supervised –Version 1.5 is current version Version 2 under development UML –Graphical representation scheme –Enables developers to model object-oriented systems –Flexible and extensible

49 Review Which of the following is a correct variable declaration statement? a. int x - float y; b. int x: float y; c. int x,y; d. Long int x;

50 Review Which of the following is a correct variable declaration statement? a. int x - float y; b. int x: float y; c. int x,y; d. Long int x;

51 Review Which of the following is not a Java keyword? a. do b. next c. while d. for

52 Review Which of the following is not a Java keyword? a. do b. next c. while d. for

53 Review Which of the following is not an error (either a syntax error or a logic error)? a. Neglecting to include an action in the body of a while statement that will eventually cause the condition to become false. b. Spelling a key word (such as while or if) with a capitalized first letter. c. Using a condition for a while statement that is initially false. d. An infinite loop.

54 Review Which of the following is not an error (either a syntax error or a logic error)? a. Neglecting to include an action in the body of a while statement that will eventually cause the condition to become false. b. Spelling a key word (such as while or if) with a capitalized first letter. c. Using a condition for a while statement that is initially false. d. An infinite loop.

55 Review int counter; counter = 1; while ( counter > 20 ) { // body of loop counter = counter + 1; } // end while a. 19. b. 20. c. 21. d. 0.

56 Review int counter; counter = 1; while ( counter > 20 ) { // body of loop counter = counter + 1; } // end while a. 19. b. 20. c. 21. d. 0.


Download ppt "MCS 220: Concepts of Programming (focus on Object-Oriented Programming) Class Hour: Section 1: MWF 11:00AM - 11:50AM. Hyland 3202."

Similar presentations


Ads by Google