price_book = 24.95
number_books = 60.0/100
first_book_cost = 3
additional_copy = 0.75
discounted_books = price_book*number_books
total_price = discounted_books*(first_book_cost*1+additional_copy*(60-1))
print "The total price of 60 copies of book is %s$."%(total_price)
Suppose the cover price of a book is $24.95, but bookstores get a 40% discount. Shipping costs $3 for the first copy and 75 cents for each additional copy. What is the total wholesale cost for 60 copies?谁能告诉我我做错了什么!!答案应该是523.23,而我得到的是707.33!提前谢谢你!
发布于 2017-03-13 08:52:03
这里的问题陈述得不是很清楚。
他们是否在订单总额/图书成本等方面获得40%的折扣?
我模拟了我以为你问的问题,但我不能接近523.23。
事实上,所有的书都打了四折到14.97x60,不包括运费就到了898.20。
#first book costs 24.95
book_cost = 24.95
#they order 60 books
number_books = 60
#shipping cost of book 1 is $3
ship1_cost = 3
#shipping cost for subsequent books is 0.75
ship_cost = 0.75
#print (book 1 + shipping) + (subsequent book qty (59) * unit price) + (subsequent shipping costs (59 * 0.75))
print (book_cost + ship1_cost + ((number_books - 1) * book_cost) + ((number_books - 1) * ship_cost))发布于 2017-03-13 09:38:56
有时书籍,尤其是免费的书籍,会有打字错误和错误。
根据您提供的信息,总批发成本应为:
>>> cover_price_of_book = 24.95
>>> shipping_cost_for_first_book = 3.00
>>> shipping_cost_for_additional_books = 0.75
>>> wholesale_cost_of_book = 24.95 * .60
>>> total_number_of_books = 60
>>> total_wholesale_cost = (wholesale_cost_of_book * total_number_of_books) + (shipping_cost_for_first_book + (total_number_of_books - 1) * shipping_cost_for_additional_books)
total_wholesale_cost
945.4499999999https://stackoverflow.com/questions/42753089
复制相似问题