Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Money...
Author Message
coolest35

Posted: Thu Oct 16, 2003 5:50 pm   Post subject: Money...

Very Hard Programming Code .. ( atleast 2 me ) need help

hi, i have an assignment it says " Create a program for a restaurant owner to keep track of customer bills as wells as daily sales. For each customer, the waiters/ waitresses have entered all items for the customers, the program should calculate the subtotal, PST (8%), GST (7%), total, and sugessested tip (15% of the subtotal). There is no PST charged for any subtotals less than \$4. A 5% discount is offered for any subtotal more than \$50 and a 10% discount for any subtotal more than \$100. Your do not need to display discounts of zero. The program should continue for each customer. At the end of the day the program should provide the user with the daily totals for sales, taxes, discounts, and profits for the day." talk about a huge assignment this is what i have so far :

------------------------------------------------------------------------------------

% -----------------------------
%
% ------------------------------

var movesales, continue, moresales : string
var quantity1, quantity2, quantity3, discount5 : int
var price1, price2, price3, subtotal, totaltotal, totalquantity1, totalquantity2, totalquantity3,quantity4,quantity5,quantity6 : real
var price4, price5, price6, totalquantity4,totalquantity5,totalquantity6,subtotal1,totaltotal2, pst1, pst2, tip2, grandtotal :real
var subtotal2 :real
loop

const pst:= .08
const gst:= .07
const tip:= 0.15
subtotal := 0
discount5 := 0

put " Restaurant Program"
put " ---------------------"
put ""
put " Enter The Quantity For Item ( 0 To Quit ): " ..
get quantity1
put ""
if quantity1 > 0 then
put " Enter The Price For The Item: " ..
get price1
end if
totalquantity1 := price1 * quantity1
put ""
put " Enter The Quantity For Item ( 0 To Quit ): " ..
get quantity2
put ""
if quantity2 > 0 then
put " Enter The Price For The Item: " ..
get price2
end if
totalquantity2 := price2 * quantity2
put ""
put " Enter The Quantity For Item ( 0 To Quit ): " ..
get quantity3
put ""
if quantity3 > 0 then
put " Enter The Price For The Item: " ..
get price3

totalquantity3 := price3 * quantity3
end if
cls

subtotal := totalquantity1 + totalquantity2 + totalquantity3
totaltotal := pst + gst + subtotal

put ""
put ""
put " Sub-Total: \$", subtotal :0:2
put " 5% Discount: "
put " PST: ", " \$", pst * subtotal : 0 : 2
put " GST: ", " \$", gst * subtotal : 0 : 2
put " ------------------"
put ""
put " Total: ", " \$", totaltotal
put " Tip: ", "\$", totaltotal * tip :0:2
put ""
put " Press Any key To Continue" ..
get continue
cls
put " Are There More Sales? " ..
get moresales
exit when moresales = "n" or moresales = "NO" or moresales = "N" or moresales = "no"
end loop
cls
const tip1 := 0.15
const gst1:= .07

subtotal := 0
discount5 := 0

totalquantity6 := price6 * quantity6
end if
cls

subtotal1 := totalquantity4 + totalquantity5 + totalquantity6
totaltotal2 := pst1 + gst1 + subtotal2
loop
put ""
put ""
put " Sub-Total: \$", subtotal2 :0:2
put " 5% Discount: "
put " PST: ", " \$", pst1 * subtotal2 : 0 : 2
put " GST: ", " \$", gst1 * subtotal2 : 0 : 2
put " ------------------"
put ""
put " Total: ", " \$", totaltotal2
put " Tip: ", "\$", totaltotal2 * tip2 :0:2
put ""
put " Press Any key To Continue" ..
get continue
cls
put " Are There More Sales? " ..
get moresales
exit when moresales = "n" or moresales = "NO" or moresales = "N" or moresales = "no"
end loop

put " Grand Totals For The Day"
put " ---------------------------"
put ""

===============================================

I am so confused that I don't know what to do.. can someone please just correct the code .. that is why i have created a deal for someone.. i will pay them through paypal if they finish my assignment.. ( i will pay \$15 US) ( will get paid after I verify code)

 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 1 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: