1.-Introduction-to-Computers-the-Internet-and-the.pptx
Document Details
Uploaded by CourageousMossAgate2513
Southern Luzon State University
Full Transcript
Introduction to Computers, the Internet and the Web Objectives In this chapter, you’ll learn: Basic computer concepts. The different types of programming languages. The history of the C programming language. The purpose of the C Standard Library. The basics...
Introduction to Computers, the Internet and the Web Objectives In this chapter, you’ll learn: Basic computer concepts. The different types of programming languages. The history of the C programming language. The purpose of the C Standard Library. The basics of object technology. A typical C program development environment. To test-drive a C application in Windows, Linux and Mac OS X. Some basics of the Internet and the World Wide Web. HARDWARE AND SOFTWARE Computer perform the calculations and make logical decision faster than humans. Computer consists of various devices referred to as hardware. Computer programs process the data under the control of sequences of instruction Computer programmer is the people who create a software program to guide the computer through ordered of actions. Moore’s law is an observation apply to the amount of memory, secondary storage, data, and processors speed that computer have for programs. COMPUTER ORGANIZATIONS INPUT UNIT Input Devices - the receiving section that obtains information and places it at the disposals of the other unit for processing. - receiving voice commands, scanning images and barcodes, reading from secondary storage device. Example: hard drives, DVD drives, Blue Ray Disc drives and Flash Drives, Web Camera. OUTPUT UNIT Output Devices - is the shipping section that takes information the computer process and make it available for use outside the computer. - Display on screen, printed on papers, audio, video, and giant screen display MEMORY UNIT - The memory unit is often called either memory, primary memory or RAM (Random Access Memory). - retains information that has been entered through the input unit, making it immediately available for processing when needed. - retains processed information until it can be placed on output devices by the output unit. Volatile memory - it’s typically lost when the computer’s power is turned off. GB stands for gigabytes; a gigabyte is approximately one billion bytes. MB stands for megabytes; a megabyte is approximately I million bytes. A byte is eight bits. A bit is either a 0 or a 1. Arithmetic and logic unit (ALU) - The section that performs calculations, such as addition, subtraction, multiplication and division. - It also contains the decision mechanisms that allow the computer, for example, to compare two items from the memory unit to determine whether they’re equal. - the ALU is implemented as part of the next logical unit, the CPU. Control Unit - that orchestrates the fetching (from memory), decoding and execution of instructions by directing the coordinated CENTRAL PROCESSING UNIT (CPU) - The “administrative” section coordinates and supervises the operation of the other sections. - The CPU tells the input unit when information should be read into the memory unit, tells the ALU when information from the memory unit should be used in calculations and tells the output unit when to send information from the memory unit to certain output devices. - Multi-Core Processor implements multiple processors on a single integrated-circuit chip Secondary storage unit - Programs or data not actively being used by the other units normally are placed on secondary storage devices (e.g., your hard drive) until they’re again needed, possibly hours, days, months or even years later. - Information on secondary storage devices is persistent—it’s preserved even when the computer’s power is turned off. - Secondary storage information takes much longer to access than information in primary memory, but it’s cost per unit is much less. - Examples of secondary storage devices include hard drives, DVD drives and USB flash drives, some of which can hold over 2 TB (TB stands for terabytes; a terabyte is approximately one trillion bytes). - Typical hard drives on desktop and notebook computers hold up to 2 TB, and some desktop hard drives can hold up to 6 TB. DATA HIERARCHY Data Hierarchy is a form of data items processed by computers that becomes larger and more complex in structure from the simplest data items called “bits”. Bits Bits is the smallest data item in a computer can assume the value 0 or the value 1. Binary Digit a digit that can assume one of two values Characters Character Set is the set of all the characters used to write programs and represent data items. - Computers process only 1s and 0s, so a computer’s character set represents every character as a pattern of 1s and 0s. - C supports various character sets (including Unicode®) that are composed of characters containing one, two or four bytes (8, 16 or 32 bits). - Unicode contains characters for many of the world’s languages. - ASCII (American Standard Code for Information Interchange) character set—the popular subset of Unicode that represents uppercase and lowercase letters, digits and some common special characters. Fields - Fields are composed of characters or bytes. - A field is a group of characters or bytes that conveys meaning. - For example, a field consisting of uppercase and lowercase letters can be used to represent a person’s name, and a field consisting of decimal digits could represent a person’s age. Records - Composed of several related fields can be used - In a payroll system, for example, the record for an employee might consist of the following fields (possible types for these fields are shown in parentheses): Employee identification number (a whole number) Name (a string of characters) Address (a string of characters) Hourly pay rate (a number with a decimal point) Year-to-date earnings (a number with a decimal point) Amount of taxes withheld (a number with a decimal point) - a record is a group of related fields. In the preceding example, all the fields belong to the same employee. A company might have many employees and a payroll record for each. Files - A file is a group of related records. - file contains arbitrary data in - a file is viewed simply as a sequence of bytes Database Database is a collection of data organized for easy access and manipulation. Relational database the data is stored in simple tables. Table - includes records and fields. For example, a table of students might include first name, lastname, major, year, student ID number and grade point average fields. Big Data Big data applications deal with massive amounts of data and this field is growing quickly, creating lots of opportunity for software developers. Figure: Byte Machine Languages, Assembly Languages and High- Level Languages Programmers write instructions in various programming languages, some directly understandable by computers and others requiring intermediate translation steps. Three General Types of Languages: 1. Machine languages 2. Assembly languages 3. High-level languages Machine Languages - Machine languages generally consist of strings of numbers (ultimately reduced to 1s and 0s) that instruct computers to perform their most elementary operations one at a time. - Machine languages are machine dependent (a particular machine language can be used on only one type of computer). - For example, here’s a section of an early machine-language payroll program that adds overtime pay to base pay and stores the result in gross pay: +1300042774 +1400593419 +1200274027 ASSEMBLY LANGUAGES AND ASSEMBLERS assembly languages are used by the programmers English like abbreviation to represent elementary operation assembly language is a type of low-level programming language that is intended to communicate directly with a computer's hardware. Assemblers is converting early assembly-language programs to machine language at computer speeds. The following section of an assembly-language payroll program also adds overtime pay to base pay and stores the result in gross pay: load basepay add overpay store grosspay HIGH-LEVEL LANGUAGES AND COMPILERS high-level languages were developed in which single statements could be written to accomplish substantial tasks. High-level languages allow to write instructions that look almost like every day English and contain commonly used mathematical notations. Compilers are converting high-level language programs into machine language. Example: A payroll program written in a high-level language might contain a single statement such as grossPay = basePay + overTimePay Interpreters Interpreter programs is developed to execute high- level language programs directly, avoid the delay of compilation, although they run slower than compiled programs. The C Programming Language C evolved from two previous languages, BCPL and B. BCPL was developed in 1967 by Martin Richards as a language for writing operating systems and compilers. Ken Thompson modeled many features in his B language after their counterparts in BCPL, and in 1970 he used B to create early versions of the UNIX operating system at Bell Laboratories. The C language was evolved from B by Dennis Ritchie at Bell Laboratories and was originally implemented in 1972. C initially became widely known as the development language of the UNIX Many of today’s leading operating systems are written in C and/or C++. C is mostly hardware independent—with careful design, it’s possible to write C programs that are portable to most computers. By the late 1970s, C had evolved into what’s now referred to as “traditional C.” The publication in 1978 of Kernighan and Ritchie’s book, The C Programming Language, drew wide attention to the language. This became one of the most successful computer science books of all time. C is Built for Performance Application Description Operating C’s portability and performance make it Systems desirable for implementing operating systems, such as Linux and portions of Microsoft’s Windows and Google’s Android. Apple’s OS X is built in Objective-C, which was derived from C. Embedded Embedded systems include navigation systems systems, smart home appliances, home security systems, smartphones, tablets, robots, intelligent traffic intersections and more. C is one of the most popular programming languages for developing embedded systems, Real-time Real-time systems are often used for “mission- systems critical” applications that require nearly instantaneous and predictable response times. Real-time systems need to work continuously—for example, an air-traffic-control system must constantly monitor the positions and velocities of the planes and report that information to air-traffic controllers without delay so that they can alert the planes to change course if there’s a possibility of a collision. Communication Communications systems need to route s systems massive amounts of data to their destinations quickly to ensure that things such as audio and video are delivered smoothly and without C-based programming languages. C++ was developed by Bjarne Stroustrup at Bell Laboratories. It has its roots in C, providing a number of features that “spruce up” the C language. Objects are essentially reusable software components that model items in the real world. Table of Popular C-based programming languages. Programming Description Language Objective C Objective-C is an object-oriented language based on C and developed in the early 1980s and later acquired by NeXT, which in turn was acquired by Apple. - the key programming language for the OS X operating system and all iOS- powered devices (such as iPods, iPhones and iPads). Java - Java a research project funded by Sun microsystems in 1991 resulted c++-based orbject-oriented programming. - Java is to enable the writing of programs that will run on a broad variety of computer systems and computer-controlled devices. - This is sometimes called “write once, run anywhere.” Java is used to develop large-scale enterprise applications, to enhance the functionality of web servers (the computers that provide the content we see in our web browsers), to provide applications for consumer devices (smartphones, television set-top boxes and more) and for many other C# - Microsoft’s three primary object-oriented programming languages are Visual Basic (based on the original Basic), Visual C++ (based on C+ +) and - Visual C# is developed based on C++ and Java, and C# to integrate the Internet and the web into computer applications PHP - PHP, an object-oriented, open-source scripting language supported by a community of users and developers, is used by millions of websites. - PHP is platform independent—implementations exist for all major UNIX, Linux, Mac and Windows operating systems. PHP also supports many databases, including the popular open- Python - Python, another object-oriented scripting language, was released publicly in 1991. - Developed by Guido van Rossum of the National Research Institute for Mathematics and Computer Science in Amsterdam (CWI), Python draws heavily from Modula-3—a systems programming language. - Python is “extensible”— it can be extended through classes and programming interfaces. JavaScri JavaScript is the most widely used scripting pt language. It’s primarily used to add dynamic behavior to web pages—for example, animations and improved interactivity with the user. It’s provided with all major web browsers. Swift Swift, Apple’s new programming language for developing iOS and Mac apps, was announced at the Apple World Wide Developer Conference (WWDC) in June 2014. Although apps can still be developed and maintained with Objective-C, Swift is Apple’s app-development language of the future. It’s a modern language that eliminates some of the complexity of Objective-C, making it easier for beginners and those transitioning from other high-level languages such as Java, C#, C++ and C. Swift emphasizes performance and Typical C Program-Development Environment Phase 1: Creating a Program This is accomplished with an editor program. - Two editors widely used on Linux systems are vi and emacs. - Software packages for the C/C++ integrated program development environments such as Eclipse and Microsoft Visual Studio have editors that are integrated into the programming environment. Phases 2 and 3: Preprocessing and Compiling a C Program The compiler translates the C program into machine- language code (also referred to as object code). a preprocessor program executes automatically before the compiler’s translation phase begins. preprocessor directives indicate that certain manipulations are to be performed on the program before compilation. - These manipulations usually consist of including other files in the file to be compiled and performing various text replacements. The most common preprocessor directives are discussed in the early chapters. A syntax error occurs when the compiler cannot recognize a statement because it violates the rules of the language. - Syntax errors are also called compile errors, or compile-time errors. The compiler issues an error message to help you locate and fix the incorrect statement. Phase 4: Linking A linker links the object code with the code for the missing functions to produce an executable image (with no missing pieces). On a typical Linux system, the command to compile and link a program is called gcc Phase 5: Loading loader the executable image from disk and transfers it to memory. Additional components from shared libraries that support the program are also loaded. Phase 6: Execution executes the program one instruction at a time. Standard Input, Standard Output and Standard Error Streams Most C programs input and/or output data. Certain C functions take their input from stdin (the standard input stream), which is normally the keyboard, but stdin can be redirected to another stream. Data is often output to stdout (the standard output stream),which is normally the computer screen, but stdout can be redirected to another stream. Standard error stream referred to as stderr. The stderr stream (normally connected to the screen) is used for displaying error messages. It’s common to route regular output data, i.e., stdout, to a device other than the screen while keeping stderr assigned to the screen so that the user can be immediately informed of errors. OPERATING SYSTEMS Operating systems are software systems that make using computers more convenient for users, application developers and system administrators. - They provide services that allow each application to execute safely, efficiently and concurrently (i.e., in parallel) with other applications. kernel a software that contains the core components of the operating systems. - Popular desktop operating systems include Linux, Windows and Mac OS X. Windows—A Proprietary Operating System In the mid-1980s, Microsoft developed the Windows operating system, consisting of a graphical user interface built on top of DOS. - Windows borrowed many concepts (such as icons, menus and windows) popularized by early Apple Macintosh operating systems and originally developed by Xerox PARC. Windows 8.1 is Microsoft’s latest operating system—its features include PC and tablet support, a tiles-based user interface, security enhancements, touch-screen and multi-touch support, and more. - Windows is a proprietary operating system—it’s controlled by Microsoft exclusively. It’s by far the world’s most widely used operating system. Apple’s Mac OS X; Apple’s iOS for iPhone®, iPad® and iPod Touch® Devices - Apple, founded in 1976 by Steve Jobs and Steve Wozniak, quickly became a leader in personal computing. - In 1979, Jobs and several Apple employees visited Xerox PARC (Palo Alto Research Center) to learn about Xerox’s desktop computer that featured a graphical user interface (GUI). That GUI served as the inspiration for the Apple Macintosh, launched with much fanfare in a memorable Super Bowl ad in 1984. - The Objective-C programming language, created by Brad Cox and Tom Love at Stepstone in the early 1980s, added capabilities for object-oriented programming (OOP) to the C programming language. - Steve Jobs left Apple in 1985 and founded NeXT Inc. In 1988, NeXT licensed Objective-C from StepStone and developed an Objective-C compiler and libraries which were used as the platform for the NeXTSTEP operating system’s user interface and Interface Builder—used to construct graphical user interfaces. - Jobs returned to Apple in 1996 when Apple bought NeXT. Apple’s Mac OS X operating system is a descendant of NeXTSTEP. - Apple’s proprietary operating system, iOS, is derived from Apple’s Mac OS X and is used in the iPhone, iPad and iPod Touch devices. Google’s Android - Android—the fastest growing tablet and smartphone operating system—is based on the Linux kernel and Java as its primary programming language. One benefit of developing Android apps is the openness of the platform. - The operating system is open source and free. The Android operating system was developed by Android, Inc., which was acquired by Google in 2005. In 2007, the Open Handset Alliance™ —which has 87 company members worldwide—was formed to develop, maintain and evolve Android, driving innovation in mobile technology and improving the user experience while reducing costs. - As of April 2013, more than 1.5 million Android devices (smartphones, tablets, etc.) were being activated worldwide daily.Android devices now include smartphones, tablets, e-readers, robots, jet engines, NASA satellites, game consoles, refrigerators, televisions, cameras, health-care devices, smartwatches, automobile in-vehicle infotainment systems (for controlling the radio, GPS, phone calls, thermo tat, etc.) and more. - Android also executes on desktop and notebook computers. The Internet and World Wide Web - In the late 1960s, ARPA—the Advanced Research Projects Agency of the United States Department of Defense— rolled out plans for networking the main computer systems of approximately a dozen ARPA-funded universities and research institutions. - The computers were to be connected with communications lines operating at speeds on the order of 50,000 bits per second, a stunning rate at a time when most people (of the few who even had networking access) were connecting over telephone lines to computers at a rate of 110 bits per second. Academic research was about to take a giant leap - ARPA proceeded to implement what quickly became known as the ARPANET, the precursor to today’s Internet. Today’s fastest Internet speeds are on the order of billions of bits per second with trillion-bits-per-second speeds on the horizon! - Although the ARPANET enabled researchers to network their computers, its main benefit proved to be the capability for quick and easy communication via what came to be known as electronic mail (email). - The protocol (set of rules) for communicating over the ARPANET became known as the Transmission Control Protocol (TCP). TCP ensured that messages, consisting of sequentially numbered pieces called packets, were properly The Internet: A Network of Networks - In parallel with the early evolution of the Internet, organizations worldwide were implementing their own networks for both intra organization (that is, within an organization) and inter organization (that is, between organizations) communication. - A huge variety of networking hardware and software appeared. One challenge was to enable these different networks to communicate with each other. - ARPA accomplished this by developing the Internet Protocol (IP), which created a true “network of networks,” the current architecture of the Internet. The combined set of protocols is now called TCP/IP. bandwidth—the information-carrying capacity of communications lines—on the Internet has increased tremendously, while hardware costs have plummeted. The World Wide Web: Making the Internet User- Friendly - The World Wide Web (simply called “the web”) is a collection of hardware and software associated with the Internet that allows computer users to locate and view multimediabased documents (documents with various combinations of text, graphics, animations, audios and videos) on almost any subject. - In 1989, Tim Berners-Lee of CERN (the European Organization for Nuclear Research) began to develop a technology for sharing information via “hyperlinked” text documents. Berners-Lee called his invention the HyperText Markup Language (HTML). He also wrote communication protocols such as HyperText Transfer Protocol (HTTP) to form the - In 1994, Berners-Lee founded an organization, called the World Wide Web Consortium (W3C, http://www.w3.org), devoted to developing web technologies. One of the W3C’s primary goals is to make the web universally accessible to everyone regardless of disabilities, language or culture. Web Services - Web services are software components stored on one computer that can be accessed by an app (or other software component) on another computer over the Internet. - With web services, you can create mashups, which enable you to rapidly develop apps by combining complementary web services, often from multiple organizations and possibly other forms of information feeds. For example, 100 Destinations ( http://www.100destinations.co.uk) combines the photos and tweets from Twitter with the mapping capabilities of Google Maps to allow you to explore countries around the world through the photos of others. Ajax - technology helps Internet-based applications perform like desktop applications—a difficult task, given that such applications suffer transmission delays as data is shuttled back and forth between your computer and server computers on the Internet. Using Ajax, applications like Google Maps have achieved excellent performance and approach the look- and-feel of desktop applications. The Internet of Things - A thing is any object with an IP address and the ability to send data automatically over the Internet— e.g., a car with a transponder for paying tolls, a heart monitor implanted in a human, a smart meter that reports energy usage, mobile apps that can track your movement and location, and smart Some Key Software Terminology Agile software development - is a set of methodologies that try to get software implemented faster and using fewer resources. Refactoring - involves reworking programs to make them clearer and easier to maintain while preserving their correctness and functionality. - It’s widely employed with agile development methodologies. Many IDEs contain built-in refactoring tools to do major portions of the reworking automatically Design patterns - are proven architectures for constructing flexible and maintainable object-oriented software. The field of design patterns tries to enumerate those recurring patterns, encouraging software designers to reuse them to develop better-quality software using less time, money and effort. LAMP - is an acronym for the open-source technologies that many developers use to build web applications inexpensively—it stands for Linux, Apache, MySQL and PHP (or Perl or Python—two other popular scripting languages). - MySQL is an open-source database-management system. PHP is the most popular open-source server- side “scripting” language for developing web applications. Apache is the most popular web server software. - The equivalent for Windows development is WAMP— Windows, Apache, MySQL and PHP. Software as a Service (SaaS) - the software runs on servers elsewhere on the Internet. When that server is updated, all clients worldwide see the new capabilities—no local installation is needed. You access the service through a browser. - Browsers are quite portable, so you can run the same applications on a wide variety of computers from anywhere in the world. Salesforce.com, Google, and Microsoft’s Office Live and Windows Live all offer SaaS. Platform as a Service (PaaS) - provides a computing platform for developing and running applications as a service over the web, rather than installing the tools on your computer. Some PaaS providers are Google App Engine, Amazon EC2 and Windows Azure™. Cloud computing SaaS and PaaS are examples of cloud computing. - You can use software and data stored in the “cloud”—i.e., accessed on remote computers (or servers) via the Internet and available on demand—rather than having it stored locally on your desktop, notebook computer or mobile device. - This allows you to increase or decrease computing resources to meet your needs at any given time, which is more cost effective than purchasing hardware to provide enough storage and processing power to meet occasional peak demands. - Cloud computing also saves money by shifting to the service provider the burden of managing these apps (such as installing and upgrading the software, security, backups and disaster recovery). Software Development Kit (SDK) - include the tools and documentation developers use to program applications. Software product-release terminology Alpha software - is the earliest release of a software product that’s still under active development. Alpha versions are often buggy, incomplete and unstable and are released to a relatively small number of developers for testing new features, getting early feedback, etc. Beta versions - are released to a larger number of developers later in the development process after most major bugs have been fixed and new features are nearly complete. Beta software is more stable, but still subject to change. Release candidates - are generally feature complete, (mostly) bug free and ready for use by the community, which provides a diverse testing environment— the software is used on different systems, with varying constraints and for a variety of purposes. Final release - Any bugs that appear in the release candidate are corrected, and eventually the final product is released to the general public. Software companies often distribute incremental updates over the Internet. Continuous beta - Software that’s developed using this approach (for example, Google search or Gmail) generally does not have version numbers. It’s hosted in the cloud (not installed on your computer) and is constantly evolving so that users always have the latest version.