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.

  1. Display the current date and time
  2. Change to your home directory
  3. Display your current (present) working directory
  4. Display who is logged onto the computer and what they are doing
  5. Change directory to your Programming Environment directory using a relative path
  6. Create a new subdirectory in your Programming Environment directory called A3
  7. Change directory to the A3 directory using a relative path
  8. Create a new subdirectory in your A3 directory called PartB
  9. Change directory to PartB using a relative path
  10. Display your current working directory
  11. Display the names of the files in your PartB directory using a relative path
  12. Display the names of the files in your A3 directory using a relative path
  13. Display the names of the files in your Programming Environment directory using a relative path
  14. Display the names of the files in your Programming Environment directory using an absolute path
  15. Change directory to your home directory using the shortest command available (without using an alias)
  16. Copy all of the files from the Public directory of cjcope's account to the PartB directory you just created using absolute paths
  17. Change directory directly to the PartB directory using a relative path
  18. Display the names of all files in the PartB directory redirecting the output to the file "partBfiles"
  19. Display the contents of the file partBfiles (don't use an editor)
  20. Display the names, permissions, file size (etc) of the files in the PartB directory piping the output to the less command
  21. Display only the names of the files that end in ".txt", in the current directory
  22. Display only the names of the files that start with "H", in the current directory
  23. Display only the names of the files that contain an "e" in any position, in the current directory
  24. Display only the names of the files that contain an "e" as the second character, in the current directory
  25. Use grep to count the number of occurrences of the string "communication" using a case insensitive comparison, in the files in the directory
  26. Display the contents of the file HelloToMe.java using cat
  27. Compile the program
  28. Run the program
  29. Display the permissions (mode) for the file HelloToMe.java
  30. Remove group and other read permissions (mode) for all files in the PartB directory
  31. Display the permissions (mode) for the file lecture17.html (only this file not all files in the directory)
  32. Change directory to the parent directory
  33. 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)
  34. Display the permissions (mode) for the files in the current directory
  35. Change directory to PartB
  36. Copy the file lecture17.html giving the new file the name lect17b.html
  37. Rename the file lect17b.html to lect17c.html
  38. Display the names of the files in your PartB directory
  39. Move lect17c.html to the parent directory using a relative path
  40. Display the names of the files in the parent directory
  41. Remove (delete) the file HelloToMe.java
  42. Remove (delete) all of the files in your PartB directory
  43. Display the names of the files in your PartB directory
  44. Change directory to your home directory
  45. Display the total amount of disk space used in your account (in megabytes, summary only)
  46. Display the amount of disk space free on the Unix systems (showing it in Megabytes) (do NOT use du)
  47. 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:

2. Statement of Authorship

This must contain:

The work will not be marked without a signed statement of authorship.

3. Table of Contents

4. Defining Diagram

5. Pseudo Code

6. Data Dictionary

7. Desk Check

8. Visual Basic Code

The code should:

Copy the code from Access and paste it into your word processed document.

The code listing should:

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

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).