Question

develop an automated invoice generator that helps a shop owner to design their invoice. Problem 1...

develop an automated invoice generator that helps a shop owner to design their invoice. Problem 1 (Defining products and Creating a Menu) Write a program called a2_p1.py that asks a shop owner for product information and creates a menu system that allows customers to purchase multiple products of varying quantities. The program should start by asking the shop owner’s name and company name. Next it should ask for three (3) products and their prices. Finally, it should display a menu.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

List are created, first list to store name of products, second list to store price of product, third list to store quantity of product as per customer requirement, fourth list for total price of that product, i.e., price of product * quantity of product.
First loop to store product description, second loop for for product quantity and purchase cost,  in third or final loop total price and total of quantity is done and printing of menu is done.

CODE:

#owner section
ownername = input("Enter Owner's Name:")
companyname = input("Enter Company's Name:")
productname = []
productprice = []
inputline = ""
for i in range(1,4):
print("Enter name of the", i ,"product:", end = '')
x= input()
y= eval(input("Enter price of this product:"))
productname.append(x)
productprice.append(y)

#customer section
quantity = []
output = []
for i in range(0,3):
print("Enter the quantity of", productname[i],":", end='')
quantity.append(eval(input()))
output.append(productprice[i]*quantity[i])

#INVOICE section
print("{:^40}".format("INVOICE"))
print("{:^40}".format(companyname))
print("{:^40}".format(ownername))
print("{:<15}{:^10}{:>15}".format("Product", "Quantity", "Price"))
total=0
qty=0
for i in range(0,3):
print("{:<15}{:^10}{:>15}".format(productname[i], quantity[i], output[i]))
total = total + output[i]
qty= qty + quantity[i]
print("{:<15}{:^10}{:>15}".format("Total:", qty, total))

Add a comment
Know the answer?
Add Answer to:
develop an automated invoice generator that helps a shop owner to design their invoice. Problem 1...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Boston high students want to open their own shop to sell things for their customers. For...

    Boston high students want to open their own shop to sell things for their customers. For instance, they can open a business of their own that sell things such as electronic devices ,drones ,books, clothing, or anything. Therefore they must use a customized program for their shops. The program is like stocks inventory and sales systems combined into one system. For example to develop Management Retailer System (Stock Inventory and Customer Sales). The program must be able to calculate and...

  • Project 1, Program Design 1. Write a C program replace.c that asks the user to enter...

    Project 1, Program Design 1. Write a C program replace.c that asks the user to enter a three-digit integer and then replace each digit by the sum of that digit plus 6 modulus 10. If the integer entered is less than 100 or greater than 999, output an error message and abort the program. A sample input/output: Enter a three-digit number: 928 Output: 584 2. Write a C program convert.c that displays menus for converting length and calculates the result....

  • Questions 1. With a portfolio as diverse as Google's, what are the company's core brand values?...

    Questions 1. With a portfolio as diverse as Google's, what are the company's core brand values? GOOGLE In 1998, two Stanford University PhD students, Larry Page and Sergey Brin, founded a search engine company and named it Google. The name plays on the number googol-1 followed by 100 zeroes—and refers to the massive quantity of data available online that the company helps users find. Google's corporate mission is "To organize the world's information and make it universally accessible and useful."...

  • ________ individuals attempt to control situations, including the thoughts and actions of others. Question 1 options:...

    ________ individuals attempt to control situations, including the thoughts and actions of others. Question 1 options: A) Analytical B) Responsive C) Versatile D) Expressive E) Assertive Save Question 2 (1 point) Ken likes to see the big picture when salespeople present to him. He finds it enjoyable to know a little about them and their families. He takes his work very seriously, and the company's overall success, as well as his own personal success, are very important to him. Ken...

  • Additional code needed: PartA: BurgerOrder class (1 point) Objective: Create a new class that represents an...

    Additional code needed: PartA: BurgerOrder class (1 point) Objective: Create a new class that represents an order at a fast-food burger joint. This class will be used in Part B, when we work with a list of orders. As vou work through this part and Part B, draw a UML diagram of each class in using the UML drawing tool 1) Create a new Lab5TestProject project in Netbeans, right-click on the lab5testproject package and select New>Java Class 2) Call your...

  • Need help with C++ assignment Assignment 1 and .txt files are provided at the bottom. PART...

    Need help with C++ assignment Assignment 1 and .txt files are provided at the bottom. PART A PART B Assignment 1 #include <iostream> #include <string> #include <fstream> #include <iomanip> #include <stdio.h> #include <ctype.h> #include <string.h> #include <algorithm> using namespace std; /** This structure is to store the date and it has three integer fields **/ struct Date{    int day;    int month;    int year; }; /** This structure is to store the size of the box and it...

  • Read about Cokes strategy in Africa in the article below and discuss the ethics of selling...

    Read about Cokes strategy in Africa in the article below and discuss the ethics of selling soft drinks to very poor people. Is this an issue that a company like Coke should consider? Africa: Coke's Last Frontier Sales are flat in developed countries. For Coke to keep growing, Africa is it By Duane Stanford Piles of trash are burning outside the Mamakamau Shop in Uthiru, a suburb of Nairobi, Kenya. Sewage trickles by in an open trench. Across the street,...

  • And there was a buy-sell arrangement which laid out the conditions under which either shareholder could...

    And there was a buy-sell arrangement which laid out the conditions under which either shareholder could buy out the other. Paul knew that this offer would strengthen his financial picture…but did he really want a partner?It was going to be a long night. read the case study above and answer this question what would you do if you were Paul with regards to financing, and why? ntroductloh Paul McTaggart sat at his desk. Behind him, the computer screen flickered with...

  • What an Executive Summary Is An executive summary is a specific type of document that does...

    What an Executive Summary Is An executive summary is a specific type of document that does two things: it summarizes a research article, and it offers recommendations as to how information from the article can be used. Some long reports can contain an executive summary section, as indicated in the Pearson handbook. Write a 2 pahe Executive Summary In business contexts, an executive summary is always written for a specific purpose: to explain the information in the article to a...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT