Title: Introduction to Business Computing 8
1Introduction to Business Computing (8)
- Revision of Last Week Programming
- Basic Program Structures
- Input and Output
- Rexx practical
- Week 8 Focus
- Consolidating Rexx previous exam question
- Sharing data Permissions
- Introduction to Databases
- Assignment workshop Spreadsheet problem
2Consolidating Rexx
- You can write any program with these structures
Sequential instructions
One or both of the loops
If..Then..Else
(in a Counting loop, something includes
incrementing the counter)
3Program Approach
- Decide what the program has to do
- And what it wont do
- Break up the problem into manageable chunks
- Key part of the design process
- Also need to define communication between the
chunks - Usually in the form of data they share
- Though best done with explicit messages
- Analysis is usually from the top down, for
example - Produce headings
- Print a line for each table
- Next stage is to write code to build up the line
4Output
- Tables problem taught you these main concepts
- Construct a line before SAYing it
- Any line can be built up by stages
- Parts of the line can be forced to a fixed width
with RIGHT(what, howlong) or LEFT of course - Optional example
- Produce a bar-chart of the first 8 squares
- Something like
- 1
- 2
- 3
- 4 ... and so on
5Parsing Input
- Simple way to analyse data from the keyboard
- Parse Pull x y z takes data from external input
stream and pours it into variables x y and z - First token of the input goes into x
- Next token goes into y
- All the rest goes into z (note, this time we
keep spaces) - So if you type The quick brown fox
- x will contain The
- y will contain quick
- and z will contain brown fox
6Experimenting with Parse
- You can write a program that takes keyboard input
and plays it back to you in a parsed form - Insert some character around output to highlight
blanks - Make the whole thing a loop so it keeps on
working - Provide an escape from the loop!
- Example
- Say "Enter lines of text, ending with end"
- Do Until t1"end"
- Parse Pull t1 t2 t3
- Say "gt"t1"ltgt"t2"ltgt"t3"lt"
- End
- Note what happens to multiple blanks in your input
7Arrays
- Often we want to define a variable that holds a
series of things - For example, could have tables containing name
and room number - On each line, name goes with room
- If we find name on cell 4 of names
- ..room is in cell 4 of room-numbers
- Most languages let you do this
- Usually with an index in brackets
- e.g. Names(i) where i is a number
- Rexx uses a dot Names.i
8Previous Exam Question (1)
- Used stemmed variables (arrays) to hold currency
names and exchange rates - / initialization /
- ncurr 4 / num of national currencies /
- currency.0 "euro"
- rate.0 1 / there is one euro per euro! /
- currency.1 "UK Pound"
- currency.2 "US dollar"
- currency.3 "DM / frCH might be better /
- currency.4 "FF / and maybe CzK /
- Now we can ask for rate.1 through to rate.ncurr
9Previous Exam Question (2)
- Program was written and tested
- Then I broke it by changing some statements
- Each defect generates a different error message
- You shouldnt find them hard to find and fix
- Fixing is what programmers do much of the time!
- To tackle the question, download REXXQ.zip from
http//cmg.wkac.ac.uk/courses/samples/ and unzip
it - That is, extract the contents of the zip file
- Text of question is in the handout BS1005w6.doc
at http//cmg.wkac.ac.uk/courses/bs1005 - Easy links to both are provided on the BS1005
home-page - Ask if you have a problem
10Sharing and Permissions
11Sharing and Permissions
- For any disk, we want to be able to control who
can read and write to it and who can assign
access - Owner will normally want full control
- Users need ability to read and execute
applications in shared directories - Normal users must not erase or change system
files.. - .. Or my files!
- Two basic approaches to permission
- Passwords
- User/Group permissions
12Passwords
- Password is like a key with it, anyone can get
in - Not secure
- Everyone requiring access needs to know password
- It only needs one of them to leak the password
- Often involves password moving in clear over
network - Tedious
- Either have to provide password every time..
- .. or run risk of workstation being taken over by
another(particularly problematic on remote
access systems) - Windows networking uses an encrypted password
file - You type a password at logon to unlock this file
- Windows then provides passwords as theyre needed
13Specific Permission
- Data owner permits specified people to access
file - Guardian at the gate avoids need for passwords
- Permits them to run, read, write, delete or
assign permission - Its tedious to have to list every permitted user
- Therefore collect them into groups
- Assign permission by group
- Limit Administrator group (members can do
anything) - Basis of security in
- Windows NT and Windows 2000
- System/390 mainframes RACF on MVS and VM
- Unix systems (including Linux)
14How it Works at KAC
- Large servers own most disk storage on campus
- Most user and application disks are on HOMESERV
- Desktop machines contain space for the Operating
System and working storage - User logon provides Create/Write/Read/Delete
access to that users share on the server - Also provides Read access to system resources
- K-drive contains Microsoft Office etc.
- Server holds both ITCS-supported and other
software
15Databases
- Introduction
- (You will get more detail next semester)
16Why use a database?
- Its difficult to find information in
unstructured data - Hierarchical organization helps analogous to
putting letters into a file folder - Card index is traditional means to hold
structured data - Cards are sorted according to key
- Structure of other data isnt really exploited in
normal cards - Structuring usually into records and fields
- Record consists of fields for each category of
information - Address-book fields could be name, address,
phone, fax... - Databases extend sorting to any defined field
- Structuring address lets you sort on town,
postcode etc.
17Simple databases
- All databases exist to help one collect, organize
and retrieve data - Simplest form is Flat File database
- This consists of a single table in one DOS file
- one record per row
- one column per field
- Usually offers
- sorting by any column where this has any
meaning - form view helps you input data and look at
detail - list view to summarize or print multiple
records - Examples Works database (from Microsoft, Claris)
18Limits of Flat files
- Every record scanned in every sort operation
- Multiple scans for complex sorting such as Work
within category within Composer - Updates can involve second copy of entire
database - Gets very slow when database size grows
- Hard to relate different databases, for example
- Have database of purchases by customer
- Customers are also on Address database
- How do we see whats been selling in PO postcode
area?
PRODUCT CUSTOMER Grommets Bloggs Ltd Wickets P
Vole Inn Zummats Aardvark Co Zummats Bloggs Ltd
CUSTOMER ADDRESS Aardvark Co Banbury OX18
2AI Bloggs Ltd Fareham PO15 1JB P Vole
Inn Heckmondwyke HX13 3PV
19Relational Databases
- Consist of Tables or Relations
- each data element relates the row (record, tuple)
its in, - with the column (field, domain) that describes
its category - Relational Database Management Systems (RDBMS)
implement SQL (Structured Query Language) - SELECT sales.PRODUCT sales.CUSTOMERFROM lttable
database namegtWHERE sales.PRODUCTGrommetORDER
BY sales.CUSTOMER - JOIN tables that share a column to produce a new
one
PRODUCT CUSTOMER ADDRESS Zummats Aardvark
Co Banbury OX18 2AI Grommets Bloggs Ltd Fareham
PO15 1JB Zummats Bloggs Ltd Fareham PO15
1JB Wickets P Vole Inn Heckmondwyke HX13 3PV
20Spreadsheet Assignment
- Due next Thursday, November 28 (Week 9)
- Deliverables
- Succinct and focused initial specification,
stating what the system will do and what it will
not do (10) - Clear description of the initial design proposed
(20) - Project report (25) including
- The final spreadsheet produced (25)
- (paper diskette)
- Bonus for ambitious projects (20)
- A simple project would get 10 marks
- Fantastic complexity won't earn more than 20
- Safer to do a simple job well than a complex one
badly!
21Project report
- Your report should include
- how the project was broken down into subsections,
- how the sections were developed,
- what experimentation or testing was undertaken,
and - what problems were met and how they were overcome
- Reflective summary of how far you got with the
project - Gives you a chance to say what other things youd
have done given sufficient time - Dont go crazy
- its only worth 25 of half the module marks
- 500-750 words should suffice
- No penalty or credit for overlong reports