CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D....

45
CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. [email protected]

Transcript of CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D....

Page 1: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

CSCI 1200Introduction to Computing for

Non Majors

CHAPTER 4

Tami Meredith, [email protected]

Page 2: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Objectives

Understand the concept of an algorithm Compare and contrast local and web

applications Understand the role of an operating

system Explain how file systems are organized Outline the evolution of user interfaces Describe issues from applying

intellectual property laws to software2

Page 3: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Processing with Programs

Software (programs) are stored sequences of instructions that describe how to accomplish a task

An algorithm is a set of step-by-step procedures for accomplishing a task

Algorithms must terminate in a finite amount of time If a solution exists an algorithm must find it Heuristics are procedures that might not terminate

or might only sometimes find a solution Programmers translate algorithms and heuristics into

a specific programming language and then test, debug, and repair the resulting program

3

Page 4: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

A Simple C Program

/* K&R traditional first program */#include <stdio.h>

int main (int argc, char** argv) { printf("Hello world!\n"); return (0);} /* end main () */

4

Page 5: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Categories of Software

1. Development software› Enable programmers to create software› Compilers translate a programming language

into the language of the CPU› Editors are the word processors of programmers

2. Software applications› Serve as productivity tools to help users solve

problems

3. System software› Coordinates hardware operations › Supports applications and provides needed

services5

Page 6: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

A Fast, Stupid Machine

Typical computer is only capable of:› Performing basic arithmetic operations

Such as 7 + 3 and 15 – 8› Performing simple logical comparisons

Is this number less than that number? Are these two values identical?

Computers seem smart because they perform these operations quickly and predictably

6

Page 7: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

The Language of Computers

Every computer processes instructions in machine language (the language of the CPU)› Numeric codes (and mnemonics) used to

represent basic operations: Adding and subtracting numbers Comparing numbers Moving numbers Repeating instructions

Programmers use high-level languages.› C, C++, Java, Visual Basic (thousands of such

languages exist)7

Page 8: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Most programs are composed of millions of simple machine-language instructions

The program counter inside the CPU keeps track of the address (memory location) of the next instruction to be executed

The instruction execution cycle has a complex process: 1. Fetch the instruction & update the program counter

2. Decode the instruction

3. Get any data that is needed

4. Perform the specified task (this step could be really complicated for some tasks)

5. Put the result somewhere in memory8

Executing a Program

Page 9: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Applications

Everyone doesn't want to program Buy pre-built programs (i.e.,

applications) to do things for us These applications can be for

› work: Word, Excel, Powerpoint› entertainment: WoW, iTunes› artistic activities: Photoshop, Garage band› communication: email (Outlook), Firefox› all sorts of other stuff

9

Page 10: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Consumer Applications Thousands of software titles are available:

› Publishing & authoring programs› Accounting & financial software› Graphics programs› Educational & training› Games› Personal-information managers› Data storage and management› Multimedia creation

10

Page 11: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Application Elements Documentation: Instructions for installing and using software

—may be printed manuals or digital files Updating and upgrading software Compatibility: Read system requirements Disclaimer—an end-user license agreement (EULA)—

attempts to protect companies from errors in programs Licensing: Buy license to use software not your own copy of

the program Terms Of Service (ToS)—User agreements on how they will

use the software Open source software lets you see the "source code" that

produced it so you could modify it (if you knew how) Distribution by direct sales or download from Web

› Includes public-domain software and shareware

11

Page 12: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Web Applications

Growing trend toward using applications that run on remote Internet servers instead of your computer

Your computer just sends out the data and displays the results

Another company owns the programs and controls their use› Google Docs› Photoshop.com› Webmail programs: Gmail, Hotmail, Yahoo! Mail› Multiplayer games› Wikis: Wikipedia› Retail sites: Amazon.com and online auctions, eBay› Online communities: Facebook

12

Page 13: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Vertical-Market and Custom Software

Basic office applications are used in homes, schools, government offices, and all types of businesses

Other applications are job specific:› Medical billing software

› Library cataloging software

› Legal reference software

› Restaurant management software

› Educational software (Banner, BBLearn)

Tend to cost far more than mass-market applications

13

