LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-28-2008, 07:35 PM   #1
mikebud12
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
Lightbulb help in CSC 141, looops ,counters and error checking


A company sells to cleaning products
Bluemagic (for bathroom) sells for $5.00 per bottle and costs $1.50 to produce
Kitchen magic(for kitchen) sells $6.00 per bottle and $2.00 to produce

Customers charged 2.00 per order for shipping and handling. But it costs the company only $0.50 to ship each bottle.

If a customer orders more than 5 bottles on an order they get: 10% off their total product cost and free shipping and handling.

Sample run:
enter order number (-1 when done) 90210
enter product (B(athMagic) or (K(itchenMagic)> K
enter number of bottles > 2
Order 90210 2 bottles KitchenMagic
Price of order:$12.00 + $2.00 shipping
Please pay: $14.00

// this continues until the user enters a -1 for order number
// after this happens the following totals are printed
Bottles sold
120 bottles BathMagic (60.0%)
80 bottles KitchenMagic (40.0%)

Total revenue collected $xx,xxx.xx
Total cost of producing and shipping $xx,xxx.xx
Total profit $xx,xxx.xx
Average profit per order $xx,xxx.xx

Notes: Total Revenue collected: Sum of all customer payments
Total cost of producing and shipping: Total cost to manufacture and ship all items sold
Total profit= total revenue-(cost to produce and ship)
Average profit per order= total profit/ number of orders
 
Old 10-28-2008, 10:05 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
http://catb.org/~esr/faqs/smart-questions.html
http://www.linuxquestions.org/linux/rules.html
 
  


Reply

Tags
code, help, please


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux Gazette #141 is out! LXer Syndicated Linux News 0 08-02-2007 11:31 AM
Gprs Csc Connect kenlitting Linux - Networking 1 11-30-2006 03:31 AM
traffic counters blazkovskib Linux - Networking 1 11-03-2006 10:21 AM
checking for qt... error. ilubtofart Linux - Newbie 3 07-22-2004 11:31 PM
cannot get snd-emu10k1 workingon fedora core 1 + kernel 2.6.1-1.141 thehundredthone Linux - Hardware 2 02-18-2004 06:04 AM


All times are GMT -5. The time now is 04:25 AM.

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 Google+: linuxquestions
Open Source Consulting | Domain Registration