computer science 1 week 4. this week... qbasic programming qbasic programming expressions computer...
TRANSCRIPT
Computer Science 1Week 4
This Week ...This Week ...
• QBasic ProgrammingQBasic Programming ExpressionsExpressions
• Computer ConceptsComputer Concepts Software categoriesSoftware categories Operating SystemsOperating Systems File BasicsFile Basics
QBasicQBasicExpressionsExpressions
Mathematical Equations and MoreMathematical Equations and More
Functions of a Functions of a ComputerComputer
Output Data Store Data
Process Data
ExpressionsExpressions
• QBasic Expressions QBasic Expressions mathematical formulasmathematical formulas follows the format you knowfollows the format you know
• Operator Operator PrecedencePrecedence order in which operators will be order in which operators will be
computedcomputed practically all languages have practically all languages have
precedence levelsprecedence levels
QBasic vs. QBasic vs. Other LanguagesOther Languages
• Not all programming languages have Not all programming languages have the same precedence levelsthe same precedence levels
• They are pretty consistent for basic They are pretty consistent for basic algebraalgebra
• So, make sure to consult the So, make sure to consult the documentationdocumentation
OperatorOperator NameName
^ Exponent
* Multiplication
/ Division
+ Addition
- Subtraction & Unary Minus
Numeric Operators in Numeric Operators in QBasicQBasic
Precedence Levels:Precedence Levels:Highest to LowestHighest to Lowest
Operators Precedence Name
(…) Sub expression
^ Exponent
- Unary Minus
*, / Multiplication & Division
+, - Addition & Subtraction
HighestHighest
LowestLowest
Calculate ResultsCalculate Results
PRINT 11 * 2 + 8 * 4 - 7
PRINT 22 + 32 - 7
PRINT 54 - 7
PRINT 47
PRINT 22 + 8 * 4 - 7
Calculate Results #2Calculate Results #2
PRINT 5 + 18 / 3 ^ 2 * 2 - 1
PRINT 5 + 18 / 9 * 2 - 1
PRINT 5 + 2 * 2 - 1
PRINT 5 + 4 - 1
PRINT 9 - 1
PRINT 8
Calculate Results #3Calculate Results #3
PRINT 7 + 32 / 2 ^ 4 * (3 - 1)
PRINT 7 + 32 / 2 ^ 4 * 2
PRINT 7 + 32 / 16 * 2
PRINT 7 + 2 * 2
PRINT 7 + 4
PRINT 11
Calculate Results Calculate Results With VariablesWith Variables
LET X = 10LET Y = 2PRINT X * 3 + -Y
PRINT X * 3 + -2
PRINT 30 + -2
PRINT 28
DIM X, Y, Z
LET X = 10
LET Y = 6
LET Z = X * 2 – 12 / Y
PRINT "The result:"; Z
Example Program 1Example Program 1
20 2
The result: 18
Example Program 1Example Program 1OutputOutput
DIM X, Y, Z
LET X = 2
LET Y = 5
LET Z = X*Y-(7–4)/3
PRINT "The result is"; Z
Example Program 2Example Program 2
The result is 9
Example Program 2Example Program 2OutputOutput
DIM T1, T2, Ans
LET T1 = 5
LET T2 = 4
LET Ans = T1*T2 + 5 – 6/3
PRINT "Answer:" ; Ans
Example Program 3Example Program 3
Answer: 23
Example Program 3Example Program 3OutputOutput
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
Revenge of the Nerds 4
19 dollars
Example Program 4 Example Program 4 OutputOutput
QBasic LabQBasic Lab
Expressions – Expressions – Gumball FactoryGumball Factory
Lab: Gumball FactoryLab: Gumball Factory
• ObjectivesObjectives use variablesuse variables use QBasic expressionsuse QBasic expressions
• Your ProgramYour Program helps a gumball factory compute helps a gumball factory compute
the volume of a gumballthe volume of a gumball
Gumball MathGumball Math
Lab RequirementsLab Requirements
• Remember:Remember: you can help other studentsyou can help other students however, you should figure this out on your ownhowever, you should figure this out on your own
• Turn the program Turn the program && output in to: output in to: Lab 3 in SacCTLab 3 in SacCT
SoftwareSoftwareBasicsBasics
What is Software?What is Software?
Software Major Software Major CategoriesCategories
• ApplicationApplication Software Software works with the user to perform a taskworks with the user to perform a task example: Microsoft Word, Solitaireexample: Microsoft Word, Solitaire
• SystemSystem Software Software runs programs & manages dataruns programs & manages data operating System – Windows, Mac-OSoperating System – Windows, Mac-OS Ready to spring to action Ready to spring to action
How Programs are How Programs are ExecutedExecuted
• CompilerCompiler translates the program into the processor's translates the program into the processor's
instructionsinstructions Translated program is called Translated program is called object codeobject code
• InterpreterInterpreter reads through the program reads through the program executes its own instructions on the processorexecutes its own instructions on the processor
ApplicationApplicationSoftwareSoftware
The Categories of Application SoftwareThe Categories of Application Software
Types of SoftwareTypes of Software
• Document ProductionDocument Production• Numerical Analysis – "Number Crunching"Numerical Analysis – "Number Crunching"• Database Database • Reference & EducationalReference & Educational• Entertainment Entertainment • EmulatorsEmulators
Types of SoftwareTypes of Software
• Internet securityInternet security• SimulatorsSimulators• Business Business • Program DevelopmentProgram Development• MusicMusic• GraphicsGraphics• Video EditingVideo Editing
Document Production Document Production SoftwareSoftware
• Broad category that includes software Broad category that includes software used to create used to create viewableviewable documents documents
• Examples:Examples: word processing softwareword processing software desktop publishing software desktop publishing software web authoring softwareweb authoring software
Numerical Analysis Numerical Analysis SoftwareSoftware
• Numerical Analysis SoftwareNumerical Analysis Software designed to primarily perform designed to primarily perform "number crunching""number crunching" historically, this was a computer's historically, this was a computer's originaloriginal job job
• Examples: Examples: spreadsheets spreadsheets finance – tax preparation, money managementfinance – tax preparation, money management mathematical modelingmathematical modeling
Numerical Analysis: Numerical Analysis: SpreadsheetsSpreadsheets
• SpreadsheetSpreadsheet grid-based modelgrid-based model examples: checkbooks, gradesexamples: checkbooks, grades
• To use spreadsheet software, you:To use spreadsheet software, you: enter numbersenter numbers indicate how the computer should manipulate indicate how the computer should manipulate
those numbersthose numbers• Useful for quick numerical analysisUseful for quick numerical analysis
Database SoftwareDatabase Software
• Database softwareDatabase software designed to designed to organizeorganize information information used extensively in all businesses, used extensively in all businesses,
institutions, etc....institutions, etc....• Examples:Examples:
Microsoft AccessMicrosoft Access My SQLMy SQL Oracle Oracle
Educational SoftwareEducational Software
• Educational software Educational software helps users learn and practice new skillshelps users learn and practice new skills can include quizzes, activities, etc...can include quizzes, activities, etc...
• Examples:Examples: software to learn readingsoftware to learn reading spoken language softwarespoken language software test preparation – SAT, GMAT, LSATtest preparation – SAT, GMAT, LSAT
Reference SoftwareReference Software
• Reference softwareReference software provides informationprovides information helps find and organize datahelps find and organize data
• Examples:Examples: encyclopediasencyclopedias dictionariesdictionaries medical softwaremedical software
Entertainment Entertainment SoftwareSoftware• Entertainment software:Entertainment software:
any software that is designed to be fun! ...woo hoo!any software that is designed to be fun! ...woo hoo! very broad categoryvery broad category
• Some statistics:Some statistics: U.S. computer and video game software sales generated $10.5 U.S. computer and video game software sales generated $10.5
billion in 2009 billion in 2009 67% of American households play computer or video games 67% of American households play computer or video games In 2010, 26% of Americans over the age of 50 play video games In 2010, 26% of Americans over the age of 50 play video games about 40% are womenabout 40% are women
http://www.theesa.com/facts/index.asphttp://www.theesa.com/facts/index.asp
EntertainmentEntertainmentSoftware: GamesSoftware: Games
• Role-playingRole-playing• ActionAction• AdventureAdventure• SimulationSimulation• SportsSports• Puzzle Puzzle • StrategyStrategy
World of WarcraftWorld of Warcraft
Emulation SoftwareEmulation Software
• Emulation softwareEmulation software software creates a computer software creates a computer inside inside a computera computer emulated computer functions emulated computer functions exactlyexactly like the original like the original excellent for running software when no hardware existsexcellent for running software when no hardware exists
• Examples:Examples: Vice – Commodore 64Vice – Commodore 64 Stella – Atari 2600Stella – Atari 2600
StellaAtari 2600 Emulator
StellaAtari 2600 Emulator
Simulation SoftwareSimulation Software
• Simulation SoftwareSimulation Software recreates a real-world device in the computerrecreates a real-world device in the computer attempts to act attempts to act exactlyexactly like the original like the original
• Requires great detail for accuracyRequires great detail for accuracy• Examples:Examples:
Microsoft Flight SimulatorMicrosoft Flight Simulator chemistry softwarechemistry software
Microsoft Flight Simulator XMicrosoft Flight Simulator X
Program Development Program Development SoftwareSoftware
• Program Development SoftwareProgram Development Software provides tools used to write softwareprovides tools used to write software normally includes a compiler or interpreternormally includes a compiler or interpreter
• Examples:Examples: Microsoft Visual StudioMicrosoft Visual Studio BlueJ - JavaBlueJ - Java QBasic LiteQBasic Lite – yippie! – yippie!
Business SoftwareBusiness Software
• Vertical market softwareVertical market software software that works for a software that works for a specificspecific type of business type of business examples: glass mixing software, banking, …examples: glass mixing software, banking, …
• Horizontal market softwareHorizontal market software software that software that anyany business can use business can use examples: accounting, project managementexamples: accounting, project management
Business SoftwareBusiness Software
• GroupwareGroupware software that helps different companies work software that helps different companies work
togethertogether also called also called collaborative softwarecollaborative software example: Lotus Notesexample: Lotus Notes
Graphics SoftwareGraphics Software
• Graphics softwareGraphics software lets you edit pictures, drawings, photos, etc...lets you edit pictures, drawings, photos, etc... used to enhance applications, websites, used to enhance applications, websites,
documents ....documents ....• Examples:Examples:
drawing softwaredrawing software photo editing softwarephoto editing software CAD software (computer-aided design)CAD software (computer-aided design)
InkscapeInkscape
Music SoftwareMusic Software
• Audio editing softwareAudio editing software create and edit digital audio and musiccreate and edit digital audio and music help write music sheetshelp write music sheets
• Examples:Examples: ear training softwareear training software audio encoding softwareaudio encoding software sheet music developerssheet music developers
Video SoftwareVideo Software
• Video SoftwareVideo Software designed to play video filesdesigned to play video files every computer has theseevery computer has these
• Examples:Examples: Windows Media PlayerWindows Media Player Real PlayerReal Player QuickTimeQuickTime
Video SoftwareVideo Software
• Video Editing SoftwareVideo Editing Software helps transfer video footagehelps transfer video footage allows video segments to be assembled and editedallows video segments to be assembled and edited adds special visual effects and sound tracksadds special visual effects and sound tracks
• Examples:Examples: Adobe PremierAdobe Premier Microsoft Movie MakerMicrosoft Movie Maker DVD authoring softwareDVD authoring software - create interactive menus - create interactive menus
Software Software LicensesLicenses
What Are Your Rights?What Are Your Rights?
Software LicensesSoftware Licenses
• A A software licensesoftware license is a legal contract is a legal contract that defines the ways in which you may that defines the ways in which you may use a computer programuse a computer program
• A A shrink-wrapshrink-wrap license goes into effect license goes into effect as soon as you open the packagingas soon as you open the packaging
Different Types of Different Types of Software LicensesSoftware Licenses
• Proprietary softwareProprietary software• Shareware Shareware • Freeware Freeware • Open source softwareOpen source software• Public domain softwarePublic domain software
Proprietary LicenseProprietary License
• Proprietary licenseProprietary license license used by commercial softwarelicense used by commercial software allows you to use software you purchasedallows you to use software you purchased this is the most common license usedthis is the most common license used
• Variants exist for:Variants exist for: single userssingle users multiple usersmultiple users
Shareware LicenseShareware License
• Shareware license Shareware license allows you to test a program for freeallows you to test a program for free expected purchase a copy if you want to use itexpected purchase a copy if you want to use it
• Typical attributes of sharewareTypical attributes of shareware many shareware applications will "expire"many shareware applications will "expire" the program may be limited in some waythe program may be limited in some way produced documents may be "marked"produced documents may be "marked"
Freeware LicenseFreeware License
• Freeware licenseFreeware license means the software offered without any chargemeans the software offered without any charge there may be an advanced commercial versionthere may be an advanced commercial version
• Sometimes there are a few rules:Sometimes there are a few rules: you cannot sell the software to othersyou cannot sell the software to others you cannot sue the creator of the softwareyou cannot sue the creator of the software
Open Source LicenseOpen Source License
• Open source licenseOpen source license the source code can be downloadedthe source code can be downloaded usually used by programmersusually used by programmers
• Why open the source?Why open the source? multiple programmers can work on itmultiple programmers can work on it helps find bugshelps find bugs
Public Domain Public Domain LicenseLicense
• Public domain licensePublic domain license software is not owned by any company or person software is not owned by any company or person legally classified as "not copy written"legally classified as "not copy written" also applies to really, really old software also applies to really, really old software
• ExamplesExamples computer science algorithmscomputer science algorithms old, old softwareold, old software
OperatingOperatingSystemsSystems
The Main System SoftwareThe Main System Software
What an Operating What an Operating System DoesSystem Does
• Master controller for all of the activities that Master controller for all of the activities that take place within a computertake place within a computer
• Basic Duties:Basic Duties: memory managementmemory management track resourcestrack resources communicate with devicescommunicate with devices interact with application softwareinteract with application software interact with the userinteract with the user
Memory ManagementMemory Management
• Prevent memory Prevent memory leaksleaks data from one program will overwrite data from one program will overwrite
another program or its dataanother program or its data data can also be misplaceddata can also be misplaced
• Otherwise …Otherwise … data can get corrupteddata can get corrupted programs can “programs can “crashcrash”” General Protection FaultGeneral Protection Fault
Tracking ResourcesTracking Resources
• Remembers the names and locations of Remembers the names and locations of all your filesall your files
• Keeps track of empty spaces where Keeps track of empty spaces where new files can be storednew files can be stored
• Acts as a filing clerkActs as a filing clerk
Communicate with Communicate with DevicesDevices
• Helps applications work betterHelps applications work better they do not need to know the details of a devicethey do not need to know the details of a device e.g. the brand of printere.g. the brand of printer
• SchedulingScheduling control input and output – order and accesscontrol input and output – order and access some peripherals can only be used by one some peripherals can only be used by one
program at a time – e.g. printersprogram at a time – e.g. printers
Drivers Communicate Drivers Communicate with Deviceswith Devices
• DriversDrivers small programs used to communicate with devicessmall programs used to communicate with devices usually provided by the manufacturerusually provided by the manufacturer
• Why do we need them?Why do we need them? devices might be implemented differentlydevices might be implemented differently the OS cannot know every device beforehandthe OS cannot know every device beforehand Operating System Operating System Driver Driver Device Device
Interact with Interact with ApplicationsApplications
• Necessary for multi-tasking systemsNecessary for multi-tasking systems • AApplication pplication PProgram rogram IInterfacenterface
application can tell the OS to perform a taskapplication can tell the OS to perform a task makes applications faster and smallermakes applications faster and smaller the OS can send messages to the applicationthe OS can send messages to the application
• Application Application OS OS Driver Driver Device Device
Interact With The UserInteract With The User
• The User InterfaceThe User Interface combination of hardware combination of hardware andand software software helps users and computers communicatehelps users and computers communicate called the called the shellshell of the operating system of the operating system
• ClassificationsClassifications GGraphical raphical UUser ser IInterface - nterface - GUIGUI Command-line User InterfaceCommand-line User Interface
Microsoft WindowsMicrosoft Windows
• Created by MicrosoftCreated by Microsoft• Major operating system on Intel-PCsMajor operating system on Intel-PCs• Where used:Where used:
designed for general computer usersdesigned for general computer users designed for desktop / laptop PCsdesigned for desktop / laptop PCs
Microsoft WindowsMicrosoft Windows
• Major versions:Major versions: Windows 3.1 – 1991Windows 3.1 – 1991 Windows 95 – 1995Windows 95 – 1995 Windows XP – 2001Windows XP – 2001 Windows Vista – 2007Windows Vista – 2007 Windows 7 – 2010Windows 7 – 2010
Windows XP
Windows 7Beta Build 7000
Windows 7Beta Build 7000
Windows 1
LinuxLinux
• UNIX was developed in UNIX was developed in 19691969 originated AT&T’s Bell Labsoriginated AT&T’s Bell Labs used extensively on mainframesused extensively on mainframes
• Linux was developed in Linux was developed in 19911991 port to modern computersport to modern computers modern computers are more powerful than 1969 modern computers are more powerful than 1969
mainframesmainframes General Public License (GPL)General Public License (GPL)
LinuxLinux
• Multiple versions by multiple companiesMultiple versions by multiple companies Red HatRed Hat UbuntuUbuntu etc....etc....
• Where used:Where used: popular as an alternative to Windowspopular as an alternative to Windows mostly used for small servers & CSc workstationsmostly used for small servers & CSc workstations
Red Hat Linux
Ubuntu Linux
Apple Mac-OSApple Mac-OS
• Created by the Apple Corporation for the Created by the Apple Corporation for the Macintosh ComputerMacintosh Computer
• Major Versions:Major Versions: System 1 – 1984System 1 – 1984 System 6 – 1988System 6 – 1988 System 7 – 1991System 7 – 1991 Mac-OS X – 2001Mac-OS X – 2001
Handheld Operating Handheld Operating SystemsSystems
• Palm OSPalm OS came out with the Palm Pilotcame out with the Palm Pilot runs on a numerous PDAsruns on a numerous PDAs
• Windows CEWindows CE CE = Compact EditionCE = Compact Edition simplified version of Windowssimplified version of Windows
AndroidAndroid
• Android: Android: is a is a mobile operating system mobile operating system initially initially
developed by Android Inc. Android developed by Android Inc. Android was bought by was bought by GoogleGoogle in 2005. in 2005.
Android is based upon a modified Android is based upon a modified version of the version of the Linux kernelLinux kernel
Android Market: on-line software Android Market: on-line software store that has store that has 200,000 apps200,000 apps
2.5 billion 2.5 billion total downloads.total downloads.
iOS (iOS (Apple’s iPhone OSApple’s iPhone OS))
iOSiOS (known as (known as iPhone OSiPhone OS prior to June 2010) is prior to June 2010) is AppleApple's mobile operating system. Originally 's mobile operating system. Originally developed for the developed for the iPhone, it has since been , it has since been extended to support other Apple devices such as extended to support other Apple devices such as the the iPod touchiPod touch, , iPadiPad and and Apple TV.Apple TV.
As of January 14, 2011, Apple's As of January 14, 2011, Apple's App Store App Store contains more than 300,000 iOS applications. contains more than 300,000 iOS applications.
Downloaded more than Downloaded more than 10 billion times10 billion times. . In the last quarter of 2010, it had a 16% share of In the last quarter of 2010, it had a 16% share of
the the smartphone operating system market in terms operating system market in terms of units sold, third behind Google's of units sold, third behind Google's AndroidAndroid and and Symbian (Nokia).Symbian (Nokia).
File BasicsFile Basics
Understanding FilesUnderstanding Files
Logical Storage Logical Storage MetaphorMetaphor
• Logical Storage MetaphorLogical Storage Metaphor how files are stored is alien to humanshow files are stored is alien to humans we need to visualize how data is storedwe need to visualize how data is stored this "humanizes" the computerthis "humanizes" the computer
• Desktop metaphorDesktop metaphor the most common metaphorthe most common metaphor data is stored in data is stored in filesfiles foldersfolders store files and other foldersstore files and other folders
Other Common Other Common MetaphorsMetaphors
• Tree metaphorTree metaphor data is stored in leavesdata is stored in leaves leaves are stored on branchesleaves are stored on branches
• Metaphor can be anythingMetaphor can be anything ... that allows "stuff" to be put in ... that allows "stuff" to be put in
other "stuff"other "stuff" other metaphors can existother metaphors can exist
Microsoft BOBRoom Metaphor
Microsoft BOBRoom Metaphor
Microsoft BOBRoom Metaphor
Microsoft BOBRoom Metaphor
File Management File Management UtilitiesUtilities
• Part of the Operating SystemPart of the Operating System "Explorer" in Windows"Explorer" in Windows "Finder" in Mac-OS"Finder" in Mac-OS
• Helps youHelps you locate fileslocate files discover file propertiesdiscover file properties move, copy, rename, delete move, copy, rename, delete
Data FilesData Files
• Contain words, numbers & picturesContain words, numbers & pictures can be viewed, edited, printed, etc...can be viewed, edited, printed, etc... created with application softwarecreated with application software
• Examples:Examples: Microsoft Word documentMicrosoft Word document Music file – e.g. MP3Music file – e.g. MP3
Executable FilesExecutable Files
• Contains instructions Contains instructions these instructions run on the processorthese instructions run on the processor are basically 1's and 0'sare basically 1's and 0's
• These are the These are the applicationapplication and and systemsystem software filessoftware files
Scripting FilesScripting Files
• Data files that are executedData files that are executed do not run directly on a processordo not run directly on a processor requiresrequires an application to interpret them an application to interpret them
• Examples:Examples: JavaScriptJavaScript QBasic data filesQBasic data files
Active vs. Passive Active vs. Passive FilesFiles
• Active files Active files are are activeactive – they – they dodo something something instructions stored in a file instructions stored in a file Includes scripting filesIncludes scripting files
• Passive FilesPassive Files they they do notdo not instruct the computer instruct the computer they just contain datathey just contain data
Cook, CSc 1, Spring 2009, Sacramento State
File NamesFile Names
What's in a label?What's in a label?
File NamesFile Names
• File-naming ConventionFile-naming Convention rules that determine if a filename is validrules that determine if a filename is valid some symbols are not allowedsome symbols are not allowed each operating system has one each operating system has one
• Every file has a name, and might also Every file has a name, and might also have a have a file extensionfile extension
File ExtensionsFile Extensions
• File extension describes the file's typeFile extension describes the file's type essentially, what the file is used foressentially, what the file is used for different file types can have different structuresdifferent file types can have different structures
• Software often has a Software often has a native file formatnative file format QBasic Lite uses QBasic Lite uses qbqb files files Microsoft Word uses Microsoft Word uses docdoc files files
Special Symbols in Special Symbols in WindowsWindows
• The period denotes the The period denotes the file file extensionextension
• Files can have multiple periodsFiles can have multiple periods but only the last one denotes the but only the last one denotes the
extensionextension It’s still a good idea not to use It’s still a good idea not to use
periodsperiods
Assignment 1.docAssignment 1.doc
Example File Name Example File Name
File name ExtensionPeriod
Some Common Some Common ExtensionsExtensions
Extension Description
.exe Executable – a Program
.doc Microsoft Word Document
.mp3 Audio File
.txt Text File
.qb QBasic Lite File
DrivesDrives
• Windows uses a letter to represent Windows uses a letter to represent secondary storagesecondary storage AA is used for a floppy disk drive is used for a floppy disk drive CC is used for the hard drive is used for the hard drive DD through through ZZ are used for additional storage are used for additional storage
• CD and DVD drive letters varyCD and DVD drive letters vary
Cook, CSc 1, Spring 2009, Sacramento State
Moving-Head Disk (Moving-Head Disk (hard drivehard drive) )
FoldersFolders
• Files are organized usingFiles are organized using folders folders can contain filescan contain files or other foldersor other folders
• Root directoryRoot directory is the "main" folder is the "main" folder the term "directory" is an older termthe term "directory" is an older term "folder" metaphor came from the GUI"folder" metaphor came from the GUI
Special Symbols in Special Symbols in WindowsWindows
• The colon is used to denote The colon is used to denote a drive a drive
• ExamplesExamples C C :: D D ::
Special Windows Special Windows Symbols in WindowsSymbols in Windows
• The backslash is used to The backslash is used to separate folder namesseparate folder names
• The Internet uses the The Internet uses the forward slash "/"forward slash "/"
File SpecificationFile Specification
C:\My Documents\CSUS\Paper.docC:\My Documents\CSUS\Paper.doc
Drive Letter File Name
Folders Extension
File PatternsFile Patterns
Finding Files on Your ComputerFinding Files on Your Computer
Pattern SymbolsPattern Symbols
• The asterisk is a The asterisk is a wildcardwildcard character character represents zero-or-more charactersrepresents zero-or-more characters essentially matches anythingessentially matches anything
• The question mark is the The question mark is the placeholderplaceholder represents a single characterrepresents a single character
lab 4.qbreport.docqbasic.exeindex.htm
lab 4.qbreport.docqbasic.exeindex.htm
Wildcard ExampleWildcard Example
*.**.*
Assignment 1.docRecipe.docTappa Kegga Bru.docCSc 1.doc
Assignment 1.docRecipe.docTappa Kegga Bru.docCSc 1.doc
Wildcard Example 2Wildcard Example 2
*.doc*.doc
CSc1.docCSc6.htmCSc5.qbCScA.txt
CSc1.docCSc6.htmCSc5.qbCScA.txt
Wildcard Example 3Wildcard Example 3
CSc?.*CSc?.*
index.htmcontact.htmlsyllabus.htm
index.htmcontact.htmlsyllabus.htm
Wildcard Example 4Wildcard Example 4
*.htm**.htm*
The L was found
Pattern in ActionPattern in Action
*.qb