The objectives of this assignment include:
Learning about shell filters, commands and shell scripting language
Apply the concepts learnt by developing a simple (book) inventory shell program
Background
This assignment requires you to write a standalone Book Inventory (Shell) program. The Inventory program is normally used by the Book Store owner to keep track of book information and available quantity. It should be an interactive menu-based program allowing the owner to:
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
The system allows book details to be individually entered/updated and then stored in a text file (called “BookDB.txt”) in the following format:
[ Title ]:[ Author ]:[ Price ]:[ Qty Available ]:[ Qty Sold ]
eg: Windows Vista in 21 days:John Goodman:33.68:100:48
MacOS X for dummies:Mary Abraham:53.48:88:38
etc…
The colon (:) character is used to separate each piece of information.
Task Requirements
A) Instead of specifying exactly what each function (in the above menu) is supposed to do, the bookstore owner has painstakingly documented his desired output in the following Appendices A – F.
B) Before you start developing your program, you should take some time to review the output, and analyze the requirements of the inventory application.
C) It is recommended that you come up with some basic table of technical requirements to document what you interpret to be desired functionalities of the program, before you proceed with program development.
D) Once the program is completed and tested to be working successfully, you are highly encouraged to add on “new features” to the program that you feel are relevant to the tasks of book inventory tracking. Additional marks may be awarded subject to the relevancy and correctness of the new functionalities.
E) You are not allowed to use Java, C++ or any other languages to form the whole, or even part of your book inventory application. You have to use Shell syntax and commands for your entire program.
F) However, you are not limited to using the shell commands that you have been taught. In fact, you are highly encouraged to do additional research and learn in depth about any other commands necessary to do the task efficiently and effectively.
Deliverables
1) The deliverables include the following:
a) The actual working shell program (hard+soft copies), with comments on each file, function or block of code to help the tutor understand its purpose.
b) A word document (hard+soft copies) that elaborates on:
· (Interpreted) requirements of the inventory program
· Diagram / Illustrations of program design
· Summary of implementation of each module in your program
· Reflections on program development (e.g. assumptions made, difficulties faced, what could have been done better, possible enhancements in future, what have you learnt, etc)
c) A program demo/evaluation during lab session. You must be prepared to perform certain tasks / answer any questions posed by the tutor.
2) IMPT: Please follow closely, to the submission instructions in Appendix G, which contains details about what to submit, file naming conventions, when to submit, where to submit, etc.
3) The evaluation will be held during lab session where you are supposed to submit your assignment. Some time will be allocated for you to present / demonstrate your program during the session.
Grading
Student’s deliverable will be graded according to the following criteria:
(i) Program fulfills all the basic requirements stipulated by the assignment
(ii) Successful demonstration of a working program, clarity of presentation and satisfactory answers provided during Q & A session.
(iii) Additional effort (e.g. enhancing the program with relevant features over and above task requirements, impressive, ‘killer’ presentation)
(iv) After the submission of deliverables, students will be required undergo an evaluation process (to determine fulfillment of task requirements.) Further instructions will be given by the Tutor during the subsequent respective labs. Please pay attention as failure to adhere to instructions may result in deduction of marks.
Tutor’s note:
In the real working world, satisfactory completion of your tasks is no longer enough. The ability to add value, communicate and/or demonstrate your ideas with clarity is just as important as correct functioning of your program. The grading criteria is set to imitate such requirements on a ‘smaller scale’.
APPENDIX A
(Sample output for function : Add New Book)
Note : User’s input is underlined, to differentiate it against program’s output (e.g. prompt for info)
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 1
Title : Windows Vista in 21 days
Author : John Goodman
Error! Book already exists!
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 1
Title : C++ for dummies
Author : Edward Scissorhands
Price : 15.01
Qty Available : 10
Qty Sold : 5
New book title ‘C++ for dummies’ added successfully!
<Displays main menu again …
APPENDIX B
(Sample output for function : Remove Existing Book Info)
Note : User’s input is underlined, to differentiate it against program’s output (e.g. prompt for info)
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 2
Title : Biography of Crocodile Dundee
Author : Crox Swamplund
Error! Book does not exists!
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 2
Title : C++ for dummies
Author : Edward Scissorhands
Book Title ‘C++ for dummies’ removed successfully!
<Displays main menu again …
APPENDIX C
(Sample output for function : Update Existing Book Info)
Note : User’s input is underlined, to differentiate it against program’s output (e.g. prompt for info)
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 3
Title : Star Wars VI – Return of the Jedi
Author : Obi-Wan Kenobi
Error! Book does not exists!
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 3
Title : C++ for dummies
Author : Edward Scissorhands
Book found!
a) Update Title
b) Update Author
c) Update Price
d) Update Qty Available
e) Update Qty Sold
f) Back to main menu
Please enter your choice: a
NewTitle : C++ for Experts
Book’s Title has been updated successfully!
a) Update Title
b) Update Author
c) Update Price
d) Update Qty Available
e) Update Qty Sold
f) Back to main menu
Please enter your choice: e
New Qty Sold : 38
Book’s Qty Sold has been updated successfully!
a) Update Title
b) Update Author
c) Update Price
d) Update Qty Available
e) Update Qty Sold
f) Back to main menu
Please enter your choice: f
<Displays main menu again …
APPENDIX D
(Sample output for function : Search for Book by title/author)
Note : User’s input is underlined, to differentiate it against program’s output (e.g. prompt for info)
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 4
Title : Star Wars VI
Author : <enter
Found 2 records :
Star Wars VI – Return of the Jedi, Obi-Wan Kenobi, $15.98, 20, 15
Star Wars VI – Return of the Jedi, Darth Vader, $8.05, 30, 20
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 4
Title : <enter
Author : Scissorhands
Found 3 records :
C++ for dummies, John Scissorhands, $15.01, 10, 5
Java for dummies, Mary Scissorhands, $16.02, 20, 15
VB.NET for dummies, Edward Scissorhands, $17.03, 30, 25
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 4
Title : Java for dummies
Author : Edward Scissorhands
Found 1 record :
Java for dummies, Edward Scissorhands, $16.02, 20, 15
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 4
Title : The Never-ending story
Author : Kelly Longbreath
Book not found!
<Displays main menu again …
APPENDIX E
(Sample output for function : Process a book sold)
Note : User’s input is underlined, to differentiate it against program’s output (e.g. prompt for info)
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 5
Title : Star Wars VI – Return of the Jedi
Author : Darth Vader
No. of copies sold : 3
Current book info :
Star Wars VI – Return of the Jedi, Darth Vader, $8.05, 30, 20
New book info :
Star Wars VI – Return of the Jedi, Darth Vader, $8.05, 27, 23
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 5
Title : Star Wars VII – Return of the Frodo
Author : Bilbo Baggins
Error! Book does not exists!
<Displays main menu again …
APPENDIX F
APPENDIX G
Submission Instructions (V. IMPT!!)
1) Deliverables
a) All submissions should be in softcopy, unless otherwise instructed
b) For the actual files to be submitted, you typically need to include the following:
- word document report (e.g. *.doc), save as MS Word 97-2003 format
- the source file(s), (e.g. *.sh, *.c, *.h, *.o, or *.cpp files)
- the executable file, compile into an executable file with *.exe
(e.g. Assn1.exe). Note: this only applies to non-shell script assignments!
2) How to package
Compress all your assignment files into a single zip file. Please use the following naming format :
Assignment 1 standalone Book Inventory using Shell Solution
The objectives of this assignment include:
Learning about shell filters, commands and shell scripting language
Apply the concepts learnt by developing a simple (book) inventory shell program
Background
This assignment requires you to write a standalone Book Inventory (Shell) program. The Inventory program is normally used by the Book Store owner to keep track of book information and available quantity. It should be an interactive menu-based program allowing the owner to:
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
The system allows book details to be individually entered/updated and then stored in a text file (called “BookDB.txt”) in the following format:
[ Title ]:[ Author ]:[ Price ]:[ Qty Available ]:[ Qty Sold ]
eg: Windows Vista in 21 days:John Goodman:33.68:100:48
MacOS X for dummies:Mary Abraham:53.48:88:38
etc…
The colon (:) character is used to separate each piece of information.
Task Requirements
A) Instead of specifying exactly what each function (in the above menu) is supposed to do, the bookstore owner has painstakingly documented his desired output in the following Appendices A – F.
B) Before you start developing your program, you should take some time to review the output, and analyze the requirements of the inventory application.
C) It is recommended that you come up with some basic table of technical requirements to document what you interpret to be desired functionalities of the program, before you proceed with program development.
D) Once the program is completed and tested to be working successfully, you are highly encouraged to add on “new features” to the program that you feel are relevant to the tasks of book inventory tracking. Additional marks may be awarded subject to the relevancy and correctness of the new functionalities.
E) You are not allowed to use Java, C++ or any other languages to form the whole, or even part of your book inventory application. You have to use Shell syntax and commands for your entire program.
F) However, you are not limited to using the shell commands that you have been taught. In fact, you are highly encouraged to do additional research and learn in depth about any other commands necessary to do the task efficiently and effectively.
Deliverables
1) The deliverables include the following:
a) The actual working shell program (hard+soft copies), with comments on each file, function or block of code to help the tutor understand its purpose.
b) A word document (hard+soft copies) that elaborates on:
· (Interpreted) requirements of the inventory program
· Diagram / Illustrations of program design
· Summary of implementation of each module in your program
· Reflections on program development (e.g. assumptions made, difficulties faced, what could have been done better, possible enhancements in future, what have you learnt, etc)
c) A program demo/evaluation during lab session. You must be prepared to perform certain tasks / answer any questions posed by the tutor.
2) IMPT: Please follow closely, to the submission instructions in Appendix G, which contains details about what to submit, file naming conventions, when to submit, where to submit, etc.
3) The evaluation will be held during lab session where you are supposed to submit your assignment. Some time will be allocated for you to present / demonstrate your program during the session.
Grading
Student’s deliverable will be graded according to the following criteria:
(i) Program fulfills all the basic requirements stipulated by the assignment
(ii) Successful demonstration of a working program, clarity of presentation and satisfactory answers provided during Q & A session.
(iii) Additional effort (e.g. enhancing the program with relevant features over and above task requirements, impressive, ‘killer’ presentation)
(iv) After the submission of deliverables, students will be required undergo an evaluation process (to determine fulfillment of task requirements.) Further instructions will be given by the Tutor during the subsequent respective labs. Please pay attention as failure to adhere to instructions may result in deduction of marks.
Tutor’s note:
In the real working world, satisfactory completion of your tasks is no longer enough. The ability to add value, communicate and/or demonstrate your ideas with clarity is just as important as correct functioning of your program. The grading criteria is set to imitate such requirements on a ‘smaller scale’.
APPENDIX A
(Sample output for function : Add New Book)
Note : User’s input is underlined, to differentiate it against program’s output (e.g. prompt for info)
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 1
Title : Windows Vista in 21 days
Author : John Goodman
Error! Book already exists!
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 1
Title : C++ for dummies
Author : Edward Scissorhands
Price : 15.01
Qty Available : 10
Qty Sold : 5
New book title ‘C++ for dummies’ added successfully!
<Displays main menu again …
APPENDIX B
(Sample output for function : Remove Existing Book Info)
Note : User’s input is underlined, to differentiate it against program’s output (e.g. prompt for info)
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 2
Title : Biography of Crocodile Dundee
Author : Crox Swamplund
Error! Book does not exists!
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 2
Title : C++ for dummies
Author : Edward Scissorhands
Book Title ‘C++ for dummies’ removed successfully!
<Displays main menu again …
APPENDIX C
(Sample output for function : Update Existing Book Info)
Note : User’s input is underlined, to differentiate it against program’s output (e.g. prompt for info)
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 3
Title : Star Wars VI – Return of the Jedi
Author : Obi-Wan Kenobi
Error! Book does not exists!
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 3
Title : C++ for dummies
Author : Edward Scissorhands
Book found!
a) Update Title
b) Update Author
c) Update Price
d) Update Qty Available
e) Update Qty Sold
f) Back to main menu
Please enter your choice: a
NewTitle : C++ for Experts
Book’s Title has been updated successfully!
a) Update Title
b) Update Author
c) Update Price
d) Update Qty Available
e) Update Qty Sold
f) Back to main menu
Please enter your choice: e
New Qty Sold : 38
Book’s Qty Sold has been updated successfully!
a) Update Title
b) Update Author
c) Update Price
d) Update Qty Available
e) Update Qty Sold
f) Back to main menu
Please enter your choice: f
<Displays main menu again …
APPENDIX D
(Sample output for function : Search for Book by title/author)
Note : User’s input is underlined, to differentiate it against program’s output (e.g. prompt for info)
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 4
Title : Star Wars VI
Author : <enter
Found 2 records :
Star Wars VI – Return of the Jedi, Obi-Wan Kenobi, $15.98, 20, 15
Star Wars VI – Return of the Jedi, Darth Vader, $8.05, 30, 20
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 4
Title : <enter
Author : Scissorhands
Found 3 records :
C++ for dummies, John Scissorhands, $15.01, 10, 5
Java for dummies, Mary Scissorhands, $16.02, 20, 15
VB.NET for dummies, Edward Scissorhands, $17.03, 30, 25
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 4
Title : Java for dummies
Author : Edward Scissorhands
Found 1 record :
Java for dummies, Edward Scissorhands, $16.02, 20, 15
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 4
Title : The Never-ending story
Author : Kelly Longbreath
Book not found!
<Displays main menu again …
APPENDIX E
(Sample output for function : Process a book sold)
Note : User’s input is underlined, to differentiate it against program’s output (e.g. prompt for info)
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 5
Title : Star Wars VI – Return of the Jedi
Author : Darth Vader
No. of copies sold : 3
Current book info :
Star Wars VI – Return of the Jedi, Darth Vader, $8.05, 30, 20
New book info :
Star Wars VI – Return of the Jedi, Darth Vader, $8.05, 27, 23
1) Add new book
2) Remove existing book info
3) Update book info and quantity
4) Search for book by title/author
5) Process a book sold
6) Inventory summary report
7) Quit
Please enter your option: 5
Title : Star Wars VII – Return of the Frodo
Author : Bilbo Baggins
Error! Book does not exists!
<Displays main menu again …
APPENDIX F
APPENDIX G
Submission Instructions (V. IMPT!!)
1) Deliverables
a) All submissions should be in softcopy, unless otherwise instructed
b) For the actual files to be submitted, you typically need to include the following:
- word document report (e.g. *.doc), save as MS Word 97-2003 format
- the source file(s), (e.g. *.sh, *.c, *.h, *.o, or *.cpp files)
- the executable file, compile into an executable file with *.exe
(e.g. Assn1.exe). Note: this only applies to non-shell script assignments!
2) How to package
Compress all your assignment files into a single zip file. Please use the following naming format :
<FT/PT_Assn1_<Stud. No._<Name.zip
Example : FT_Assn1_1234567_JohnDoeAnderson. zip
- <FT/PT Use “FT” for Full-Time student, “PT” if you are Part-Time student
- Assn1 if you are submitting assignment 1, Assn2 if submitting assignment 2 etc.
- <Stud. No. refers to your UOW student number (e.g. 1234567)
- <Name refers to your UOW registered name (e.g. JohnDoeAnderson)
<FT/PT_Assn1_<Stud. No._<Name.zip
Example : FT_Assn1_1234567_JohnDoeAnderson. zip
- <FT/PT Use “FT” for Full-Time student, “PT” if you are Part-Time student
- Assn1 if you are submitting assignment 1, Assn2 if submitting assignment 2 etc.
- <Stud. No. refers to your UOW student number (e.g. 1234567)
- <Name refers to your UOW registered name (e.g. JohnDoeAnderson)