Results 1 to 6 of 6
  1. #1
    High School Starter
    Join Date
    Jun 2006
    Posts
    833

    Default Anybody here good with phython?

    I just have a question with a project. I almost done but I am missing something. Thank you.

  2. #2
    NBA Superstar SpecialQue's Avatar
    Join Date
    Nov 2010
    Posts
    13,373

    Default Re: Anybody here good with phython?

    The ladies say I'm great with mine.

  3. #3
    ***** ace23's Avatar
    Join Date
    May 2011
    Location
    Houston, TX
    Posts
    8,817

    Default Re: Anybody here good with phython?

    Post the code.

  4. #4
    Bear Chested Da Brawn STATUTORY's Avatar
    Join Date
    Oct 2010
    Location
    Khobestan
    Posts
    10,482

    Default Re: Anybody here good with phython?

    why not staxexchange or something?

    this really seems like a peculiar forum to ask this sort of questions

  5. #5
    High School Starter
    Join Date
    Jun 2006
    Posts
    833

    Default Re: Anybody here good with phython?

    The code is #constants
    cashvalue = 150

    couponcnt = 0
    grandtotal = 0
    customercnt = 0
    totalcoupons = 0
    cnt = 0
    total = 0
    from random import randint
    #processing section
    def maindriver():
    cashvalue = 150
    answer = input("do you have a customer Y/N:").upper()
    while answer == "Y":
    invoice = randint(1,9999)
    total = 0
    cnt = 0
    totalcoupons = 0
    amount = float(input("Enter items cost? : "))
    while (amount != 0):
    total += amount
    cnt += 1
    amount = float(input("Enter other items cost? "))
    respond = input("Do you have any Coupons? Y/N : ").upper()
    #while respond == 'Y':
    number = int(input("Enter number of coupons: "))
    for I in range (number):
    costofcoupons = float(input("Enter coupons cost? "))
    totalcoupons += costofcoupons
    avg = total/cnt
    totaldue = total-totalcoupons
    cashvalue += totaldue



    #Output Section
    print ((55 * " "), "Invoice :", invoice)
    print()
    print("The number of items:",cnt)
    #loop will start
    print("Total bill before all coupons are: ",format(total,"6.2f"))
    print("Average item cost ", avg)
    print("The Cash register has",cashvalue)
    customercnt =+ 1
    answer = input("Another Customer? Y/N:").upper()


    maindriver()
    input("Press Enter to Continue")


    I need to do this At the end the program print the number of customers processed, the average purchase per customer and the total amount of money in the cash register.

    I dont know how

  6. #6
    ***** ace23's Avatar
    Join Date
    May 2011
    Location
    Houston, TX
    Posts
    8,817

    Default Re: Anybody here good with phython?

    I don't understand what you're trying to accomplish with your code, but why can't you just keep +=1 for every customer and a += amount for every transaction as the total cash variable, then at the end divide total cash by customers?

    I think you already have the variables in there. All you have to do is print them.
    Last edited by ace23; 04-23-2014 at 05:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •