LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Closed Thread
 
LinkBack Search this Thread
Old 03-17-2010, 06:54 PM   #1
funjoke
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Rep: Reputation: 0
Linux help


Use the following information in your script.
Products & services Charges(RM)
Engine oil 90
Engine oil filter 30
Gear box oil 80
Power steering fluid 30
Tyres alignment 100
Tyre balancing 10
Workmanship 50
When the script starts, it should initialise variable LOGIN with the value passed in as parameter,
then initialise variable WP to the directory (RECP) to store receipts, and variable LOGP to the
directory (LOGS) to store log files.
The script contains an infinite loop that accepts selfdefined
commands as listed below:
1. genp
2. reprint
3. log
4. price
5. bkup
6. !help
7. quit
1. genp
Generates receipt and then displays it on screen.
User should input quantity of all products. Initialise the quantity of each product at the
beginning of script.
Sample format of receipt:
______________________________________________
Official Receipt
Date:
Products & services Qty Subtotal
Engine oil 1 90
Engine oil filter 1 30
Gear box oil
Power steering fluid 1 30
Tyres alignment
Tyre balancing
Workmanship 1 50
Grand total: 200
______________________________________________
Format of file name: RCDDMMMYYN
N is a counter, starts with value 1, incremented by 1 for each receipt.
Examples: RC11Mar101,
RC11Mar102,
RC11Mar103

Command date +%d%b%y will print the day, month and year, example: 11Mar10
Write a record to a log file (logDDMMMYY)
whenever receipt is generated.
Sample records:
Receipt RC11Mar101
issued. user. Wed Mar 11 10:09:17 MYT 2010
Receipt RC11Mar102
issued. user. Wed Mar 11 10:34:35 MYT 2010
Create a a log file (takenDDMMMYY)
to store records for all products used.
Sample records:
Receipt: RC11Mar101,
user
1 Engine oil. Wed Mar 11 10:09:17 MYT 2010
1 Engine oil filter. Wed Mar 11 10:09:17 MYT 2010
Receipt: RC11Mar102,
user
1 Gearbox oil. Wed Mar 11 10:34:47 MYT 2010
If the quantity of a product is less than 10, write a record to a log file (urgentDDMMMYY).
Example:
Engine oil. Wed Mar 11 10:34:47 MYT 2010
Power steering fluid. Wed Mar 11 10:34:47 MYT 2010
2. reprint
List all receipts and allow user to reprint (to screen) the selected receipt.
3. log
List all log files and allow user to view selected log file.
4. price
Update the charges of selected products or services.
5. bkup
Backup RECP or LOGS directory to a user specified location.
6. !help
Display all commands available.
7. quit
Exit the program.
Design
 
Old 03-17-2010, 07:00 PM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,136

Rep: Reputation: 106Reputation: 106
Looks like a homework question and you haven't even bothered to make an effort.
 
Old 03-17-2010, 09:45 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: back to Arch
Posts: 16,640

Rep: Reputation: 423Reputation: 423Reputation: 423Reputation: 423Reputation: 423
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.

Please feel free to start another thread which meets these guidelines.
 
  


Closed Thread

Tags
help


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Training Tips - Boot Linux from a Linux Installation CD or a Linux Live CD to L beibei Linux - General 1 10-29-2009 04:25 AM


All times are GMT -5. The time now is 08:44 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration