Chen Feng Yu jobs

product["001"]={"Name":"美式面包","Unit":"个","Price":10.00,"Class":"西点类","integral":10.00}
product["002"]={"Name":"法式面包","Unit":"个","Price":15.00,"Class":"西点类","integral":15.00}
product["003"]={"Name":"日食面包","Unit":"个","Price":8.00,"Class":"西点类","integral":8.00}
product["004"]={"Name":"法国啤酒","Unit":"瓶","Price":20.00,"Class":"酒类","integral":20.00}
product["005"]={"Name":"巴西扎啤","Unit":"听","Price":12.00,"Class":"酒类","integral":12.00}
product["007"]={"Name":"国窖100ml","Unit":"瓶","Price":98.00,"Class":"酒类","integral":98.00}
product["009"]={"Name":"美国红苹果","Unit":"Kg","Price":18.00,"Class":"水果类","integral":18.00}
product["010"]={"Name":"日本红富士","Unit":"Kg","Price":12.00,"Class":"水果类","integral":12.00}
product["012"]={"Name":"菲律宾香蕉","Unit":"Kg","Price":9.80,"Class":"水果类","integral":9.80}
product["013"]={"Name":"大白菜","Unit":"Kg","Price":6.00,"Class":"蔬菜类","integral":6.00}
product["014"]={"Name":"黄瓜","Unit":"Kg","Price":5.60,"Class":"蔬菜类","integral":5.60}
product["015"]={"Name":"西兰花","Unit":"Kg","Price":10.00,"Class":"蔬菜类","integral":10.00}
product["016"]={"Name":"大黄鱼","Unit":"Kg","Price":80.00,"Class":"海鲜类","integral":80.00}
product["017"]={"Name":"黄刺鱼","Unit":"Kg","Price":50.00,"Class":"海鲜类","integral":50.00}
product["018"]={"Name":"带鱼","Unit":"Kg","Price":6.00,"Class":"海鲜类","integral":6.00}
 

a = input ( "enter" registered "Create an account:")
IF A == "Register":
    user1 = the INPUT ( "Enter your name:")
    Sex = the INPUT ( "Sex enter:")
    userku the INPUT = ( "enter the account: ")
    psdku the iNPUT = (" enter password: ")
    Print (" registered, please login account ")
the User = the iNPUT (" enter the account: ")
PSD = the iNPUT (" enter password: ")
IF == userku the User and PSD == psdku:
    Print ( "Welcome Dear" + user1 + "into the store")
    Print ( "personal information:")
    hyjb = Print ( "membership levels: Normal")
    JF = 0.00;
    Print ( "name:" + user1)
    print ( "sex:" sex +)
the else:
    print ( "account password wrong!" )
BuyGoods = {}
good_index the INPUT = ( 'Please enter the product name search (enter "Buy" to exit):')
! = The while good_index 'Buy':
    for key1 in Product:
        IF Product [key1] [ "the Name"] the Find (good_index) = - 1:.!
            tmpclass = Product [key1] [ "Class"]
            Print ( "Please select Number:")
            for key2 in Product :
                IF product [key2] [ "Class"] Find (tmpclass) = - 1:.!
                    Print ( "product number: {0: .3 denominated {1}}: {2} Price: {3: .2f} Points: {4: .2f} ". format (key2, product [key2] [" Name "], product [key2] [" Unit "], product [key2] [" Price "], product [key2] [" Integral "]))
            selected_good, Qty = the iNPUT ( 'Please enter the three coding purchased, the number (separated by spaces) |" end 0 "exit:') Split ().
            the while selected_good = 'End':!
                if len(selected_good)==3 and product[selected_good]!="":
                    BuyGoods [selected_good] = { "Name ": product [selected_good] [ "Name"], "Unit": product [selected_good] [ "Unit"], "Price": product [selected_good] [ "Price"], "integral ": Product [selected_good] [" Integral "]," Qty ": the eval (Qty)}
                selected_good, Qty = iNPUT ( 'enter purchase. 3 bit code, the number (space separated) |" end 0 "exit:' ) .split ()
            BREAK
    good_index the iNPUT = ( 'Please enter the product name search (enter "Buy" to exit):')
SubTotal = 0.00;
Print ( "************* settlement *** *********** ")
Print (" you buy goods amount as follows: ")
for key3 in BuyGoods:
    Print (" product number: {0: .3} {1} denominated in units of: { Unit 2}: {3: .2f} Points: {4: .2f} ". format (key3, BuyGoods [key3] ["Name"],BuyGoods[key3]["Unit"],BuyGoods[key3]["Price"],BuyGoods[key3]["integral"],BuyGoods[key3]["Qty"]))
    SubTotal+=BuyGoods[key3]["Price"]*BuyGoods[key3]["Qty"]
    if hyjb=="普通":
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*1
    elif hyjb=="高级":
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*1.5
    elif hyjb=="银钻":
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*2
    elif hyjb=="金钻":
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*3
    elif hyjb=="黑钻":
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*6
    else:
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*0.5
    
    print ( "====== Total amount: {:. 2f} Yuan" .format (SubTotal), "the points:", int (JF))
    Print ( "Information successfully updated !!!")
    Print ( " name: "user1)
    Print (" sex: "sex)
    Print (" membership levels: silver Diamond "," current Credit: ", int (jf))
product["001"]={"Name":"美式面包","Unit":"个","Price":10.00,"Class":"西点类","integral":10.00}
product["002"]={"Name":"法式面包","Unit":"个","Price":15.00,"Class":"西点类","integral":15.00}
product["003"]={"Name":"日食面包","Unit":"个","Price":8.00,"Class":"西点类","integral":8.00}
product["004"]={"Name":"法国啤酒","Unit":"瓶","Price":20.00,"Class":"酒类","integral":20.00}
product["005"]={"Name":"巴西扎啤","Unit":"听","Price":12.00,"Class":"酒类","integral":12.00}
product["007"]={"Name":"国窖100ml","Unit":"瓶","Price":98.00,"Class":"酒类","integral":98.00}
product["009"]={"Name":"美国红苹果","Unit":"Kg","Price":18.00,"Class":"水果类","integral":18.00}
product["010"]={"Name":"日本红富士","Unit":"Kg","Price":12.00,"Class":"水果类","integral":12.00}
product["012"]={"Name":"菲律宾香蕉","Unit":"Kg","Price":9.80,"Class":"水果类","integral":9.80}
product["013"]={"Name":"大白菜","Unit":"Kg","Price":6.00,"Class":"蔬菜类","integral":6.00}
product["014"]={"Name":"黄瓜","Unit":"Kg","Price":5.60,"Class":"蔬菜类","integral":5.60}
product["015"]={"Name":"西兰花","Unit":"Kg","Price":10.00,"Class":"蔬菜类","integral":10.00}
product["016"]={"Name":"大黄鱼","Unit":"Kg","Price":80.00,"Class":"海鲜类","integral":80.00}
product["017"]={"Name":"黄刺鱼","Unit":"Kg","Price":50.00,"Class":"海鲜类","integral":50.00}
product["018"]={"Name":"带鱼","Unit":"Kg","Price":6.00,"Class":"海鲜类","integral":6.00}
 

a = input ( "enter" registered "Create an account:")
IF A == "Register":
    user1 = the INPUT ( "Enter your name:")
    Sex = the INPUT ( "Sex enter:")
    userku the INPUT = ( "enter the account: ")
    psdku the iNPUT = (" enter password: ")
    Print (" registered, please login account ")
the User = the iNPUT (" enter the account: ")
PSD = the iNPUT (" enter password: ")
IF == userku the User and PSD == psdku:
    Print ( "Welcome Dear" + user1 + "into the store")
    Print ( "personal information:")
    hyjb = Print ( "membership levels: Normal")
    JF = 0.00;
    Print ( "name:" + user1)
    print ( "sex:" sex +)
the else:
    print ( "account password wrong!")
BuyGoods = {}
good_index the iNPUT = ( 'Please enter the product name search (enter "Buy" to exit):' )
while good_index!='Buy':
    for key1 in product:
        . IF Product [key1] [ "the Name"] the Find (good_index) = - 1:!
            tmpclass = Product [key1] [ "Class"]
            Print ( "Please select Number:")
            for key2 in Product:
                IF Product [key2 ] [ "Class"] Find (tmpclass) = - 1:.!
                    Print ( "product number: {0: .3 denominated {1}}: {2} Price: {3: .2f} Points: {4: .2f} ". format (key2, product [key2] [" Name "], product [key2] [" Unit "], product [key2] [" Price "], product [key2] [" integral "]))
            selected_good, Qty = input ( 'Please enter the purchase of 3 code, quantity (separated by spaces) | "end 0" exit:') Split ().
            the while selected_good = 'End':!
                IF len (selected_good) == 3 and product [selected_good] = "" !:
                    BuyGoods [selected_good] = { "Name ": product [selected_good] [ "Name"], "Unit": product [selected_good] [ "Unit"], "Price": product [selected_good] [ "Price"], "integral ": Product [selected_good] [" Integral "]," Qty ": the eval (Qty)}
                selected_good, Qty = iNPUT ( 'enter purchase. 3 bit code, the number (space separated) |" end 0 "exit:' ) .split ()
            BREAK
    good_index the iNPUT = ( 'Please enter the product name search (enter "Buy" to exit):')
SubTotal = 0.00;
Print ( "************* settlement *** *********** ")
Print (" you buy goods amount as follows: ")
for key3 in BuyGoods:
    Print (" product number: {0: .3} {1} denominated in units of: { Unit 2}: {3: .2f} Points: {4: ". format ( key3, BuyGoods [key3] .2f} [" Name "], BuyGoods [key3] ["Unit"],BuyGoods[key3]["Price"],BuyGoods[key3]["integral"],BuyGoods[key3]["Qty"]))
    SubTotal+=BuyGoods[key3]["Price"]*BuyGoods[key3]["Qty"]
    if hyjb=="普通":
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*1
    elif hyjb=="高级":
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*1.5
    elif hyjb=="银钻":
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*2
    elif hyjb=="金钻":
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*3
    elif hyjb=="黑钻":
        jf+=BuyGoods[key3]["integral"]*BuyGoods[key3]["Qty"]*6
    else:
        jf+=BuyGoods[key3]["Integral "] * BuyGoods [key3] [" Qty "] * 0.5     Print ( "information successfully updated !!!")
    
    Print (" ====== Total amount: {:. 2f} Element ".format (SubTotal)," the points: ", int (jf) )

    print ( "Name:" user1)
    print ( "Sex:" Sex)
    print ( "membership levels: Silver Diamond", "Current Credit:", int (jf))

Guess you like

Origin www.cnblogs.com/chenfy/p/10943009.html