01-23-2010
Help with this exercise
you are to write a program which will read in a tax rate (as a percentage) and the prices of 5 items. the program is to calculate the total price, before tax, of the items and then the tax payable on those items, and then the total amount due. the tax payable is computed by appliying the tax rate percentage to the total price. all value are to be printed as output.
use the following steps to solve this problem:
1.define the problem using a defining diagram
2.create a solution algorithm using pseudocode
3.desk check your solution algorithm using two test cases
4.code the solution using the korn shell language
5.key the code into unix system under your home directory. include comments
6.give the program execute permission with the chmod command
Last edited by Scott; 01-23-2010 at 10:58 PM..
Reason: Removed links
6 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello guys..
well, im kinda newbie with unix because i started to learn it like 2 weeks ago.
then i started to make some exercises, but i got stucked on this one :
so, i need to know how many different 'names' has the 5th field and how many times each name appears.
i was trying with a... (6 Replies)
Discussion started by: EnioMarques
6 Replies
2. UNIX for Dummies Questions & Answers
Hello guys.
Well, on this exercise i need the average "chargeAmount" per hour (for each hour).
with this code :
cat getusagesummarywrongmatch | grep -iv MOU2GRTObject | cut -d'|' -f4,14 | grep -i chargeamount | cut -d' ' -f2
http://img227.imageshack.us/img227/5889/65969235do0.jpg
i got... (2 Replies)
Discussion started by: EnioMarques
2 Replies
3. Shell Programming and Scripting
Hi, 'm trying to do an exercicise, and one part is:
ls -l $1 | awk '
BEGIN {
max = $5;
}
{
if ($5 > max){
max = $5;
}
}
END {
print "Tamanio mayor fichero = " max; }'
# Imprimimos ahora el menor tamaņo de fichero
ls -l $1 | awk '... (4 Replies)
Discussion started by: Phass
4 Replies
4. Shell Programming and Scripting
hello everyone!:)
I have an exercise which I think is difficult for beginner like me. Here is the exercise
Create a shell script, which takes a directory as command line argument.
Script displays ten first lines from every text file in that directory. After
displaying the lines from the... (1 Reply)
Discussion started by: googlevn
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am learning unix. I want to practice few small excercises. Please suggest me some goor URL to practice.
Thanks in advance. (1 Reply)
Discussion started by: stew
1 Replies
6. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write a shell script program that will input a name and a mark between 0 and 100. The program then displays the... (9 Replies)
Discussion started by: UniverseCloud
9 Replies
PAC(8) BSD System Manager's Manual PAC(8)
NAME
pac -- printer/plotter accounting information
SYNOPSIS
pac [-cmrs] [-P printer] [-p price] [name ...]
DESCRIPTION
pac reads the printer/plotter accounting files, accumulating the number of pages (the usual case) or feet (for raster devices) of paper con-
sumed by each user, and printing out how much each user consumed in pages or feet and dollars.
Options and operands available:
-Pprinter Accounting is done for the named printer. Normally, accounting is done for the default printer (site dependent) or the value of
the environment variable PRINTER is used.
-c flag causes the output to be sorted by cost; usually the output is sorted alphabetically by name.
-m flag causes the host name to be ignored in the accounting file. This allows for a user on multiple machines to have all of his
printing charges grouped together.
-pprice The value price is used for the cost in dollars instead of the default value of 0.02 or the price specified in /etc/printcap.
-r Reverse the sorting order.
-s Accounting information is summarized on the summary accounting file; this summarization is necessary since on a busy system, the
accounting file can grow by several lines per day.
names Statistics are only printed for user(s) name; usually, statistics are printed for every user who has used any paper.
OUTPUT FORMAT
pac formats the output into simple table, using four columns - number of feets or pages (column "pages/feet"), how many copies were made
(column "runs"), total price for this print (column "price") and user login with host name (column "login" or "host name and login"). If
argument name was not used and hence pac is printing information for all users, a summary line with print totals (runs, pages, price) is
appended.
Note that pac on other system might print the price as price per copy.
FILES
/var/account/?acct raw accounting files
/var/account/?_sum summary accounting files
/etc/printcap printer capability data base
SEE ALSO
printcap(5)
HISTORY
The pac command appeared in 4.0BSD.
BUGS
The relationship between the computed price and reality is as yet unknown.
BSD
June 6, 1993 BSD