OPS435: Assignment #2
HAND-IN REQUIREMENTS:
General Description |
Create a graphical Bash shell script to view purchases, to contact vendors, as well as to make payments against outstanding purchase balances. |
Due Date |
Wednesday August 10, 2011 @ 11:59:59 p.m. |
OVERVIEW / GENERAL REQUIREMENTS:
You have been approached by the "purchasing department" to write a portable Bash shell script called makePayments.bash
to use graphical method of viewing purchasing information, and making payments against outstanding vendor balances. Vendors are companies
that we have purchased goods and services from and may owe them money. In order to make the shell script graphical, you need to study how to use the Zenity command. Refer to the HINTS / TIPS section below to learn how to use the Zenity command.
The purchasing department already has an employee that records vendor purchases into a purhchases file, so we don't have to worry about recording vendor purchases.
What we need to do is create a graphical program that reads the purchases file to generate reports, and record payments
towards outstanding vendor balances. You can assume that if there are multiple purchases for the same vendor, the outstanding balance grows for that one vendor record.
The layout for the purchases file will always consist of the same format: a four-field,
colon-separated database file containing the following field sequence:
Your shell script will
only accept one argument: a valid 4 field, colon-separated purchases database file pathname. This filename
could be ANY filename, as long as it is a valid database. If the shell script is issued
correctly, then the following graphical menu will appear. This menu will continue
to loop until the user selects "Exit". |
![]() Diagram of Main Menu for Making Selections |
DETAILED REQUIREMENTS:
DISPLAY PURCHASES: MAKE A PAYMENT: CONTACT VENDOR: SAMPLE DATABASE:
[ purchases.dat ] Exact Database used in YouTube SAMPLE RUNS. Copy and paste to a file called: purchases.dat SAMPLE RUNS:
[ Video ] YouTube Video (with commentary) of running this shell script under different senerios. You can pause and replay this video at anytime. HINTS / TIPS (and other ASSUMPTIONS): ASSIGNMENT SUBMISSION INSTRUCTIONS: You MUST follow the complete set of instructions by clicking the submission link below and follow those submission instructions.
Assignment #2 Submission Instructions: [ html ] Shell scripts
are to be submitted from your Matrix account from the submission scripts
displayed above – no exceptions. You are expected to complete this assignment by yourself. There is no groupwork allowed for this assignment!
Late
assignments will carry a penalty of 10% per day. Since assignment is
submitted electronically: weekends count!.
If your script
is not functional when tested, or produces too many incorrect
answers, you will receive an e-mail to resubmit your assignment, and
lose 20% of your mark (after other deductions are noted after remarking).
Every assignment will be checked for
plagiarism. If any copying is discovered, both students will
receive a mark of 0 Good Luck :)
If there is a vendor name match, then the vendor name and outstanding
vendor balance will be displayed, and the user can enter a payment against
that outstanding balance.
You can assume that your program only works with dollars (i.e. no decimal places),
therefore your shell script will only accept valid integers; otherwise, the
user will have to re-enter the payment.
Also, if the payment is greater than the outstanding
balance, your program will indicate that the "payment exceeds
the outstanding balance", and that the user must re-enter the
payment amount. An example of this is shown in the YouTube SAMPLE RUNS.
When this menu item is selected, the user will be
prompted for a full vendor name. The user MUST enter a vendor name
that matches (including case sensitivity and exact full vendor name), otherwise,
another dialog box will indicate "no matches", and request that the user re-enter
a vendor name.
Dialog box prompting for full Vendor Name.
Dialog box prompting to re-enter Vendor Name if no match.
Dialog box requesting amount of payment against outstanding balance.
If the partial payment was successful, then the vendor record's balance is updated
in the database file.
If a complete payment has been made against the outstanding balance, then
the vendor record is to be removed from the purchases database file.
NOTE: Please refer to the HINTS / TIPS for help and suggestions...
You can set the resolution to 720p and set to "full screen mode" to see the video in more detail...
NOTE: Ignore part of YouTube commentary about "CONTACT VENDOR" report should have phone # instead of date. The report is correct, and shows first column as date of last purchase (instead of phone #).
Here is a link how to use the Zenity command: [ html]
GRADING
and a "Dishonesty Report" will be entered in
both student's files.