[Tutor] HELP!

2012-10-01 Thread Mark Rourke
hello, I am a college student in my first year of computer programming, 
I was wondering if you could look at my code to see whats wrong with it.


# Mark Rourke
# Sept 29, 2012
# Write a program to calculate the sales tax at the rate of 4% and 2% 
respectively
# Thereafter compute the total sales tax (sum of the state tax and the 
county tax)
# and the total purchase amount (sum of the purchase amount and the 
total sales tax).
# Finally, display the amount of purchase, the state sales tax, the 
county sales tax,

#the total sales tax and the total amount of the sale.

#Variable Declarations
#Real purchaseAmount, stateSalesTax, countySalesTax, totalSalesTax, 
totalPurchaseAmount

#Constant Real SALES_TAX = 0.4, COUNTY_TAX = 0.02

#Display "Input Purchase Amount: $"

#input the hours worked and hourly wage wage

SALES_TAX = 0.4

COUNTY_TAX = 0.02
print("--")
print(("This program calculates the sales tax at the rate of 4% and 2% 
respectively, as well sum of the state tax"))

print("--")

purchaseAmount = input("Please input the Purchase Amount: $")

#Calculate the State Sales Tax, County Sales Tax, Total Sales Tax, Total 
Purchase Amount


purchaseAmount = int(purchaseAmount)

stateSalesTax = int(purchaseAmount * SALES_TAX)

countySalesTax = int(purchaseAmount * COUNTY_TAX)

totalSalesTax = int(stateSalesTax + countySalesTax)

totalPurchaseAmount = int(purchaseAmount + totalSalesTax)

#Output the results

Display ("Purchase Amount:$") purchaseAmount
Display ("The State Sales Tax $") SALES_TAX
Display ("The County Sales Tax: $") COUNTY_TAX
Display ("The Total Sales Tax: $") totalSalesTax
Display ("The Total Amount of the Purchase: $") totalPurchaseAmount

--

Mark Rourke

T: 705-728-6169
M: 705-331-0175
E: mark.rour...@gmail.com

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] First semester no coding experince, please help!

2012-12-14 Thread Mark Rourke
Hello, the following attachment  (no virus I swear!)is an assignment I 
have for my programming class, I am having alot of difficulty completing 
this assignment, my teacher does not do a very good job of explaining 
this project to me, I desperately need some help/guidance/direction with 
this, please help!


Thanks
--

Mark Rourke

T: 705-728-6169
M: 705-331-0175
E: mark.rour...@gmail.com



Assignment3-1.docx
Description: Binary data
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] College student having python problems

2012-12-14 Thread Mark Rourke

The Following is my code:

#Mark Rourke, Mitch Lavalle
#Dec 04, 2012
#Global Constants
#Constant Integer MAX_QTY
MAX_QTY = 20
#Constant Real TAX_RATE
TAX_RATE = .13
#Constant Real Burger
Burger = .99
#Constant Real Fries
Fries = .79
#Constant Real Soda
Soda = 1.09
import sys
def getOrderNumber():
#Get the order number from user
#orderNumber >=0
goodOrder = True
while goodOrder == True:
try:
orderNumber = int(input("Please enter order number, Enter 0 to 
Stop"))
except ValueError:
print("Non numeric input entered. Program terminating...")
except:
print("Input Error")
else:
if (orderNumber > 0):
print ("Your order Number is %d" %(orderNumber))
return orderNumber
elif (orderNumber < 0 or orderNumber != 0):
goodOrder = True
print ("Please enter a proper value")
   




def showMenu():

#THIS IS ALL PART OF SHOWMENU:
#keep getting items for this order until the user wants to end the order
 #set initial quantities of items
numBurgers=20;
numFries=20;
numSodas=20;
menuItem = showMenu()<-ERROR THERE<
#ordering stuff from the menu
menuItem=-1

while (menuItem!= 0):
#show user menu
 print("--- 
M E N U ")

print ("Your order Number is %d")

print("Cost of Burger: %.2f" %Burger)

print("Cost of Fries: %.2f" %Fries)

print("Cost of Soda: %.2f" %Soda)

print("Enter 1 for Yum Yum Burger")

print("Enter 2 for Grease Yum Fries")

print("Enter 3 for Soda Yum")

print("Enter 0 to end order")

#get menu selection from them

itemType = int(input("Enter now->"))
#inside the function, we get input
#validate the input (1, 2, 3, 4)
#return that value
#menuItem 1 Yum Yum Burger
#menuItem 2 Greasy Yum Fries
#get how many of the item we want
#i.e. if menuItem is 1 (Yum Yum Burger) and 
howManyOfItem is 2, then the person wants 2 Yum Yum Burgers
#need to tell person how many they can order and prompt 
for number
#need to check if quantity ordered is allowed

if menuItem == 1:

#burger
print("You can order 0 through"+numBurgers+"burgers.")
numBurgAsked=input("how many would you like?")
#prompting taken care of in getitem
#passes back number that they want
if(numBurgAsked<=numBurgers):
numBurgers = numBurgers - numBurgAsked
elif menuItem == 2:
print("You can order 0 through"+numFries+"fries.")
numFriesAsked=input("how many would you like?")
if(numFriesAsked<=numFries):
numBurgers = numBurgers - numBurgAsked
elif menuItem == 3:
print("You can order 0 through"+numSodas+"sodas.")
numSodasAsked=input("how many would you like?")
if(numSodasAsked<=numFries):
numSodas = numSodas - numSodasAsked
   
#THIS IS PART OF CALCULATEFINALCOST:

#Calculate the cost of each item
costOfBurgers = calculateCost (1, burgersOrdered)
costOfFries = calculateCost (2, friesOrdered)
costOfSodas = calculateCost (3, sodasOrdered)
totalCost = CalculateTotalCost(1,2,3 + totalTax)
tax = calculateTax(totalCost * TAX_RATE)
finalCost = calculateFinalPrice(TotalCost + tax)

def main():

getOrderNumber()
showMenu()
main()

Okay this is what I've got so far on like 47 i have stated menuItem = 
showMenu()<-ERROR THERE<,
thats where I'm getting the error. tI goes into an infinate loop stating 
"File "C:\Users\Mark\Desktop\Assignment3_MarkRourke.py", line 45, in 
showMenu

menuItem = showMenu()"
can you give me some sort of way to get out of this? and if so, can you 
please show me where in the code and how?, I've been working on this for 
over 20 hours my teacher isn't helpful, can you please assist me





Mark Rourke


T: 705-728-6169
M: 705-331-0175
E: mark.rour...@gmail.com

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor