Assignment 3
Home
Due Date: 4pm, Friday 30-May-08 (week 13)
Marks: 12%
Part A - Software Development (8%)
Problem Description
A product is required to calculate the cost of sending a parcel by courier. The cost depends on two factors - the weight of the parcel and the distance the parcel is to travel. The weight factor is applied first. Parcels under 2.5kgs cost $3.50 per kg. Parcels between 2.5 and 5kgs inclusive cost $5.85 per kg. Parcels over 5kgs cost $12.45. Parcels above 60kgs are not accepted. A distance factor applies to parcels that must travel more than 500kms. Up to and including 1000kms the cost is increased by 25%. Above 1000kms the cost is increased by 50%.
Construct an easy to use and maintain product using Access Basic that makes full use of subroutines.
Assume any distance entered is valid but not the weight of a parcel. The weight must be validated to be between 0.1kgs and 60kgs inclusive. The validation must take place in a subroutine and use a local
boolean variable.
Use the Round function to convert the cost to 2 decimal places. Use a Format function to display the cost with a leading $ sign and a comma where appropriate.
Example Run
Welcome to the Parcel Cost Calculator
Do you wish to have a parcel delivered (Y or N)? P
Error: You should enter Y or N
Do you wish to have a parcel delivered (Y or N)? Y
Enter weight of parcel (0.1 to 60 kgs)? 64
Error: Weight should be between 0.1 and 60kgs
Enter weight of parcel (0.1 to 60 kgs)? 2.4
Enter distance parcel is to travel to the nearest Km? 500
--------------------------------------------
Parcel Cost Calculator
Weight: 2.4kgs Distance: 500kms
Cost: $8.40
--------------------------------------------
Do you wish to have a parcel delivered (Y or N)? Y
Enter weight of parcel (0.1 to 60 kgs)? 5
Enter distance parcel is to travel to the nearest Km? 1000
--------------------------------------------
Parcel Cost Calculator
Weight: 5kgs Distance: 1000kms
Cost: $36.56
--------------------------------------------
Do you wish to have a parcel delivered (Y or N)? Y
Enter weight of parcel (0.1 to 60 kgs)? 54.5
Enter distance parcel is to travel to the nearest Km? 1200
--------------------------------------------
Parcel Cost Calculator
Weight: 54.5kgs Distance: 1200kms
Cost: $1,017.79
--------------------------------------------
Do you wish to have a parcel delivered (Y or N)? N
Thanks for using the Parcel Cost Calculator
Part B - Unix (4%)
You are required to demonstrate your understanding of some commonly used Unix commands.
I suggest that you investigate the commands required, write them down and do
a practice run before doing your final answer to this question.
You are to hand in a word processed list of commands and the output of the commands
(if any). The commands are to be numbered and in bold. The result
of each command should be shown below the command. Include a blank line before
each command to make it easier to read. Cut and paste the command and the result
of the command into your document (this can be done one by one or a group of
commands at a time). Don't include the command prompt for each command. When
printing the document ensure that the commands and their results have a non-proportional
(monospaced) font like courier new and lines don't wrap.
Your command listing would be formatted as shown below. For the commands below
the listing would start off something like:
1. date
Wed Apr 23 08:53:02 EST 2008
2. cd
3. pwd
/Users/cjcope
4. w
08:49:52 up 32 days, 17:25, 2 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
psc pts/1 bindi.bendigo.la 16May07 6days 0.02s 0.02s -bash
cope pts/2 cope.bendigo 08:49 0.00s 0.04s 0.00s w
etc...
Log onto your Unix account.
- Display the current date and time
- Change to your home directory
- Display your current (present) working directory
- Display who is logged onto the computer and what they are doing
- Change directory to your Programming Environment directory using a relative path
- Create a new subdirectory in your Programming Environment directory called
A3
- Change directory to the A3 directory using a relative path
- Create a new subdirectory in your A3 directory called PartB
- Change directory to PartB using a relative path
- Display your current working directory
- Display the names of the files in your PartB directory using a relative path
- Display the names of the files in your A3 directory using a relative path
- Display the names of the files in your Programming Environment directory using
a relative path
- Display the names of the files in your Programming Environment directory using
an absolute path
- Change directory to your home directory using the shortest command available
(without using an alias)
- Copy all of the files from the Public directory of cjcope's account to the PartB directory you just created using absolute paths
- Change directory directly to the PartB directory using a relative path
- Display the names of all files in the PartB directory redirecting the output
to the file "partBfiles"
- Display the contents of the file partBfiles (don't use an editor)
- Display the names, permissions, file size (etc) of the files in the PartB directory
piping the output to the less command
- Display only the names of the files that end in ".txt", in the current
directory
- Display only the names of the files that start with "H", in the current
directory
- Display only the names of the files that contain an "e" in any position,
in the current directory
- Display only the names of the files that contain an "e" as the second
character, in the current directory
- Use grep to count the number of occurrences of the string "communication"
using a case insensitive comparison, in the files in the directory
- Display the contents of the file HelloToMe.java using cat
- Compile the program
- Run the program
- Display the permissions (mode) for the file HelloToMe.java
- Remove group and other read permissions (mode) for all files in the PartB directory
- Display the permissions (mode) for the file lecture17.html (only this file not
all files in the directory)
- Change directory to the parent directory
- Change the permissions on the PartB directory so that any user could read files
in the PartB directory (assuming that directories above this allow access - this
is not required for this question)
- Display the permissions (mode) for the files in the current directory
- Change directory to PartB
- Copy the file lecture17.html giving the new file the name lect17b.html
- Rename the file lect17b.html to lect17c.html
- Display the names of the files in your PartB directory
- Move lect17c.html to the parent directory using a relative path
- Display the names of the files in the parent directory
- Remove (delete) the file HelloToMe.java
- Remove (delete) all of the files in your PartB directory
- Display the names of the files in your PartB directory
- Change directory to your home directory
- Display the total amount of disk space used in your account (in megabytes,
summary only)
- Display the amount of disk space free on the Unix systems (showing it in Megabytes)
(do NOT use du)
- Remove the directory A3 and all files and subdirectories in it.
Sections Required
The assignment should be word processed with each page numbered. Suggested left
margin 2.5cm, right margin a minimum of 1cm.
The following sections are required, (in this order).
1. Title Page
This should contain:
- your name
- subject name
- tutorial group
- tutor's name
- assignment number
- submission date
2. Statement of Authorship
This must contain:
- the standard text for a Statement of Authorship for the Department
- your name
- subject name
- assignment number
- your signature
- date signed
The work will not be marked without a signed statement of authorship.
3. Table of Contents
- List all the major sections in the assignment and the page numbers they occur
on.
4. Defining Diagram
- As specified in class and the Defining Diagram Guide.
5. Pseudo Code
- As specified in class and the Pseudo Code Guide.
6. Data Dictionary
- As specified in class and the Data Dictionary Guide. Where possible the data
dictionary should appear on the same page as the pseudo code.
7. Desk Check
- As specified in the Desk Check Guide.
- Provide a Desk Check for the Example Run.
8. Visual Basic Code
The code should:
- match the logic specified in the Pseudo Code
- the code should be easy to read and understand. It should be
- well formatted (e.g. correct indentation, a blank line between sections)
- well commented. This should include comments about the program: program
name, purpose, author; comments describing each variable and comments on
each section of the program.
- have meaningful variable names
- have Option Explicit
Copy the code from Access and paste it into your word processed document.
The code listing should:
- be readable
- be in a monospaced (non-proportional) font (Courier New preferred)
- use a font size of 9 or10pt
- avoid line wrapping (use a small right margin if necessary)
You must include a statement indicating whether the code listed successfully
compiled (no syntax errors).
Example statement: "The code listed below compiled successfully." or "The
code listed below did NOT compile."
9. Test Runs
- Provide printouts of input and output for the Example Run.
- To capture the current Window, ensure that the window is selected (e.g. place
the cursor in the desired window) and press Alt+Print Screen. This can
then be pasted from the Windows Cut/Paste buffer into the desired document (such
as Word).
- To provide a printout of the test runs, capture each window separately. To
capture the Immediate window rather than the whole Access window, you
need to undock it. To do this Right mouse click on the Immediate window
and select Dockable (only if it doesn't already have a tick next to
it), the Immediate window should now be a floating separate window that
can be captured by itself.
Your runs must be made using the program listed in the previous section. You
must include a statement indicating that the printouts of input and output are for your program
as listed in the previous section.
Example statement: "The program runs below are the output of the program listed
in the previous section."
10. Unix
See Part B - Unix section earlier in the assignment.
Guide to Marks on Part A
The following is a guide to the marks assigned to each section of the assignment.
| Section Name |
Percentage of Marks |
| Presentation |
5% |
| Defining Diagram |
10% |
| Pseudo Code |
40% |
| Data Dictionary |
5% |
| Desk Check |
10% |
| Access Basic Code |
25% |
| Test Plan & Runs |
5% |
Written by Chris Cope (and Tim Whitfort).