ALL THEORY 2 PDF - Systems in Organizations

Summary

This document provides an overview of systems in organizations, encompassing the system life cycle, planning, and installation processes. It details various aspects of integration strategies, change management techniques, and different testing methodologies. Concepts relating to legacy systems, software incompatibility, and different forms of delivering user documentation are addressed as well.

Full Transcript

1.1.1 – 1.1.6 System life cycle – stages through which the development of a new system passes through - Most systems begin with the analysis stage and continue with the design à sometimes it might be necessary to return to an earlier stage SYSTEMS IN ORGANI...

1.1.1 – 1.1.6 System life cycle – stages through which the development of a new system passes through - Most systems begin with the analysis stage and continue with the design à sometimes it might be necessary to return to an earlier stage SYSTEMS IN ORGANIZATIONS PLANING AND SYSTEM INSTALATION - New system is created in order to replace a system that is inefficient, no longer suitable, redundant or out-dated - Purpose of a new system is to increase productivity or quality, minimize costs - New system should reduce the errors or flaws of the existing one - Development of most huge systems – huge amount of time, effort, contains a lot of different stages - Computer system includes hardware, software, people and the immediate environment - Updating may involve training employees, changing the physical location of a server, firing employees - Planning should anticipate potential organizational issues such as lack of: § Guiding organizational and business strategies § Stakeholder and end-user participation § End-user ownership of system § Attention to required training § Various organizational issues, such as organizational culture § Attention to the design of tasks and jobs, allocation of information system tasks, and the overall usability of the system - Feasibility study evalutes and analyses a project and its potential T Technical feasibility E Economic feasibility L Legal feasibility O Operational feasibility S Schedule feasibility - Change management – various parameters, process of shifting individuals, teams, departments, and organizations à WHAT TO DO TO CHANGE MANAGEMENT - Successful change management guarantees that all stakeholders accept and embrace changes in their working environments - The goal – maximize benefits, minimize the negative impacts of change on individuals - Legacy system – old technology, hardware, computer system, or application program - Legacy system may still be in use because its data cannot be converted to newer formats - For example, NASA still uses legacy system because the system still provides for the users’ needs - Business merger – combination of two or more businesses entities - Main reason to merge is to reduce costs - Four strategies for integration o Keep both information systems, and develop them to have the same functionality (high maintenance cost) o Replace both information system with new ones (increased cost) o Select the best information system from each company and combine them o Select one company’s information system and drop the other companies’ - Language differences greatly increase communication problems - Software incompatibility – situation where different software entities or systems cannot operate satisfactorily, cooperatively, or independently, on the same computer, or on different computers linked by a local or wide area computer network à Some apps work only on Mac and dont work on Microsoft - Business software can operate o Installed on a client’s infrastructure and premises o Hosted on dedicated servers that belong to a company that provides such servers - Locally hosted system –for larger and complex systems - Remotely hosted system – there is no necessary hardware equipment or where the administration wishes to outsource responsibilities for maintenance, support, backups, security... SaaS (Software-as-a-Service) or „on demand software“ - contemporary delivery method, allows software and data to be hosted and managed centrally on a remote data center - Users pay to access the services provided on a subscription basis - Solutions reside on the cloud - Need a web browser and a broadband Internet connection - Low initial cast and requires few investments in installation, maintenance and updating - Provides a scalable solution, since a company has only to adjust its monthly SaaS subscription - Supported by a wide range of desktop, portable and mobile services - Requires few IT personnel and all software updates take place far away from company’s premises - Considered a safe solution – applications and data reside in the cloud service - There is a possibility of data loss, if a SaaS provider goes out of business - Installation of a new system – during this process the old system will be retired and new system will take its place - Implementation method (conversion, changeover) – one critical decision when moving from an old system to a new one - Changeover – putting the new system online and retiring the old one TYPES OF CHANGEOVERS Parallel - The new system is started, but the old system is kept running alongside it - data has to be entered into both systems - Advantages: if the new system fails, the old systems runs a backup (no loss of productivity); outputs from the two systems can be compared to see if new one is running correctly - Disadvantage: running two systems is costly in terms of time and money Big Bang or Direct (immediate) - Old system is stopped and new system is started - Advantages: minimal time and effort, new system is available immediately - Disadvantage: if the new system fails, there is no fall back Pilot - The new system is piloted (tested) with a small subset of the organization, once it is running correctly and all bugs have been ironed out, it is implemented across the whole organization - Advantages: all features are fully trialed; if the new system fails, only a small part of the organization suffers; staff who were part of the pilot can train other staff - Disadvantage: for the subset of users in the pilot group, there is no backup if the new system fails Phased - The new system is introduced in phases as parts of the old system are gradually replaced with the new system - Advantages: allows people to get used to the new system; training of staff can be done in stages - Disadvantage: if the new system fails, there is no fall back for that part of the system - Data migration – transfer of data between different formats, storage types and computer systems - Usually takes place in an automatic manner so as to achieve efficient use of human resources - This happens when an organization changes, updates, or merges its information systems - Many problems may arise: Incapability of moving the information due to parameters such as incompatibility with the new system or non-recognizable data structures Data may be lost or not transferred due to incomplete data transfer data structures Data can also be misinterpreted due to incompatibilities, caused by the different conventions of each country concerning date, time, and measurements units 1.1.7 Various types of tesOng - can happen in different ways/phases - TYPES à data tes\ng, alpha tes\ng, beta tes\ng, dry-run tes\ng, unit tes\ng, integra\on tes\ng, user acceptance tes\ng, debugging - FuncOonal tesOng tests individual commands, text input, menu func\ons, etc. Confirms that they perform and func\on correctly according to the design specifica\ons - Data testing is when normal, abnormal, and extreme data is put into the system. Suppose that there is a program that accepts a student’s percentage in a math exam and gives a “pass” message if the number entered is greater than or equal to sixty; otherwise, it prints a ”fail” message. - Alpha testing is done before the software product is made available to the general public, normally, Alpha testing will be carried out by the company that develops the software - Beta testing includes comments and suggestions of users outside the company - Dry-run testing is conducted using pen—and—paper by the programmer, he examines the source code and determines what the output of a run should be - During unit testing, individual parts of the system are tested separately - During the integration testing, the entire system is tested at the same time to verify that all components can work together - User acceptance testing is used to determine if the system satisfies the customer's needs and in most cases is conducted on user premises before accepting transfer of ownership - Debugging is a systematic process of finding and correcting the number of bugs (errors) in a computer program VALIDATION AND VERIFICATION TO DATA INPUT - A way of ensuring data verification is through double entry VERIFICATION VS. VALIDATION SOFTWARE TESTING - Verifica\on is the confirma\on that a computer product meets iden\fied specifica\ons, - valida\on is the confirma\on that a computer product meets its design func\on or is appropriate for the intended use. VERIFICATION: Are we developing the system correctly? VALIDATION: Are we developing the correct system? VERIFICATION: Does the product comply with a specific regula\on or condi\on? VALIDATION: Does the product meet the costumer-needs? 1.1.8 Importance of user documenta\on - as programs/systems develop, they can become to complex for the user or rather there could be a conflict of interest between him and the developer - this is easily countered by proper external documentation (user manual) - External documentation is typically written as a separate document from the program itself, it is provided through various types of user-supporting documents such as a users' guide, software requirements specification document etc. - Internal documentation is the code comprehension features and details provided as part of the source code itself. PROPER INTERNAL DOCUMENTS INCLUDES: Appropriate module headers Appropriate comments Useful and meaning variable name Useful module, classes, methods and func\on headers Appropriate code indenta\on Appropriate code structuring Appropriate use of enumerated types Appropriate use of constant iden\fiers Appropriate use of data types defined by the user 1.1.9 Different methods of providing user documenta\on - User documentation can either be in a written or in an online form - Manuals can be provided online or offline, One of the advantages of online manuals is the potential use of multimedia features, they can also be printed & the advantage of a printed - manual is that it can be read without the use of a PC or an internet connection - Email support is a form of Online support, it is an asynchronous type of support and can be provided via an email address. Users contact the support team of the company to resolve any problems with the help of specialized technicians - Embedded Assistance or integrated user assistance, one example is when the user hovers the mouse over an icon 3 small text box appears with valuable help information. This kind of assistance is considered an excellent way to increase the usability of a software application. Embedded user assistance is context specific & task-specific - FAQ’S are listed questions and answers, all supposed to give users answers to a common set of problems and pertaining to a particular topic, commonly listed on an online forum - Live chat sessions are a type of real-time support that is extremely useful for emergency situations. A live chat technician will ask for the description of the occurring problem, and try to present a list of possible solutions, it can be done by phone call, live chat, or video call - Online portals/web portals can provide updated manuals, support pages, and FAQ pages - Remote desktop connections are a function that enables a specialized person to connect to the user’s PC across the Internet from virtually any computer. Remote Desktop will actually allow a specialized technician to take control of the user's PC as though he/she/she was sitting directly in front of it 1.1.10 Different methods of delivering user training - Self instruction/self-study - allows the user to learn in his/her own time, until he/she achieves mastery of the subject. Printed manuals, books, e-books or other resources such as video tutorials or online exercises can be used. Advantages: no tuition fee, your own time schedule, Disadvantages: lack of guidance - Formal classes - offer an interactive setting that promotes open and free discussion between students and the teacher (instructor), Advantages: direct communication, no technical barrier, exchange of ideas between students, Disadvantages: shy students may do worse - Remote/online training - allows participants to take part in high-quality courses from anywhere in the world provided they have a PC and Internet connection, it is accessible 24/7/365, Time efficiency and time management are valuable strengths of distance learning, some disadvantages can include a person not being skilled enough in technicalities or not having a PC SYSTEM BACKUP 1.1.11 Causes of data loss - Data loss is an error condition in which data is lost/destroyed due to a number of reasons - Causes & solutions: 1. Accidental deletion – recovery file software, 2. Administrative errors – need for care, 3. Poor data storage – restructure data organization, 4. Building fires – store data in more locations, 5. Closing program without saving the file – use of autosave features, 6. Comp. viruses – antivirus software, backups, 7. Continued use after signs of failure – Self- monitoring and regular backups, 8. Data corruption/errors in computer data – regular backups, 9. Firmware corruption – regular backups, 10. Natural disasters – store data in more locations & regular backups, 11. Outsider interfering – regular backups & need for a firewall & authentication methods, 12. Physical damage – regular backups, need for care, 13. Power failure – need for UPS (uninterruptible power supply) and regular backups 1.1.12 Consequences of data loss in a specified situation - e.g. medical records of a patient are lost, now his life is in jeopardy - in most cases, it is not this serious, but there are exceptions - e.g. a client books a hotel room online, and upon arriving the receptionist informs him there is no record of him booking it, now he potentially has to sleep outside or find a new hotel 1.1.13 Range of methods that can be used in preventing data loss - In order to prevent data loss, precautions such as these can be taken: *regular backup of files - *firewall installation - *data storage in two or more locations - * removed hard copies (printed versions of data) - *installation of an Antivirus program - *human error reduction/failsafe - *online auto save backup (iCloud, Dropbox) - Redundancy is the duplication of storage devices & stored data of a company system which intends to secure the stored data à failsafe system - for fast data backup or data storage, some commonly used things are: Diskettes, Blu-ray discs, CDs, DVDs, USB, they are also non-volatile - Failover system is a computer system which is on standby capable of switching to a spare computer system upon hardware failure, network failure, or any other type of error, such as software malfunction - Main difference between it and a switchover system is the amount of needed human intervention - Failover is usually automatic and requires little to no human care, when primary server fails the standby server is made primary - in a switchover system the primary & secondary system interchange their role 1.1.14 Strategies for managing releases and updates - aim of updates is to improve the product or just perform minor changes - from SMALLEST to BIGGEST changes: patches, updates, upgrades, releases - PATCHES - updating applications by fixing known bugs/vulnerabilities - UPDATES – adding new functionalities or fixing known bugs, free in most cases - UPGRADES – contain novel functionalities or characteristics as well as cumulative bug fixes - RELEASES – final, working versions of software applications 1.2.1 - COMPUTER HARDWARE: The physical elements of a computer à screen, CPU,… - COMPUTER SOFTWARE: A series of instruc\ons that can be understood by a CPU à these instruc\ons guide the CPU to perform specific opera\on - PERIPHERAL DEVICE: any auxiliary device that can communicate and work with a computer à printer - COMPUTER NETWORK: A set of computer systems that are interconnected and share resources, as well as data. 1.2.2 - The computer can assume several roles in networked world à as a client, server, e-mail server, domain name system server - A DUMB TERMINAL is a device that usually consists of a keyboard, a monitor, and a network card that is connected to a server or a powerful computer à depend en\rely on the computer - A THIN CLIENT is a rela\vely low performance terminal, which heavily but not en\rely, depends on the server to which it is connected - A CLIENT recives data via the network, whereas the SERVER has saved data on it and offers it to clients - AN EMAIL SERVER is the equivalent of a post office that manages the flow of email in and out of the network, checks that an email address is valid, allows users to access their email - A ROUTER is a networking device that accepts incoming quanta of informa\ons, reads their des\na\on address, and distributes them across networks, according to a rou\ng table or rou\ng policy à iden\fies the des\na\on of messages and sends them via appropriate route - A DOMAIN NAME SYSTEM SERVER asributes names to network addresses and therefore resolves names by assigning them to the appropriate network en\ty - A FIREWALL is a hardware or sotware network infrastructure that controls data flow access among network en\\es à used to offer protec\on and limit access to a network - A CLIENT-SERVER refers to a sotware network architecture system where clients request informa\on and servers perform tasks in order to provide the informa\on 1.2.3 IT SUBJECTS OF SOCIAL AND ETHICAL SIGNIFICANCE ARE: - Reliability – refers to how well an IT system func\ons. - computer failures cause data loss, \me loss, money loss, injury or even death - Integrity – refers to protec\ng the completeness and accuracy of data - data lacks integrity if it is incomplete, out of date, or has been purposely or uninten\onally altered - Inconsistency – problems may also arise if informa\on is duplicated in a database and only one copy is updated, causing inconsistency (e.g. telephone field) - Security - refers to the protec\on of hardware, sotware, peripherals, and computer networks from unauthorized access - Privacy – the ability to control how and to what extent data is used and disseminated to others - Anonymity – privacy becomes anonymity when, for instance, an individual uses an IT system to conceal his/her true iden\ty in order to cyber-bully another person, commit illegal ac\ons or crimes, hack a computer, … - Intellectual property – refers to ideas, discoveries, scien\fic endeavors, photographs, films, essays, and art work - The Digital Divide and Equality of Access – the growth and the use of IT systems have not developed at the same rate for everybody in all parts of the world, or in all areas of the same country - Surveillance – involves using IT to monitor individuals or groups of people either with or without(also a privacy issue) their knowledge or permission à governments,… - GlobalizaOon and Cultural Diversity – IT helps to diminish the importance of geographical, poli\cal, economic and cultural boundaries while speeding up the global spread of poli\cal, financial, sport and cultural news - IT Policies – policies are enforceable procedures and measures that promote the appropriate use of computers, networks, informa\on systems and tehnologies - Standards and Protocols – predefined technical rules and conven\ons that developers of hardware and sotware should follow à GIF, USB,… - People and machines – internet addic\on is a social impact - the use of AI military or law-enforcement situa\ons is also an issue of social concern - analyzes all aspects of the interac\on between IT and humans - Digital CiOzenship – which covers appropriate behavior in a digital world - Appropriate behavior includes using IT ethically, in a way that respects society, the law and does not expose any person to threats, danger, … 1.2.4 - Stakeholders – individuals, teams, groups or organiza\ons that have an interest in the realiza\on of a project or might be affected by the outcome of a project - The end-user – person who is going to use the product 1.2.6 - EXAMINING CURRENT SYSTEMS is a process that involves the detailed examina\on of the current system, analysis its func\ons and procedures, studying the business and system documents such as current order documents, logis\cs documents, and computer systems procedures and reports used by opera\ons and senior managers - LITERATURE SEARCH refers to the iden\fica\on, retrieval, and management of various sources in order to find informa\on on a topic - Modern informaOon systems should be planned to: Increase client trust Preserve brand strength Preserve organiza\on reputa\on Maintain corporate resiliency Enhance organiza\onal piece 1.2.9 - ITERATION refers to the repe\\on of a set of Instruc\ons for a specific number of \mes or un\l the opera\ons yield a desired result - It’s impossible to design a system or sotware that has no ini\al func\onal or usability problems 1.2.10 - For system to be successful, the analysis and the design must involve all key stakeholders including the client and the end users - Involvement, collaboraOon and acOve parOcipaOon à cri\cal because a project with poorly- defined stakeholder goals is unlikely to be successful - The developed system either solve a different problem or deal with issues that are outside of the project’s scope 1.2.12. Usability - Accessibility – potential of service, product, device or environment to serve and meet the needs of as many individuals as possible. High accessibility – many individuals - Usability – potential of a product, application, or website to accomplish user goals - Ergonomics or human engineering – design of safe and comfortable products, systems or processes, specifically for people 1.2.13. Usability problems with commonly used digital devices - 8 quality components of usability: Complexity/simplicity, effectiveness, efficiency, error, learnability, memorability, readability, satisfaction - Some usability problems: mobile phone – small keyboard, too many features for some users. PC – excessive keyboard use may cause RSI, large screens cause eye problems, mouse hard to use for left-handed users.... 1.2.14. Methods that can be used to improve the accessibility of systems - Impairment – a loss or abnormality of physiological, or anatomical structure of function - Disability – any restriction or lack (resulting from an impairment) of the ability to perform an activity in the manner or within range considered normal for a human being Aspects to consider when evaluating the accessibility of an IT system: 1. Visual impairment – blindness and color vision. Solutions: braille input devices, touch type, speech output devices, braille display, changing colors 2. Hearing and speech – Solutions: replace sound signals with visual effects, subtitles 3. Cognitive problems and learning disabilities – Solutions: active participation, multi sensory experiences, strong interaction, positive reinforcements, individualized instruction, repetition 4. Mobility impairments, limited hand mobility, Parkinson’s – Solutions: pointing devices to press keys, mouth and head-sticks to control a PC, left-handed or right- handed keyboards for those who lack one arm, track balls, larger keyboards, morse code as a keyboard, sip-and-puff using air pressure to control morse code, speech- recognition, word prediction software 1.2.16. Moral, ethical, social, economic and environmental implications of the interaction between humans and machines - Artificial Intelligence is evolving very fast, however many are concerned that AI might lead to unpredictable and dangerous situations with no human control over them - Ethics framework – religion, society, profession, and family. Moral framework – individuals set morals - IT has increased the number of printed papers, which causes many environmental concerns. Electronic waste contains many dangerous chemicals which cause pollution. - The digital divide is unequal access to technology within classes of people 2.1.1 - Computer systems consist of hardware and soPware components and follow the concept of the input, process, output, and storage model à that means that a computer system takes in some data as input, processes it in a manner that we have requested, and outputs the results in some way - Data is processed by the computer system - It may be the case that other data or instruc\on, apart from the input, are necessary during processing à exists in the storage and may be loaded and used - The computer system outputs the processed data into informa\on that we can see and use (using a monitor, speakers, a printout,…) à save in the storage - Data or instruc\ons that are processed by a computer system in the process phase of the input, process, output, and storage model are processed by the central processing unit (CPU) - CPU – hardware component of a computer system and can perform basic arithme\c, logical, or input/output opera\ons, in order to process data from input devices into useful informa\on à the brain of a computer system and can process data very quickly but can only process data by following instruc\ons – it cannot think for itself - CPU can also be called a chip or a processor - The block diagram can be created to represent the elements that compromise it - CPU contains: control unit (CU), arithme\c logic unit (ALU), memory address register (MAR), memory data register (MDR) THE CONTROL UNIT (CU) - Responsible for the opera\on of the CPU - It controls the retrieval of instruc\ons from the primary memory as well as the sequence of their execu\on - Contains various registers à small storage loca\on that can hold data, usually a mul\ple of 8 bits - Responsible for providing the ALU with the data that needs to be processed as well as the instruc\ons on how the data should be processed - In order to retrieve information for usage (usually from the RAM), two parts of information are needed: The address, and the data. These two parts are managed in two separate sub-systems: THE MEMORY ADDRESS REGISTER (MAR) - holds the address of the memory which is to be used by the ALU. - it is connected directly to the RAM with a path called the Memory Address Bus THE MEMORY DATA REGISTER (MDR) - holds the data that is to be used by the ALU and then saved to the RAM - serves the same function as MAR (sends info to ALU), but with the data part. - The connection between the MDR and RAM is called the Data Bus. - performs the arithmetical and logical calculations on data that were sent by the CU; 2.1.2 - the primary memory – the only storage that is directly accessible by the CPU - primary memory consists of 2 types of memory: Random Access Memory (RAM) and Read Only Memory (ROM) RAM - general-purpose storage area meaning that the data stored can be over-written - this allows data and instructions to be loaded for execution and use whenever they are necessary - is volatile – whenever power is lost the contents of its memory are wiped ROM - used to store instructions and data and cannot be over-written - the instructions that are embedded cannot be changed, even if the power is lost à non-volatile memory - used to store programs and instructions that do not need to be updated or change Computer systems are binary systems All data and instructions that are stored in a computer system are stored in sequences of binary digits that can take only 2 possible values 1 and 0 Bit – the basic unit of information in computer systems and can have only 2 values, 1 or 0 1 Byte = 8 bits. à 1B = 8b One byte = one single character TERM SIZE IN BINARY SYSTEM SIZE APPROXIMATION Kilo (K) 1024 1000 Mega (M) 10242 1 000 000 Giga (G) 10243 1 000 000 000 Tera (T) 10244 1 000 000 000 000 2.1.3 - RAM has two main types: Sta9c RAM (SRAM) and Dynamic RAM (DRAM) SRAM - faster but more expensive than DRAM - preferred for the main RAM of a computer system - placed between the main RAM and the processor à cache CACHE - a smaller and faster RAM (SRAM) that temporarily stores instruc\ons and data so that the processor does not need to access the slower main memory - holds the informa\on in the RAM that is most ac\vely used and accessed most frequently - when the processor needs to read from the main memory, it first checks if a copy exists in the cache - two types of cache: L1 cache and L2 cache - L1 is placed on the microprocessor - L2 is placed between primary memory and the microprocessor 2.1.4 - Computer programs à stored in the primary memory as a series of instruc\ons in machine code - Instruc\ons have to be moved from the primary memory to the CPU in order for the computer program to operate - Specific steps need to be followed: 1. Fetch instrucOons from primary memory to control unit The CPU is responsible for knowing which instruc\ons it needs to take from the primary memory in order to operate correctly. To do that it sends the appropriate address through the memory (address) bus to the primary memory. The instruc\ons that reside in the specific address are then copied into the data bus and sent to the control unit (CU). 2. Decode instrucOons in the control unit 3. Execute instrucOons 4. Store the result of execuOon and check for the next instrucOons 2.1.5 - Primary memory is the only storage that is directly accessible by the CPU - Any data that is stored elsewhere needs to first be copied onto the RAM, since the ROM cannot be wrisen to but only read from, in order to be used by the CPU Secondary memory - Slow memory that may be wrisen to (just like the RAM) but is also non-volaOle - The contents of the memory are not wiped if power is lost but are persistent - Known as the persistent storage - It has a rela\vely high capacity to hold data compared to the primary memory - Thus what provides persistent storage to computer system When the computer starts up à RAM is empty - InstrucOons and data à need to be copied into RAM in order for the computer system to run à from the secondary memory - Without the availability of secondary memory, only ROM would be able to store programs and instruc\ons - Since the data is very important, for a computer system to func\on correctly, the loss of data would be detrimental - Secondary memory is required to hold informaOon that may not be needed all of the Ome or may be too large to fit as a whole in primary memory à necessity in a computer system - Different main secondary storage devices: hard drive (hard disk), CD-RW, DVD-RW, USB Flash drive, Zip disk, Floppy disk, MagneOc tape - New technologies appear and exis\ng ones strive to become more efficient, robust, and faster, as well as to hold more data than before 2.1.6 - An operaOng system – a set of sotware that controls the computer’s hardware resources and provides services for computer programs à between sotware applica\ons and the computer hardware 3 PERIPHERAL COMMUNICATION - Peripheral devices – all the hardware components of the computer system that reside outside the CPU - Keyboards, monitors, printers, microphones, … - OS à responsible for communicaOng directly with the hardware and providing an interface between hardware devices and applicaOons MEMORY MANAGEMENT - OS à responsible for all the memory that is available in a computer system à manages how the memory is used by applica\ons and ensures that one applicaOon does not interface with memory that is being used by some other applica\ons - If one applica\on interferes with another applica\on’s memory à laser may stop func\oning or its data may be affected or overwrisen RESOURCE MONITORING AND MULTITASKING - An applica\on that is running on a computer system takes up resources - OS à responsible for the efficient allocaOon of resources so that an applica\on can run as effec\vely as possible on a par\cular computer system - MulOple applicaOons may run on a computer system at any \me - Most computer systems have a single CPU à a single ac\on at any \me - Applica\ons must share the CPU \me in order to accomplish their goal à MULTITASKING NETWORKING - OS à manages connecOons to and interacOons with networks of other computer systems to allow the sharing of resources - Networking – essen\al to modern computer systems, most connected with either a local area network or the Internet DISK ACCESS AND DATA MANAGEMENT - An important func\on of an opera\ng system is its ability to access data stored in memory and disk - Data is stored using files - OS à responsible for keeping track of these files, as well as which files are being used by which applica\ons so that an applica\on does not overwrite another applica\on’s files à also responsible for coordinaOng the transfer of data from the disk files into the primary memory and vice versa SECURITY - OS à responsible for the overall security of a computer system - The most common but effec\ve method is – a form of idenOty (username, password, email, verifica\on) - Other methods: magne\c cards, biometric data - Log files – keep track of the ac\vity of any user in the computer system - Major opera\ng systems – OS X, Linux, Microsot Windows,.. 2.1.7. WORD PROCESSORS - A word processor – a sotware applica\on that is used for the produc\on of any document - Includes tools for the composi\on, edi\ng, formayng and possibly prin\ng of documents - Word processing – the ac\ons of crea\ng documents using a word processor - Most famous word processing applica\ons à Microsot Word and Apple iPages SPREADSHEETS - A spreadsheet – a sotware applica\on that is used for the organiza\on and analysis of data - The data in a spreadsheet applica\on – represented as cells, organized in rows and columns à may contain numbers, text, or the result of a formula that calculates and displays values automa\cally based on the contents of other cells - Allows fundamental opera\ons of arithme\c and mathema\cal func\ons to be shown, provides common financial and sta\s\cal opera\ons, and can display graphical data as well - Examples – Microsot Excel and Open Office Calc. DATABASE MANAGEMENT SYSTEMS (DBMS) - A database management system – a sotware applica\on that manages (creates, updates stores, modifies,…) database - Another defini\on: an organized collecOon of data - Designed to provide an interface between the user and a database - Data organized into records and model some relevant aspects of reality WEB BROWSER - A web browser – a sotware applica\on used to access, retrieve, and present content on the World Wide Web - Web pages, images, videos,… à may be iden\fied by a URI (Uniform Resource Iden\fier) - Example of URI: hsps://translate.google.com/ - The web browser uses URI to connect to the appropriate web servers and request the wanted informa\on à the web servers send back the informa\on which the web browser then displays to the user - Examples: Google Chrome, Apple Safari, Mozilla Firefox EMAIL - E-mail – a sotware applica\on that allows for the exchange of digital messages from a single author to one or more recipient - An E-mail has 3 components – the envelope, the header, and the body - In order for an e-mail to be transferred from the author to the recipient, the Simple Mail Transfer Protocol (SMTP) is used COMPUTER-AIDED DESIGN (CAD) - A computer-aided design – a sotware applica\on that assists engineers in crea\ng, modifying, analyzing, and op\mizing a design - Used in many fields à architectural design, shipbuilding, … - Purpose: increasing the produc\vity of the designer and the quality of the resul\ng design - Can convey more than shape informaOon à materials, dimensions, and tolerance can all be represented - Autodesk AutoCAD, Dassault Systems Solid Works 2.1.8 Common features of applications - Graphical user interface (GUI) – a software application that allows the user to interact with a computer system in a number of ways, instead of just typing in commands - GIUs are described with an acronym WIMP (Windows, Icons, Menus and Pointers) Common GUI elements: o Graphical icons o Visual indicators o Toolbars o Menus o Dialogue boxes - Early software applications operated with commands that had to be typed in, we call them · Command line interfaces (CLIs). Command Line Interface (CLIs) Graphical User Interfaces (GUIs) o Easier to implement by a o Users do not need to remember the programmer specific commands – easier for new o Requires less memory to run users to use o Can be run on computer systems o Users use icons to remember Pros without a graphical monitor commands o Quicker to type in command than to o Commands are grouped in menus use a mouse – experienced users and toolbars may find it useful o More complex to implement by a o Users need to remember specific programmer commands – hard to new users to o Requires more memory Cons use o Requires a graphical monitor and pointing device - Toolbar – a GUI element on which buttons, icons, menus, or other input or output elements are placed - A menu – a GUI element that displays a list of commands that can be chosen by the user to perform various functions - Dialogue box – a GUI element that is used to communicate information to the user and allow them to respond by choosing an option from a list of specific choices - Some common GUI (toolbars, menus windows, dialogue boxes) elements are provided by the operating system, the programmer only needs to state their existence. u - e.g. A programmer that wants to implement a program which will run in a window and have some menus needs to specify that commands the menus will include, what will happen when the user initiates them by clicking them, as well as were they will reside within the window. However, the actual menus and windows themselves are provided by the operating system, as well as what happens when the window is minimized or moved. Computer organization – Binary representation 2.1.9 Bit, byte, binary, decimal and hexadecimal - All data and instructions stored in a computer system are stored in sequences of binary digits that can take only two possible values, 1 and 0. - Thus a binary digit (bit) is the basic unit of information in computer systems and can have only two values: either 1 or 0. Eight bits form a byte. > - 1 Byte = 8 bits - A bit is denoted by the small letter b, whereas a byte is denoted by the capital letter B. Thus, 1B = 8b. One byte can store a single character (ex. The letter A). - They are used to denote file sizes stored on memory or disk (ex. a 12MB file) or even connection speeds (ex. 50Mbps). 6. INTERRUPT = allows the current job of a CPU to be suspended temporarily to perform a higher-priority task = signal to the CPU sent by hardware or sotware. Examples o Used to indicate that a client wants access to the server (in a mul\ access system) o A peripheral needs serving (printer) o Sotware applica\on reports an error o Power problem alert (low basery) How the CPU handles the interrupt o Interrupt signal is sent to the computer o CPU ac\vates the event handler and suspends/ puts on task the current tasks o CPU services the tasks related to the request of interrupt o When these finish, CPU resumes suspended tasks/ pops them from stack INTERRUPT REGISTER (IR) It is used to detect the posi\on in memory of the specific interrupt-handling code POLLING = a technique which allows one unit to check the status of another unit at regular intervals Can be efficient use of CPU \me Can be used when CPU is not busy HANDSHAKING = the exchange of signals/ messages when the connec\on is established between two devices to establish that the devices are ready to exchange data The sender sends a request for communica\on on a channel to the receiver Receiver replies with parameters/ protocol/ cer\ficate ready to accept The sender verifies cer\ficate and uses the given parameters for the transmission BUFFER Peripheral devices are oten slow whereas CPU is fast CPU fills the buffer so that the device (fax/ printer) can access the data at its own speed, allowing the CPU to work on other tasks PAGING à something like virtual memory It is used in the forma\on of virtual memory/ use of secondary memory to increase the amount of primary memory Memory is divided into (tagged) “pages” which are then transferred in and out as required FEATURES TO BE CONSIDERED WHEN COMPARING THE SPEED OF DIFFERENT PROCESSORS Word length Bus size Frequency Number of cores Cache size VIRTUAL MACHINES Provide a sotware emula\on/ virtualiza\on of other opera\ng systems while hiding/ abstrac\ng the physical environment/ O.S/ execu\on environment of the host machine Virtual machines do not directly correspond to any real plazorm so sotware may be tested/ executed on any plazorm (portability) This is more prac\cal/ economical than having to test sotware on several computers with different OS The sotware to be tested is compiled into the language of the virtual machine, and this is interpreted into the language of the host machine VOICE over IP = Audio (and video) stream transmised over internet Broadband internet connec\on needed It can be integrated in an office desktop computer with collabora\on desk endpoints/ webcams/ desktop computer/ widgets/ touch screen/ specific applica\ons/ IP phones Resources required: o Bandwidth § Available bandwidth/ a trade-off between bandwidth and quality of audio-video streaming § Low bandwidth makes streaming disrupted/ discon\nuous and impacts on the quality of the collabora\ve environment § Bandwidth also depends on how many people in the office will use VoIP and their simultaneous opera\ons (uploading/ downloading) o Router § Router should be powerful/ good enough to support all opera\ons related to collabora\ve work § Some specific routers provide quality of service for voice transmission over other func\ons, for example WiFi/ VPN connec\ons § Normal routers do not dis\nguish the internet traffic, and the quality of audio- video streaming may decrease o Network § Quality of internet varies, for example delays/ conges\on are cause of losses/ echoes/ scasered images § Having two separate networks for VoIP and other computer opera\ons may help in some cases (depending on the dimensions and opera\ons of the office), so that the router can handle them separately § For example, somebody talking over the IP is not hindered by somebody else in the same office downloading from the internet o Power § In case of power loss the telephones will also not work § A backup system/ second just for the telephones is necessary FUNCTIONS OF THE OPERATING SYSTEM IN RELATION TO MULTITASKING Memory management o O.S allows more than one program/ process to share the memory by alloca\ng separate memory to each program o It provides memory isola\on for each of processes o The system may begin to run out of shared storage (as many programs are running) so OS moves pages to disk/ paging Processor management o To allow (the appearance of) more than one program running at the same \me by the alloca\on of \me slices o Decides which process runs at a certain point in \me o Arrange the execu\on of applica\ons so that we believe that there are several things happening at once (scheduler) o Priori\zes tasks by importance (interrupts) System resources include: computer hardware, sotware, trained personnel, and suppor\ng infrastructure PRIMARY MEMORY = all processed data and instruc\ons and all resul\ng data have to be stored in primary memory Directly connected to the processor and feeds the processor with the required data by the fetch, wummmmm decode, execute cycle data and instruc\ons RAM AND CACHE MEMORY = all data and instruc\ons held in RAM may be altered at any \me 2 types of RAM: sta\c (SRAM) and dynamic (DRAM) RAM SRAM (sta\c RAM) = type of semiconductor memory that holds data for as long as there is power supply to the memory circuits More expensive, needs more transistors per byte, faster than DRAM Used in small quan\\es Placed between the processor and the DRAM à directly feeds the processor DRAM (dynamic RAM) =semiconductor gradually leaks away and needs to be refreshed periodically Used in large quan\\es in primary memory ROM (Read Only Memory) = nonvola\le and slower than RAM Used to hold cri\cal instruc\ons used to start up a PC A common use of ROM is to hold the Basic Input Output System which makes it possible for a PC to boot and some\mes to hold the en\re OS for old small home computers SECONDARY STORAGE = hardware that provides data integrity, low cost, mass storage capacity, and permanent storage 2 broad types of secondary memory devices: direct access and sequen\al access In batch processing, some programs are batched together and then executed as a group, without the need of any intervention from the user. Only one program is running at a time, while the others are waiting for their turn. When it completes, the next program in the queue runs, and so on, until all the programs in the batch are run. In multiprogramming, two or more programs may be loaded in the main memory. However, only one program will be executed by the CPU at any one point in time. All the other programs will be waiting for their turn. The idea behind multiprogramming is to maximize the use of CPU time (i.e. CPU idle time should be minimized) Multitasking is similar to multiprogramming with the subtle difference that tasks or processes (instead of whole programs) are performed simultaneously and share a common resource, for example, one CPU. Each task finishes, before another takes up the CPU, as was the case in multiprogramming. However, tasks are a lot "smaller" than programs and as such are completed very quickly. Both multiprogramming and multitasking operating systems are Central Processing Unit time-sharing systems. Multiprocessing refers to the hardware and means that a computer system has more than one CPU core. This might mean multiple CPU dies or even multiple cores in one or more CPU dies. Multithreading is the ability of a program or an operating system to execute different parts of a program, called threads, simultaneously. The program has to be designed by the programmer in such a way that all the threads can be executed at the same time without interfering with each other. Swapping is the general term of a mechanism in which a process or blocks of program code can be swapped temporarily out of RAM and into a hard disk, and then, later, brought back into RAM to continue their execution. Paging is the underlying mechanism of virtual memory implementation, which allows all modern OS to utilize the, much greater in size, secondary storage as if it was RAM. Excessive page swapping causes thrashing that results in poor system performance. Symbian is a mobile OS designed for smartphones TinyOS is a free and open-source, embedded, component-based, OS and platform for low-power wireless devices, such as those used in wireless sensor networks and home automation. Tizen is an OS based on the Linux kernel and the GNU C Library implementing the Linux API. Embedded Configurable Operating System (eCos) is a free and open-source, real-time, OS that was engineered to serve embedded systems and applications which need only one process with multiple threads. 7.1.1 A CONTROL SYSTEM - One or more devices that guide other devices or system - Allows the compeOOon of various tasks in an automaOc manner à without any human interven\on - Set up once – perform the ac\ons that they have been programmed to do in an automa\c manner - May include sensors to gain feedback from the environment and motors to control any actuator in an appropriate manner - Ex. the automa\c doors - The sensor may use infrared or microwave signals that bounce off of objects to determine motion. After receiving feedback from the environment, the sensor forwards its signal to a just microprocessor and allows the control system to operate its actuators to open the doors only when motion is detected. Furthermore, more advanced automatic doors include photocell read sensors that can tell if someone is at the door so that the doors do not close on them. This results in a control system that is very convenient, as well as efficient, when one considers that doors cannot now be left open accidentally, which may be costly when a heating or air- conditioning system is operating. Computer systems are mostly input, process, and output systems That means that an input is provided to the system, which is processed by some algorithm, and an action is performed. The results of the action can then be measured by the control system and feedback can be provided as input. Examples of control system: a heating systems, taxi meters, elevators, washing machines, process control, device drivers, domestic robots, GPS systems, traffic lights 7.1.2 - Today most modern control systems use microprocessors in order to efficiently and effectively read sensor input, process it according to an algorithm, and finally perform some actions MICROPROCESSOR - small processor, that contains most, or all, of a central processing unit (CPU) function on a single chip or integrated circuit (IC) - performs arithmetic and logic operations, as well as any other data operations necessary, through the use of registers - The specific purpose of microprocessors – general purpose, embedded controller or microcontroller, graphing processing unit (GPU) GENERAL PURPOSE - Capable of running a wide range of different programs and usually integrated into a larger system - The CPU found in a desktop computer is a general-purpose microprocessor - Desktop computers à include various peripheral devices, external memory EMBEDDED CONTROL - Microcontrollers are usually stand-alone chips that may include the main elements of a larger system, such as RAM and ROM à smaller in capacity - The controllers are designed to: perform some precise tasks and don’t need a whole computer system - Need less power to function and are smaller in size - They can be integrated into smaller, lower-powered electronic devices GRAPHICS PROCESSING UNIT (GPU) - Computer graphics à became so detailed and realistic - An additional, special kind of microprocessors, is included in most computer systems - Includes hardware to allow for faster handling of graphics related mathematics - Responsible for calculating and rendering polygons and pixels on the screen Microprocessors improve control systems in number of ways: 1. They can process input data much faster than a human à can react to changes in the input quickly 2. Control systems that depend on microprocessors are automated and as such are error-free compared to manual or mechanical systems. 3. Can operate throughout the year with little to no off-time à in conditions that are dangerous for humans - Of course, since embedded microprocessors are pre-programmed systems that follow some specific algorithms, they would probably not be able to operate in the most effective way or at all (in an unexpected event). Moreover, as microprocessors need power to operate, the system would not be able to function if there was a power shortage. - In order for microprocessors to perform any processing à need to receive an input ANALOUGUE-TO-DIGITAL CONVERTER (ADC) - Using ADC, a sensor converts continuous physical (analogue) quantities (speed, temperature, humidity,...) into discrete digital signal - Signals can be read as input by microprocessors à after the input is processed, according to some algorithm(s), and output is returned - Although a wide variety of sensors exist, all of which share a number of common properties determining their quality: 1. Accuracy – determines whether the measurement of the physical quantity and therefore the final delivered digital signal is accurate (ex., a temperature of 18℃ should not be measured as 19℃) 2. Range – determines the acceptable range of the physical quantity within which the sensor may acquire readings (ex., a temperature sensor might be able to accurately operate between -30℃ to 60℃, but not above or below this) 3. Resolution – determines the smallest increment that the sensor may detect (ex., one temperature sensor might be able to determine increments of 1℃ accurately, measuring whether the temperature is 17℃ or 18℃, while another might be able to determine increments of 0.1℃ accurately, measuring whether the temperature is 17.0℃ or 17.1℃ - 2 more characteristics of sensors: 1. Sensors should be insensitive to any other physical conditions present that could influence the reading 2. Sensors should not influence the measured property in any way 7.1.3 - sensors are usually integral part of control systems and act like an input device - sensor sense a physical property and then transform it into an electrical signal - sensor types may be: 1. SOUND – sound sensor detect sound waves and are widely used in microphones 2. MOTION – motion sensors detect moving objects. They are widely used in security/alarm systems, as well as automated lightning control, so that the lights are only on when necessary to conserve energy 3. VIBRATION – vibration sensors detect vibrations and are placed on surfaces that can vibrate. They are widely used in security/alarm systems (placed on windows), as well as acoustic musical instruments (instead of microphones) 4. OPTICAL/IMAGE – a wide variety of optical sensor exist, depending on the physical quantity measured. Two widely-used optical sensors are: a) Active pixel sensor (APS) – used in almost all digital camera, they contain an array of pixel sensors that can imprint light b) Infrared (IR) – used to sense invisible radiant energy with longer wavelengths that those of visible light. Widely used in security/alarm systems to detect motion at night, where visibility is low or non-existent 5. PRESSURE – pressure sensors detect pressure. They are used in a variety of settings, including touch-screen devices, as well as the automotive industry (they regulate the engine power according to the pressure on the pedals) and others 6. TEMEPRATURE – temperature sensors detect temperature. They are widely used within thermostats to control the temperature of a given setting 7. PROXIMITY – proximity sensors can detect the presence of nearby objects without any physical contact. They are widely used in cars to help drivers reverse or park 7.1.4 - A processor performs arithmetical and logical operations and is the core element of any computer system. - It receives input, in electrical form, from a number of sensors (from sensors on a tracking device, such as a mouse, to motion sensors above automatic doors) and performs some sort of output (from moving a mouse cursor to opening doors). - In the process of sensing physical quantities, using sensors, and transforming them into analogue signals, a conversion takes place. - The device that converts one form of energy to another is called a transducer. - Transducers, in computer systems, are responsible for converting physical quantities (such as speed, temperature, humidity, pressure, etc.) into electrical signals, as well as vice versa. - The conversion process from one form of energy to another is called transduction. - Sensors can be categorized as transducers, as they sense a physical quantity and transform it into another form of energy (typically an electric signal). - However, other devices (apart from sensors) can be categorized as transducers. The most common of these are called actuators and are used during the output. - Actuators are the devices responsible for moving some kind of mechanism. - They are transducers in that they receive some form of energy and convert it into motion. Control systems use actuators to perform some actions in an environment (for example, a mechanical motor in an automatic door is an actuator that receives electric current and converts that form of energy into kinetic energy so that the motor moves and the doors open). just read Figure 7.2 depicts how a control system that uses a processor works as an input, process, and output device. An input signal is recorded by a sensor, which transforms the physical quantity into an electrical signal. Since it converts one form of energy to another, the sensor is a transducer. The electrical signal is further converted into an electronic signal, using an analog-to-digital converter (ADC), so that it may be processed by the processor. After the processor runs any necessary algorithm(s) on the input data it outputs an electronic signal. That output is converted into an electrical signal, using a digital-to-analog converter (DAC), so that it may be used as input to an actuator. The actuator will convert the electrical signal into motion. Since the actuator converts one form of energy to another, it is a transducer. 7.1.5 - Feedback refers to the process where information about the result of an output, from a control system, is used as part of the new input to the control system in order to determine the best course of action for the next output - Feedback is essential to control systems that need to react to their environment and its changes1 - The input first affected the output, the output affected the input and the new input affected the output - After a while, the output would affect the input again. The feedback keeps the system in a stable, working state avoiding long queues on the road and helping pedestrians cross safely. 7.1.6 à SAMO PROČITAJ IZ KNJIGE 1there can be two kinds of traffic lights, fixed 7me and dynamic control. Fixed 7me traffic lights do not take the environment into account and just change color a?er a pre-programmed amount of 7me. On the other hand, dynamic control traffic lights use sensors to take the environment into account every 7me the lights change color. Imagine the following scenario: A dynamic control traffic light uses a sensor to iden7fy when no cars are near and changes the car lights from green to red, so that the pedestrians can pass. This ac7on is the output. The traffic light then receives feedback from this ac7on (a line of cars starts forming) and uses that feedback as input in order to turn the car lights green again when a long line has been formed. 4.1. o When a par,cular problem has to be solved, an effec,ve method or procedure should be iden,fied. o This procedure reduces the solu,on to a series of simple steps à steps have to be followed in the correct order to obtain the desired output o A good approach for confron,ng a complex problem is to develop a method of breaking up the problem into smaller sub-problems o Top-down design/stepwise refinement – a strategy where sub-problems can be further divided into smaller and smaller sub-problems un,l finally they can be dealt with individually - With this approach, the complex problem is decomposed o Sub-procedure – contains a series of commands that perform a task - when is called all statements included in the par,cular sub-procedure are executed o Modular programming – all sub-procedures that represent different parts of the problem solu,on can be used at the right ,me using their iden,fiers à procedure is divided into a series of sub-procedures o Iden;fier – the name that is used by the programmer to uniquely iden,fy a variable, an object, a sub-procedure,… o The addi,on process does not require any decision to be taken à but some problems require the use of the decisions o Itera;on – the process of repea,ng a series of instruc,ons - Used to repeat a statement or a block of statements within an algorithm - Expressed used “from to loop” and “while loop” o Condi;onal statement – performs different instruc,ons depending on a Boolean test o The if-then-else condi,onal statement is common across many programming languages and human logic o Object-oriented programming uses abstrac,on à uses programming objects that describe data (proper,es) and behavior (methods) of real objects, and facilitates code reusability and abstrac,on - based on the principle that all everyday tasks can be considered en,,es - En,,es are either objects or events - It makes complex soNware faster and easier to develop o Procedural (structural) programming – uses procedures that can interact and exchange data as building blocks of programs o Collec;on – a data structure that consists of the data and the predefined methods which operate on the data - Used to add, store, manage, retrieve, manipulate, and communicate the data using predefined methods anaum o Abstract Data Type (ADT) – group of opera,ons and data o Mathema;cal modeling – a process where a system is understood well enough and scien,sts describe it using mathema,cal language - A set of mathema,cal models contains only the necessary details, rules, and objects for studying the real system or an aspect of it - A mathema,cal model could be transformed into an algorithm and then into a program that replicates the behavior of a real system o Computer simula;on – runs on a computer and reproduces the behavior of a real system - Uses an abstract mathema,cal model that is expressed as a computer model to simulate a system o Modular program – easier to understand and facilitate the use of abstrac,on - The programmer can focus on the important things and ignore all unnecessary details o Thema;c map – an abstrac,on of reality that shows the spa,al distribu,on and emphasizes a par,cular theme, such as the average distribu,on of income in a specific geographic area o Topographic map – shows abstrac,ons of selected physical features of the three- dimensional real world at a reduced scale in two-dimensions, paper or a screen o Poli;cal maps – designed to show data such as the boundaries of countries and states and the loca,on of major ci,es - These maps are an abstrac,on of poli,cal territory 4.2 o Variables – acts as a storage loca,on that can be used to store a value - each variable has a name – used to refer to the stored value - the value of the variable can be changed during the program execu,on - each variable can store a par,cular type of data like strings, reals, Boolean, integers - one carriable = one data element of a program o Array – has a name, a size that cannot be changed during program execu,on, and a data type that can be described as the type of data that it can store - All elements of an array should be of the same data type - Data is organized as a table - Perfect choice when a programmer wishes to store the same type of informa,on o One-dimensional array – type of linear array - A single line of elements - Not able to store all the necessary informa,on because it can only store one data type and only store one field o Parallel arrays – extremely useful when a programmer wants to store different proper,es of an en,ty Linear search - sorted and unsorted > o The array of objects – an array of reference variables - Each reference variable is an element of the array and it’s a reference to an object o Sequen;al search – a very simple method to find a par,cular element in an array à the simplest search algorithm o Binary search – the searching method used only in sorted arrays - Relies on divide and conquer strategy to accomplish its purpose o In each itera,on, the algorithm 1. Compares the search value with the value of the middle element of the array a. If the values match, then the value was found b. If the search value is less than the middle element of the array Then the algorithm repeats its ac,on on the sub-array to the leN to the middle element c. If the search value is greater than the middle element of the array Then the algorithm repeats its ac,on on the sub-array to the right of the middle element 2. If the remaining array to be searched is empty, then the value was not found ADD TABLE à 213 PDF – CORE o Bubble sort – simple sor,ng algorithm that repeatedly steps through the array to be sorted - Compares adjacent items and exchanges them if they are not in the correct order (ascending or descending) - The algorithm makes mul,ple passes un,l no swaps are necessary and the elements of the array are sorted - Very slow o Selec;on sort – a very simple and inefficient sor,ng algorithm that divides the input array into two sub-arrays - the first sub-array contains the already sorted elements, and the second sub-array contains the unsorted elements and occupies the rest of the array o Collec;ons – allow custom specifica,ons of the collec,on item elements 1. Generic collec,ons – can only hold data of the same type 2. Non-generic collec,ons – can hold elements of different data types - Advantage of the collec,ons: they act like a resizable array - The programmer doesn’t need to know in advance the number of items that will be placed in the data structure STANDARD OPERATIONS COLLECTIONS § addItem( ) – used to add an item to the collec,on § getNext () – used to return the first item in the collec,on when it is first called - will not remove the item from the collec,on ADDITIONAL OPERATIONS § resetNext ( ) – used to restart the itera,on through the collec,on § hasNext ( ) – used to iden,fy if there are remaining elements in the collec,on that have not been accessed by the present itera,on § isEmpty ( ) – used to test if the collec,on is empty o Efficiency – refers to the amount of the computer resources required to perform its func,ons - Minimizing the use of various resources such as the CPU and computer’s memory is very important o Correctness – refers to the extent to which the algorithm sa,sfies its specifica,on - Free from faults - Fulfills all objec,ves set during the design and implementa,on phase o Reliability – refers to the capability of the algorithm to maintain a predefined level of performance and perform all required func,ons under stated condi,ons, having a long mean ,me between failures o Flexibility – refers to the effort required to modify the algorithm for other purpose than those for which it was ini,ally developed o Big O nota;on – useful when analyzing algorithms as it is a measure of the efficiency of an algorithm - It means that the growth rate of the instruc,ons in this par,cular algorithm shall be executed n ,mes o Lists – used to store a sequence of values under a single name - Allow duplicates to act as containers and to be typically implemented either as linked lists or as arrays - Very similar to the array 4.3. o A computer can perform some fundamental opera6ons o The condi,onal instruc,ons and basic opera,ons of Boolean algebra (AND, OR, XOR, NOT) are cri,cal for the development of useful programs o By combining fundamental computer opera,ons, computers can perform compound opera;ons à finding the max value of four numbers is a compound opera,ons o Programming language – the combina,on of its seman6cs, which refers to the meaning of every construc,on that is possible in the language and its syntax, which relates to its structure o Grammar – meta-language that is used to define the syntax of a language o Syntax – the rules of statement construc,on o A command wricen in a computer language always means the same and there is no ambiguity in meaning o Each computer has its own machine language à made up of 0s and 1s o Machine language – low-level language and is the only language that can be understood directly by a computer à difficult to maintain and debug o Machine language programmer has to keep track of memory loca,ons and write from the very beginning all the mathema,cal func,ons required by a program à one kind is not suitable for another o The next evolu,onary step in programming came with the replacement of binary code for the development of instruc,ons and references to address loca,ons with symbols called mnemonics o Mnemonics/assembly languages – low-level computer languages o Assembler - used to convert the assembly language mnemonics to machine code o A high-level programming language – a programming language that uses elements of natural language - Easy to use - Facilitates abstrac,on by hiding significant areas of compu,ng systems - Makes the program development simpler - Faster and more understandable o Transla,on process – will convert the program into the machine language of the computer on which it will run o Source program/source code – the original program development in a selected high- level language o Object program/target program – the translated program in machine language o 2 methods used for transla,on: compila;on and interpreta;on o A compiler – translator that executes the transla,on process only once - Translates the whole source program into the object program - The object program is saved and the next ,me a programmer wants to use the object program no recompila,on is necessary o An interpreter – translator that goes through the process of transla,on every ,me the program is run o Interpreta;on – the process of reading each line of the source program, analyzing it, transla,ng it into the corresponding line of the object program, and execu,ng the line o Java combines compila,on and interpreta,on - Source code is compiled to Java Virtual Machine bytecode o Variable – used to store a data element of a program o Constant – represents things and quan,,es that don’t change - Non-modified variables o Operator – used to manipulate operands - Can be arithme,c, rela,onal, logical, etc. o Object – a comprised of data and ac,on - Ac;ons – opera,ons that can be performed by the object o Data members – used to store the current state of an object and methods are used to change or access those data members o The scope of a variable – the visibility of that variable - Defines which parts of the algorithm can store, access and retrieve the data of the variable - A global variable – visible to all parts of your program - A local variable – has a limited scope o A collec;on/container – consists of zero or more elements such as objects and values and it is equipped with the necessary opera,ons to handle data - Allow duplicate elements and may contain ordered and unordered data elements o Each type of collec,on is equipped with its own specific opera,ons o A fixed-size array – is not considered a collec,on because it holds a fixed number of items o A sub-program – a unit that contains a sequence of computer instruc,ons that perform a specific and predefined procedure - May be defined within programs, or separately in libraries that can be used by mul,ple programs - In most cases a func,on returns a value and a procedure just executes commands o Code reuse – allows programmers to take advantage of exis,ng code and solu,ons developed by other programmers to speed up their tasks - Saves ,me and resources - Allows the comple,on of demanding projects in the shortest period of ,me o SoUware libraries – contain subprograms that can be used by different types of programs o Advantages of breaking a program into sub-programs: - Breaking down a complex programming job into simpler jobs - Distribu,ng a very large programming problem among various programmers all over the world - Enabling code reuse across mul,ple programs - Facilita,on of abstrac,on by hiding implementa,on details from users of the subprogram - Improving maintainability and traceability - Reducing programming code duplica,on within the same program o Advantages of using collec;ons: - The methods of collec,ons are predefined algorithms that the programmer can immediately use - Performance is increased by the data management capabili,es provided by the collec,on - SoNware reuse is facilitated because the use of methods is based on a common language and a standard interface o Java uses methods to represent sub-programs o A Java method may return a value and the main program may pass one or more variables to a method o A parameter – the name of the informa,on that is used in a method, func,on or procedure o An argument – the value that is passed into a method, func,on or procedure o A module – small sec,on of a program that is customized to perform a par,cular task - Can be customized by a programmer to do a par,cular task UNIT 5 o Recursion – when a method calls itself un,l some termina,ng condi,on is met - Accomplished without any specific repe,,on construct, such as while or a for loop - Follows one of the basic problem-solving techniques, which is to break down the problem at hand into smaller subtasks o Any algorithm that may be presented in a recursive manner can also be presented in an itera,ve manner and vice versa - Recursive algorithms are considered as harder to code o The Koch snowflake – mathema,cal curve which is based on the Koch curve à developed by the Swedish mathema,cian Helge von Koch - Can be constructed by star,ng an equilateral triangle o Using recursion each line segment changes using the following steps: 1. Divide the ini,al line segment into 3 sub-segments of the same length 2. Draw an outward-poin,ng equilateral triangle that has the middle segment from step (1) as its base 3. Delete the line segment that is the base of the triangle from the previous step o In many cases, data comes in the form of a data table. Each element in a 2D array must be of the same type, either a primi,ve or object type o A stack – stores a set of elements in a par,cular order and allows access only to the last item inserted - Items are retrieved in the reverse order in which they are inserted - Last-In, First-Out data structure (LIFO) o Stacks u;lize 3 methods: 1. push (). Pushes an item onto a stack 2. pop (). Removes and returns the last item entered in the stack 3. isEmpty (). Tests if a stack is empty. It will return true if the stack contains no elements LOOK AT PAGE 11 o A queue – stores a set of elements in a par,cular order and allows access only to the first item inserted - Items are retrieved in the order in which they are inserted - First-In, First-Out data structure (FIFO) o Queue u;lize 3 methods: 1. Enqueue (). Puts an item into the end of the queue 2. Dequeue (). Removes and returns the first item entered in the queue 3. isEmpty (). Tests if a queue is empty. It will return true if the queue contains no elements o Applica;ons of queues: 1. Queues are used to model physical queues, such as people wai,ng in line at a supermarket checkout 2. The print queue displays the documents that are wai,ng to be printed. These documents will follow the first-send first-print policy 3. When sending data over the internet, various data packets wait in a queue to be sent 4. A server usually serves various requests. In most cases, these requests are stored in a queue. The first-come-first-served request procedure is followed o Methods: - Push (). – used to add elements to the stack. Inser,ng an element increments high by 1 and adds the element to this array posi,on. The high is incremented before the inser,on of the new item takes place. - Pop (). – returns the value of the top element and then decrements high. It serves to remove the top element from the stack. The item removed actually remains in the array but is inaccessible. - isEmpty (). – based on the high variable. It returns true(1) if the stack is empty - isFull (). – based on the high variable. It returns true(1) if the stack is full - size (). – based on the high variable. It returns the number of elements stored in the stack. PAGE 27 o Node – a basic unit that contains both data and a pointer - Requires memory for both its data and pointer o A pointer – a field of the node whose value points to another object, stored in some other memory loca,on o Each node in a linked list stores a pointer to the next value of the linked list o The NULL pointer – a special pointer that points to nothing, meaning that it has no pointee - Drawn as a diagonal line between the leN lower corner and the right upper corner of the pointers variable box o Linked lists – constructed from a series of nodes - Every node of the list is a dis,nct object that contains both data, as well as a reference (pointer) to the next node - Different from the array - Both are used to create lists à opera,onal characteris,cs are completely different - In the linked list – a par,cular element can only be accessed by following the references of all the previous elements à you cannot access an element directly - To insert an element in, one must first search through the list un,l he/she finds the correct place - Reference refers to an object’s address in the RAM o Logical representa;on – how the data and the links are “seen” by the programmer o Physical representa;on – underlying mechanisms that store the data in RAM à memory addresses, types of data, number of bytes used, the way the pointers are used o Characteris;cs of a linked list: 1. To traverse a linked list, you start at the first node and then go from node to node, following each node’s pointer to find the next node 2. A node with a specific key value can be found by traversing the list. Once found, a node’s data can be accessed 3. A linked list consists of a sequence of nodes 4. Each node contains data and a pointer 5. A linked list may be empty 6. The length of a linked list is the number of elements that it contains 7. The last node contains a null pointer 8. A node’s successor is the next node 9. A node’s predecessor is the previous node PAGE 32, 33, 34 o To search for a specific element, in a sorted or unsorted linked list, the linear search must be followed o Star,ng from the first node, all elements are examined un,l the desired element is found o If the element is not in the linked list, an appropriate message is returned o Sorted linked list –it is useful to examine a program that keeps all array elements sorted, in descending order, at all ,mes - Keeping a list sorted makes it possible to apply binary search when searching for a data item o Advantages of sorted linked lists: 1. All data are stored according to a key value 2. The programmer can use it in the same way as a sorted array is used 3. Elements do not need to be moved, but only pointers need to be altered à high- speed element inser,on 4. Can easily expand to any size that is supposed by the available RAM o Double-linked lists – each node contains data, a pointer and its successor, and a pointer to its predecessor - The header node points to the first node and to the last node of the list - If the linked list is empty, the pointers point to NULL - Web browsers o Advantages of the double-linked lists: 1. The first node and the last node of such a list are directly accessible without traversal and allow traversal of the list from the beginning or the end 2. The pointers of each node allow transversal of the list in either direc,on 3. Dele,on and inser,on before a node is easier o Disadvantages of the double-linked lists: 1. Addi,onal space used 2. Requires 2 pointers per node à needs twice as much overhead o Circular-linked lists – linked list in which the last link points back to the first link - Easy to loop and access all the nodes circularly, and one can traverse the en,re list star,ng from any node - Implementa,on is more complex and extra cau,on is needed so as not to end up in an infinite loop - Applica,on of the lists include OS ,me-sharing algorithms and mul,player games o Binary trees – combine the quick inser,on and dele,on of linked lists, as well as the quick searching of an ordered array - Are fascina,ng dynamic data structures that have been studied as abstract mathema,cal en,,es - Belong to the graph category and consist of nodes that are connected by edges - The top node is connected to two or more nodes on the next row à nodes represent values or objects and the edges represent the way the nodes are connected/related - May have 0,1 or 2 children o Traversing a tree- to visit each node in a specified order - 3 ways to implement tree traversal: inorder, preorder, and postorder à work with all binary trees o Inorder traversal of a binary search tree will visit all the nodes in ascending order, according to their key values o Inorder traversal algorithm – ini,ally starts with the root node as an argument and performs the following recursive steps: E 1. The algorithm calls itself to tzraverse the node’s leN-hand subtree 2. The algorithm visits the current node 3. The algorithm calls itself to traverse the node’s right-hand subtree o Postorder traversal algorithm – ini,ally starts with the root node as an argument and performs the following recursive steps: 1. The algorithm calls itself to traverse the node’s leN-hand subtree E 2. The algorithm calls itself to traverse the node’s right-hand subtree 3. Visit the node // Recall that visit a node means to perform an ac,on o A binary tree can be a valuable tool to symbolize an algebraic expression that involves operands and operators (+, -, /, *) o 3 nota;ons may be used: infix, prefix, pos`ix - In the infix nota,on, an operator is placed between two operands - In the possix nota,on, the operator follows the operands - In the prefix nota,on, the operator comes before the operands o Adding a new data item means adding a new object - An object is added in the correct posi,on of the trees as a node according to its key value - Adding a new data item is similar to adding a new node o Searching for a par,cular data item in a binary search tree involves comparing the value to be found with the key value of a node, and the following: - The node’s leN-hand child if the search value is smaller than the current node’s key value - The node’s right-hand child if the search value is greater than the current node’s key value m Pram) o To insert a new node into a binary search tree, follow the steps: 1. If the binary search tree is empty, insert the new node at the root 2. If the binary search tree is not empty, follow the root to the parent of the node to be inserted 3. The parent will be a leaf node. Insert the new node, according to the following rules: a. If the key of the new node is smaller than the key of the parent node, then connect the new node as the parent’s leN-hand child b. If the key of the new node is greater that the key of the parent node, then connect the new node as the parent’s right-hand child Practicea E o An unbalanced tree – a tree whose leN or right-hand subtree has a lot more nodes than the other subtree o Binary trees become unbalanced because of the order in which the data items are inserted o A dynamic data structure changes its size at execu;on ;me as required by its elements o Alloca,on and de-alloca,on of memory is controlled by the data structure DEFINITION ADVANTAGES DISADVANTAGES DYNAMIC Memory is allocated § Makes the most efficient use § Given that the memory alloca\on to the data structure of RAM as it only uses as is dynamic, it is likely that the dynamically à ex. much memory as it needs structure will ‘overflow’ should it Stack implemented § One does not need to know exceed its allowed limit or using linked lists or decide upon the size of the ‘underflow’ should it become data structure on advance empty § In most cases algorithms with dynamic data are slow, during execu\on, than algorithms with sta\c data structure § Random access is not allowed and elements should be visited sequen\ally § As such, there is no way to implement binary search § More complicated to program as the sotware needs to keep track of its size and data item loca\ons at all \mes STATIC Memory is allocated § The memory alloca\on is § Can be very inefficient as the at compile \me. The fixed and as such there will memory for the data structure is size is predefined occur no problems when predefined and can never adding or removing data § Even when the array has no data change during run- items elements in it, s\ll takes up the \me à ex. Stack § Easier to program as there is RAM space that was allocated at implemented using no need to check upon the compile \me arrays data structure size § Some\mes is difficult to predict § The space reserved in RAM the required array size will always be available, in § In a sorted array, inser\ng a new order to be used by the data element in the correct posi\on or structure dele\ng an exis\ng one, requires shiting of other elements o An Abstract Data Type (ADT) – an abstract conceptual tool - All data structures can be used to implement ADTs - A (sta,c) linked list can be implemented using an array and an array-type structure can be implemented using a linked list o Building a linked list using an array is the op,on for primi,ve-level languages and asse

Use Quizgecko on...
Browser
Browser