Computer Science project code. Used python. I'll add a couple screenshots to this. item_name1 = input("Enter food item name:\n") item_price1 = float(input("Enter item price:\n")) item_quantity1 = int(input("Enter item quantity:\n")) total_cost1 = print_receipt_item(item_name1, item_price1, item_quantity1) item_name2 = input("\nEnter second food item name:\n") item_price2 = float(input("Enter item price:\n")) item_quantity2 = int(input("Enter item quantity:\n")) total_cost2 = print_receipt_item(item_name2, item_price2, item_quantity2) total_cost = total_cost1 + total_cost2 print(f"\nTotal cost: $ {total_cost:.1f}") gratuity = 0.15 * total_cost grand_total = total_cost + gratuity print(f"15% gratuity: $ {gratuity:.1f}") print(f"Total with tip: $ {grand_total:.1f}")
what about it
Asking if you think it would have this output.
Cool cool
HOW DID U KNOW-
Lol-
mb g's
Lol
anyways
Food
Lol
Just so you know, this isn't how Python would be used in real life - this would require `import`ing seveal modules to the lib, and then you'd still have to construct this code. It seems that whatever you're running the code on is a simplified version of a code editor (probably utilizing Vanilla Python). So, as long as I don't have access to this code editor, then I can't answer your question.
Thanks Aratox! This was just something I put out there because I wanted to see people's thoughts on it. But I really do like the input you gave!
Join our real-time social learning platform and learn together with your friends!