Fundamentals of Java Chapter 1: Background UNIT 1—GETTING STARTED WITH JAVA CHAPTER 1—BACKGROUND Objectives Give a brief history of computers. Describe how hardware and software make up computer architecture. Understand the binary representation of data and programs in computers. Discuss the evolution of programming languages. Describe the software development process. Discuss the fundamental concepts of object-oriented programming. Teaching Materials Student text PowerPoint presentation from the PowerPoint Presentations drop-down menu on the Instructor Resources CD Solutions to exercise questions, review questions, and programming projects from the Solutions to Exercises drop-down menu on the Instructor Resources CD ExamView test questions from the Test Bank & Test Engine drop-down menu on the Instructor Resources CD Prepare Focus students’ attention on the objectives for the chapter. Set up a projection system and show the PowerPoint presentation for the chapter, if desired. Prepare questions from ExamView. Lecture Notes and Teaching Tips Most students will probably have some information regarding the history of computers. One way to begin the discussion for this chapter is to ask them what they already know. An informal review of the vocabulary list, for example, is a good way to assess where students are at before starting the unit. One way to help students understand the concept of object-oriented programming (as well as how it differs from top-down design) and the components of programming is to separate students into groups of five. Assign one student the job of porter, two the job of pathfinder, and two the job of cook. Have them go through the analogy the author points out in this section. You could also extend this into another analogy of a small business. Students could play the role of manager, data entry individuals, and accounting specialists. Have them discuss the concepts of classes, methods, encapsulation, information hiding, polymorphism, and inheritance using this analogy. History of Computers 1 Fundamentals of Java Chapter 1: Background The history of computers is relatively recent. During the past 50 years or so, there has been immense progress made in technology and the world of computers. Primary developments include the miniaturization and integration of hardware components, the development of user interfaces that support easy access for beginners, and the linking of computers in various communications networks, such as the World Wide Web. Quick Quiz 1. True or False? Electronic digital computers were invented several hundred years ago. Answer: False 2. What kind of computer supports several users simultaneously while giving each person the illusion that he or she “owns” the computer? A. PC C. time-sharing computer B. hand-held calculator Answer: C Computer Hardware and Software The difference between hardware and software is an important aspect of this lesson. Students should have a broad understanding of hardware components and how they fit together. Students should also become familiar with system software, such as the computer’s operating system and the services it provides. It is important for them to understand that programmers modify software to add new services to a computer and rarely modify hardware. Quick Quiz 1. True or False? Secondary memory typically has a much greater storage capacity than primary memory. Answer: True 2. True or False? Word processors translate programs to executable form. Answer: False Binary Representation of Information and Computer Memory Students should understand how computers store information. Understanding how integers, floating-point numbers, characters, strings, images, and sound are digitized (and how memory in general works) is an essential aspect of computer fluency. It is helpful for students to run through a few examples of the binary, octal, and hexadecimal number systems and look at bit patterns for characters. A general discussion of the binary representation of images and sound can generate high interest among students. Quick Quiz 1. 8 bits represent __________ distinct values. Answer: fonts 2. Which of the following generally requires more bits to represent? A. integer C. image B. character D. sound Answer: D 2 Fundamentals of Java Chapter 1: Background Programming Languages Emphasize the distinction between expressing ideas in a form that people can understand and expressing ideas in a form that machines can represent and manipulate. Call attention to the fact that the first computers were programmed in languages that were very close in form to the languages of the machines and that programming languages have evolved to better approximate the languages that people use to express their ideas. Quick Quiz 1. Which of the following is an example of a high-level language? A. assembly language C. Java B. machine language Answer: C 2. A(n) __________ translates a program in a high-level language to machine code. Answer: compiler The Software Development Process Running through the software development process with students is helpful. These phases should be kept in mind throughout the entire course. Even with the most simplistic programs, developing the habits of this cycle will pay off for students. Students may want to talk to someone who is working in the field of computer programming at this point. Either having a guest speaker come to your classroom or assigning students to interview a programmer would be appropriate at this point. Quick Quiz 1. Which of the following is the most costly part of the software life cycle? A. design C. testing B. coding D. maintenance Answer: D 2. __________ is the part of the software development process wherein the programmers write the program code. Answer: Implementation Basic Concepts of Object-Oriented Programming One way of illustrating the difference between object-oriented programming and procedural programming is to separate the students into groups of five. Assign one student the job of porter, two the job of pathfinder, and two the job of cook. Have them go through the analogy the author points out in this section. You could also extend this into another analogy of a small business. Students could play the role of manager, data entry individuals, and accounting specialists. Have them discuss the concepts of classes, methods, encapsulation, information hiding, polymorphism, and inheritance using this analogy. Quick Quiz 1. Objects in an object-oriented system provide services by running __________. A. classes B. methods Answer: B 3 Fundamentals of Java Chapter 1: Background 2. A(n) __________ defines data resources and behavior for a set of objects. Answer: class Discussion Questions 1. Jack is confused about the difference between hardware and software. How would you explain that difference to him? 2. Describe how images can be represented by binary notation. Why do images require so many bits? 3. There is much more to the software development process than just coding a program in a particular programming language. Explain. Key Terms Application software: Programs that are designed for a specific use. Bit: A binary digit. Byte: A sequence of bits used to encode character in memory. Central processing unit (CPU): A major hardware component that consists of the arithmetic/logic unit and the control unit. Hardware: The actual computing machine and its support devices. Information hiding: A condition in which the user of a module does not know the details of how it is implemented, and the implementer of a module does not know the details of how it is used. Object-oriented programming: The construction of software systems that use objects. Primary memory: Memory contained in the computer (main memory). Secondary memory: An auxiliary device used to store memory, such as a disk or flash memory stick. Software: Programs that make the machine do something such as spreadsheets, word processors, or games. Software development life cycle: The process that a program goes through. It consists of the development, maintenance, and demise of a software system. The phases include analysis, design, coding, testing/verification, maintenance, and obsolescence. System software: The programs that allow users to write and execute other programs. For example, operating systems such as Unix, Linux, and MasOS. Ubiquitous computing: The presence of computers, which are often hidden, in many items used in everyday life. Waterfall model: A series of steps in which a software system trickles down from analysis to design to implementation. Projects to Assign In Project 1-1, students will discuss the different components of the computers that they are using in the classroom. In the Critical Thinking Activity, students will discuss the ethical and legal issues surrounding copyrighting. 4 Fundamentals of Java Chapter 1: Background Assess Administer the ExamView test for Chapter 1. 5