Download presentation
1
Computer Science 1 Week 4
2
This Week ... QBasic Programming Computer Concepts Expressions
Software categories Operating Systems File Basics
4
Mathematical Equations and More
QBasic Expressions Mathematical Equations and More
5
Functions of a Computer
Process Data Store Data Output Data
6
Expressions QBasic Expressions Operator Precedence
mathematical formulas follows the format you know Operator Precedence order in which operators will be computed practically all languages have precedence levels
7
QBasic vs. Other Languages
Not all programming languages have the same precedence levels They are pretty consistent for basic algebra So, make sure to consult the documentation
8
Numeric Operators in QBasic
Name ^ Exponent * Multiplication / Division + Addition - Subtraction & Unary Minus
9
Precedence Levels: Highest to Lowest
Operators Precedence Name (…) Sub expression ^ Exponent - Unary Minus *, / Multiplication & Division +, - Addition & Subtraction Highest Lowest
10
Calculate Results PRINT 11 * 2 + 8 * 4 - 7 PRINT 22 + 8 * 4 - 7
11
Calculate Results #2 PRINT 5 + 18 / 3 ^ 2 * 2 - 1
12
Calculate Results #3 PRINT 7 + 32 / 2 ^ 4 * (3 - 1)
13
Calculate Results With Variables
LET X = 10 LET Y = 2 PRINT X * 3 + -Y PRINT X * PRINT PRINT
14
Example Program 1 DIM X, Y, Z LET X = 10 LET Y = 6
LET Z = X * 2 – 12 / Y PRINT "The result:"; Z 20 2
15
Example Program 1 Output
The result: 18
16
Example Program 2 DIM X, Y, Z LET X = 2 LET Y = 5 LET Z = X*Y-(7–4)/3
PRINT "The result is"; Z
17
Example Program 2 Output
The result is 9
18
Example Program 3 DIM T1, T2, Ans LET T1 = 5 LET T2 = 4
LET Ans = T1*T2 + 5 – 6/3 PRINT "Answer:" ; Ans
19
Example Program 3 Output
Answer: 23
20
DIM Film AS String DIM Tickets DIM Cost LET Film = "Revenge of the Nerds 4" LET Tickets = 2 LET Cost = 9.50 PRINT Film PRINT Tickets * Cost; " dollars" LET is optional
21
Example Program 4 Output
Revenge of the Nerds 4 19 dollars
22
Expressions – Gumball Factory
QBasic Lab Expressions – Gumball Factory
23
Lab: Gumball Factory Objectives Your Program use variables
use QBasic expressions Your Program helps a gumball factory compute the volume of a gumball
24
Gumball Math
25
Lab Requirements Remember: Turn the program & output in to:
you can help other students however, you should figure this out on your own Turn the program & output in to: Lab 3 in SacCT
27
Software Basics What is Software?
28
Software Major Categories
Application Software works with the user to perform a task example: Microsoft Word, Solitaire System Software runs programs & manages data operating System – Windows, Mac-OS Ready to spring to action
29
How Programs are Executed
Compiler translates the program into the processor's instructions Translated program is called object code Interpreter reads through the program executes its own instructions on the processor 9
31
The Categories of Application Software
29
32
Types of Software Document Production
Numerical Analysis – "Number Crunching" Database Reference & Educational Entertainment Emulators
33
Types of Software Internet security Simulators Business
Program Development Music Graphics Video Editing
34
Document Production Software
Broad category that includes software used to create viewable documents Examples: word processing software desktop publishing software web authoring software 30
35
Numerical Analysis Software
designed to primarily perform "number crunching" historically, this was a computer's original job Examples: spreadsheets finance – tax preparation, money management mathematical modeling 44
36
Numerical Analysis: Spreadsheets
grid-based model examples: checkbooks, grades To use spreadsheet software, you: enter numbers indicate how the computer should manipulate those numbers Useful for quick numerical analysis
37
Database Software Database software Examples:
designed to organize information used extensively in all businesses, institutions, etc.... Examples: Microsoft Access My SQL Oracle
38
Educational Software Educational software Examples:
helps users learn and practice new skills can include quizzes, activities, etc... Examples: software to learn reading spoken language software test preparation – SAT, GMAT, LSAT
39
Reference Software Reference software Examples: provides information
helps find and organize data Examples: encyclopedias dictionaries medical software
40
Entertainment Software
any software that is designed to be fun! ...woo hoo! very broad category Some statistics: U.S. computer and video game software sales generated $10.5 billion in 2009 67% of American households play computer or video games In 2010, 26% of Americans over the age of 50 play video games about 40% are women 59
41
Entertainment Software: Games
Role-playing Action Adventure Simulation Sports Puzzle Strategy
42
World of Warcraft 12 million subscribers world wide
Machines running the game 5000 people maintain the game (September 2009) World of Warcraft
43
Emulation Software Emulation software Examples:
software creates a computer inside a computer emulated computer functions exactly like the original excellent for running software when no hardware exists Examples: Vice – Commodore 64 Stella – Atari 2600
44
Stella Atari 2600 Emulator
45
Simulation Software Simulation Software
recreates a real-world device in the computer attempts to act exactly like the original Requires great detail for accuracy Examples: Microsoft Flight Simulator chemistry software
46
Microsoft Flight Simulator X
47
Program Development Software
provides tools used to write software normally includes a compiler or interpreter Examples: Microsoft Visual Studio BlueJ - Java QBasic Lite – yippie! 7
48
Business Software Vertical market software Horizontal market software
software that works for a specific type of business examples: glass mixing software, banking, … Horizontal market software software that any business can use examples: accounting, project management
49
Business Software Groupware
software that helps different companies work together also called collaborative software example: Lotus Notes
50
Graphics Software Graphics software Examples:
lets you edit pictures, drawings, photos, etc... used to enhance applications, websites, documents .... Examples: drawing software photo editing software CAD software (computer-aided design)
51
Inkscape
52
Music Software Audio editing software Examples:
create and edit digital audio and music help write music sheets Examples: ear training software audio encoding software sheet music developers 53
53
Video Software Video Software Examples: designed to play video files
every computer has these Examples: Windows Media Player Real Player QuickTime 55
54
Video Software Video Editing Software Examples:
helps transfer video footage allows video segments to be assembled and edited adds special visual effects and sound tracks Examples: Adobe Premier Microsoft Movie Maker DVD authoring software - create interactive menus 55
56
Software Licenses What Are Your Rights?
57
Software Licenses A software license is a legal contract that defines the ways in which you may use a computer program A shrink-wrap license goes into effect as soon as you open the packaging 71
58
Different Types of Software Licenses
Proprietary software Shareware Freeware Open source software Public domain software 73
59
Proprietary License Proprietary license Variants exist for:
license used by commercial software allows you to use software you purchased this is the most common license used Variants exist for: single users multiple users
60
Shareware License Shareware license Typical attributes of shareware
allows you to test a program for free expected purchase a copy if you want to use it Typical attributes of shareware many shareware applications will "expire" the program may be limited in some way produced documents may be "marked"
61
Freeware License Freeware license Sometimes there are a few rules:
means the software offered without any charge there may be an advanced commercial version Sometimes there are a few rules: you cannot sell the software to others you cannot sue the creator of the software
62
Open Source License Open source license Why open the source?
the source code can be downloaded usually used by programmers Why open the source? multiple programmers can work on it helps find bugs
63
Public Domain License Public domain license Examples
software is not owned by any company or person legally classified as "not copy written" also applies to really, really old software Examples computer science algorithms old, old software
65
The Main System Software
Operating Systems The Main System Software
66
What an Operating System Does
Master controller for all of the activities that take place within a computer Basic Duties: memory management track resources communicate with devices interact with application software interact with the user 14
67
Memory Management Prevent memory leaks Otherwise …
data from one program will overwrite another program or its data data can also be misplaced Otherwise … data can get corrupted programs can “crash” General Protection Fault 16
68
Tracking Resources Remembers the names and locations of all your files
Keeps track of empty spaces where new files can be stored Acts as a filing clerk 17
69
Communicate with Devices
Helps applications work better they do not need to know the details of a device e.g. the brand of printer Scheduling control input and output – order and access some peripherals can only be used by one program at a time – e.g. printers 18
70
Drivers Communicate with Devices
small programs used to communicate with devices usually provided by the manufacturer Why do we need them? devices might be implemented differently the OS cannot know every device beforehand Operating System Driver Device
71
Interact with Applications
Necessary for multi-tasking systems Application Program Interface application can tell the OS to perform a task makes applications faster and smaller the OS can send messages to the application Application OS Driver Device
72
Interact With The User The User Interface Classifications
combination of hardware and software helps users and computers communicate called the shell of the operating system Classifications Graphical User Interface - GUI Command-line User Interface 19
73
Microsoft Windows Created by Microsoft
Major operating system on Intel-PCs Where used: designed for general computer users designed for desktop / laptop PCs
74
Microsoft Windows Major versions: Windows 3.1 – 1991 Windows 95 – 1995
Windows XP – 2001 Windows Vista – 2007 Windows 7 – 2010
75
Windows XP
76
Windows 7 Beta Build 7000
77
Windows 1
78
Linux UNIX was developed in 1969 Linux was developed in 1991
originated AT&T’s Bell Labs used extensively on mainframes Linux was developed in 1991 port to modern computers modern computers are more powerful than 1969 mainframes General Public License (GPL) 25
79
Linux Multiple versions by multiple companies Where used: Red Hat
Ubuntu etc.... Where used: popular as an alternative to Windows mostly used for small servers & CSc workstations
80
Red Hat Linux
81
Ubuntu Linux
82
Apple Mac-OS Created by the Apple Corporation for the Macintosh Computer Major Versions: System 1 – 1984 System 6 – 1988 System 7 – 1991 Mac-OS X – 2001
83
24
84
Handheld Operating Systems
Palm OS came out with the Palm Pilot runs on a numerous PDAs Windows CE CE = Compact Edition simplified version of Windows
85
Android Android: is a mobile operating system initially developed by Android Inc. Android was bought by Google in 2005. Android is based upon a modified version of the Linux kernel Android Market: on-line software store that has 200,000 apps 2.5 billion total downloads.
86
iOS (Apple’s iPhone OS)
iOS (known as iPhone OS prior to June 2010) is Apple's mobile operating system. Originally developed for the iPhone, it has since been extended to support other Apple devices such as the iPod touch, iPad and Apple TV. As of January 14, 2011, Apple's App Store contains more than 300,000 iOS applications. Downloaded more than 10 billion times. In the last quarter of 2010, it had a 16% share of the smartphone operating system market in terms of units sold, third behind Google's Android and Symbian (Nokia).
88
File Basics Understanding Files
89
Logical Storage Metaphor
how files are stored is alien to humans we need to visualize how data is stored this "humanizes" the computer Desktop metaphor the most common metaphor data is stored in files folders store files and other folders
90
Other Common Metaphors
Tree metaphor data is stored in leaves leaves are stored on branches Metaphor can be anything ... that allows "stuff" to be put in other "stuff" other metaphors can exist
91
Microsoft BOB Room Metaphor
92
Microsoft BOB Room Metaphor
93
File Management Utilities
Part of the Operating System "Explorer" in Windows "Finder" in Mac-OS Helps you locate files discover file properties move, copy, rename, delete
94
Data Files Contain words, numbers & pictures Examples:
can be viewed, edited, printed, etc... created with application software Examples: Microsoft Word document Music file – e.g. MP3
95
Executable Files Contains instructions
these instructions run on the processor are basically 1's and 0's These are the application and system software files
96
Scripting Files Data files that are executed Examples:
do not run directly on a processor requires an application to interpret them Examples: JavaScript QBasic data files
97
Active vs. Passive Files
Active files are active – they do something instructions stored in a file Includes scripting files Passive Files they do not instruct the computer they just contain data
99
File Names What's in a label?
100
File Names File-naming Convention
rules that determine if a filename is valid some symbols are not allowed each operating system has one Every file has a name, and might also have a file extension
101
File Extensions File extension describes the file's type
essentially, what the file is used for different file types can have different structures Software often has a native file format QBasic Lite uses qb files Microsoft Word uses doc files
102
Special Symbols in Windows
The period denotes the file extension Files can have multiple periods but only the last one denotes the extension It’s still a good idea not to use periods
103
Example File Name Assignment 1.doc File name Period Extension
104
Some Common Extensions
Description .exe Executable – a Program .doc Microsoft Word Document .mp3 Audio File .txt Text File .qb QBasic Lite File
105
Drives Windows uses a letter to represent secondary storage
A is used for a floppy disk drive C is used for the hard drive D through Z are used for additional storage CD and DVD drive letters vary
106
Moving-Head Disk (hard drive)
107
Folders Files are organized using folders
can contain files or other folders Root directory is the "main" folder the term "directory" is an older term "folder" metaphor came from the GUI
108
Special Symbols in Windows
The colon is used to denote a drive Examples C : D :
109
Special Windows Symbols in Windows
The backslash is used to separate folder names The Internet uses the forward slash "/"
110
C:\My Documents\CSUS\Paper.doc
File Specification Drive Letter File Name C:\My Documents\CSUS\Paper.doc describes the contents Separated by a dot Readme.txt, Newsletter.doc Related to Related to the file format, the arrangement of data in a file, and the coding scheme used to represent the data Most software programs have a native file format that is used to store files They display any files that have the filename extension for its native file format Extension Folders
112
Finding Files on Your Computer
File Patterns Finding Files on Your Computer
113
Pattern Symbols The asterisk is a wildcard character
represents zero-or-more characters essentially matches anything The question mark is the placeholder represents a single character
114
Wildcard Example *.* lab 4.qb report.doc qbasic.exe index.htm
115
Wildcard Example 2 *.doc Assignment 1.doc Recipe.doc
Tappa Kegga Bru.doc CSc 1.doc
116
Wildcard Example 3 CSc?.* CSc1.doc CSc6.htm CSc5.qb CScA.txt
117
Wildcard Example 4 *.htm* index.htm contact.html syllabus.htm
The L was found
118
Pattern in Action *.qb
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.