Page 14: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

System Software:The Hardware-Software Connection

System software: Class of software that includes the operating system and utility programs

Handles low-level details and hundreds of other tasks behind the scenes

User does not need to be concerned about details

Many are run automatically by other programs when they are needed

14

Page 15: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

The Operating System

15

Page 16: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

What the Operating System Does

Every computer depends on an operating system to:› Keep hardware running efficiently› Make process of communication with

hardware easier› Maintains file system› Supports multitasking› Manages virtual memory

Operating system runs continuously when computer is on

16

Page 17: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

What the Operating System Does

17

The User’s View

Page 18: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Utility Programs

Serve as tools for doing system maintenance and repairs not handled by operating system

Utilities make it possible to do dozens of things, including:› Copy files between storage devices

› Repair damaged data files

› Translate files so different programs can read them

› Guard against viruses and other harmful programs

› Compress files so they take up less space

› Manage user accounts18

Page 19: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Device Drivers

Small programs that enable peripheral devices to communicate with the operating system such as:› Keyboards› Mice› Printers

Many device drivers are bundled with peripherals

Others are sold as separate products

19

Page 20: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Operating System Location

Some computers store operating systems in ROM

Most modern PCs hold only a small portion of the operating system in ROM

Remainder of operating system is loaded during booting, when computer is turned on

Handheld devices may store operating system in flash memory

20

Page 21: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

21

When you turn on the computer:1. Special instructions in the CPU cause it to start executing whatever

program is in a predetermined location 2. The known location (in persistent ROM) contains a program that:

a. checks the computer for errors (POST) b. tells the CPU how to get a program from the hard disk drive

3. The CPU loads a program from the hard disk called a Bootstrap Loader

4. The CPU executes the bootstrap loader to load the Operating System into memory

5. The operating system starts executing and begins its startup routines

6. The operating system finishes starting all the other programs and services on the computer and waits for user requests

Bootstrapping

Page 22: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Executing an Application

22

The OS loads the application program into memory but remains in memory itself, so it can provide services to the application program:

display on-screen menuscommunicate with the printerobtain keyboard inputperform other common actions

Page 23: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

The User Interface:The Human–Machine Connection

User interface: Most important component of software with respect to usability

Early users spent months writing and debugging machine-language instructions

Later users programmed using easier languages that were still challenging

Now, most users work with preprogrammed applications

23

Page 24: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Desktop Operating Systems

MS-DOS: Standard on IBM-compatible computers in 1980s› Used command-line interface that

required users to type commands Apple Macintosh introduced windows,

icons, and mouse-driven, drop-down menus in 1984.

Windows and Mac OS started as single-user operating systems but today (sort of) support multiple users

24

Page 25: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

UNIX and Linux

UNIX: Command-line, character-based OS› Internet is populated (controlled and driven) with

computers running UNIX

› Enables timesharing and computers to communicate with several other computers at one time

› OS of choice for computers in technical, research, and academic settings

› Favored by many who require an industrial-strength, multiuser OS

› Name is based on the fact that Unix started as a uni (one) person variant of Multics

Also the basis (BSD Unix) of Apple Mac OS-X Linux, a UNIX clone, is distributed and supported free

25

Page 26: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Restart the application

Recover your work Reboot the system Recheck for updates Reboot in safe

mode Research your

problem Request help

Reinstall the program

Restore the operating system

Repair the hardware Replace the system

26

Software Unreliability- Most software is poorly written and unreliable- Rather than fix the problems, most companies suggest:

Page 27: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Hardware and Software Platforms

Operating systems are designed to run on specific hardware

The combination of specific hardware and an operating system (and other needed system software) is called a platform

The most common desktop OS are:› Microsoft Windows 7: 2009 is latest stable and

reliable version › Microsoft Windows 8: 2012, Poor design› Microsoft Windows 10: 2015, Latest version› Mac OS X (10): Standard for the Mac, latest version

is 10.11 El Capitan27

Page 28: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Hardware and Software Platforms

iOS: Used for iPhone, iPad, and iPod Linux, Sun Solaris, and other Unix variations Google Chrome OS: Linux based OS for low-

cost PCs, netbooks, and tablet devices Google Android: Designed for smart phones Blackberry OS: Proprietary multitasking OS QNX, VXWorks: Real time OS for embedded

systems, modems, other devices Z/OS: Mainframe OS

28

Page 29: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Compatibility Issues

Operating systems are designed to run on particular hardware platforms.

Applications are designed to run on particular operating systems.

Most cloud applications come in versions for multiple platforms.

29

Page 30: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

File Management

One of the challenges of working with a computer is keeping track of the masses of information that can be collected, edited, and stored on disks.

Most computers use some kind of hierarchical file system involving directories or folders to organize files.

30

Page 31: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Organizing Files and Folders

Files may be placed in folders. Folders can be placed inside folders. Every file and folder has a unique

pathname We refer to a the hierarchy as a tree,

with the highest level folder being called the root

31

Page 32: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Directory (File System) Tree

32

Page 33: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

File Managers

File management utility: Makes it easy to view, rename, copy, move, and delete files and folders› In Windows it is called Windows Explorer› In the Mac OS it is called the Finder

Can display information about a file such as size, its type, and the last time it was modified

33

Page 34: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Windows Explorer

34

Page 35: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Managing Files from Applications

Most applications support four basic file-management operations:› Open: Allows you to select the file you want

to work on› Save: Writes current application as a disk file› Save As: Allows you to choose the location

and name of the file › Close: Allows you to stop working on a

project without quitting the application

35

Page 36: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Locating Files

Organize files logically› Store documents in folder called Documents› Store photos in folder called Pictures› Store music in folder called Music

Modern operating systems include search tools› Search for filenames or for words and phrases› Virtual folders contain files that match certain

criteria no matter where they are located

36

Page 37: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Good Practices ...

BACKUP, BACKUP, BACKUP› in more than one place!

Know where things are› and know where software puts things

Never trust software› particularly, don't trust search

Have a system that works› for you› for the software tools you use

37

Page 38: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Disk Formatting

Hard disks are formatted by manufacturer before installing operating system:› Electronic marks are put on disk.› Disk is divided into series of concentric

tracks. › Tracks are divided into sectors.› Sectors are bundled into clusters or

blocks. File system provides way to link

multiple clusters to store large files 38

Page 39: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

HDDFormatting

39

Page 40: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Defragmentation Contents of file may

become scattered over clusters.

Accessing information is faster if file is assigned to contiguous clusters.

40

• A defragmentation utility eliminates fragmented files.

Page 41: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Software Piracy andIntellectual Property Laws

Software piracy: Illegal duplication of copyrighted software—is rampant

Few software companies use physical copy protection methods and that makes copying easy

Many people unaware of laws Others simply look the other way Laws vary greatly in different countries

41

Page 42: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

The Piracy "Problem"

Software industry loses billions of dollars every year to software pirates

Business Software Alliance (BSA) estimates that more than one-third of software in use is illegally copied

Piracy is particularly hard on small companies Piracy rates are highest in developing

countries Industry organizations work with law

enforcement agencies to crack down on piracy

42

Page 43: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Intellectual Property and the Law

Intellectual property: Includes the results of intellectual activities in the arts, science, and industry

Copyright laws: Protects books, plays, songs, paintings, photographs, movies, and computer code

Trademark law: Protects symbols, pictures, sounds, colors, and smells

Patent law: Protects mechanical inventions and processes (that may be based on software)

Contract law: Covers trade secrets Software does not fit cleanly in some of these

categories.

43

Page 44: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Chapter 4 Summary Three main categories: development,

applications, and system software. Applications and documentation can be

delivered on physical media or downloaded from the Web.

Programmers develop vertical-market and custom packages when general commercial programs won’t do the job.

44

Page 45: CSCI 1200 Introduction to Computing for Non Majors CHAPTER 4 Tami Meredith, Ph.D. tami.meredith@live.com.

Summary (cont.) Computer’s operating system mediates

between applications and computer hardware. Popular operating systems include: Microsoft

Windows, Mac OS X, UNIX, iOS, Android, and Linux.

User interface design is critical to usability. Computer industry has moved towards

graphical user interfaces/ Computers use hierarchical file system. Software piracy exists.

45