Question: Python Programming Invoice Class Introduction : Assignment requires creating classes and instantiating objects from created class Instructions : Follow the instructions below 1. Add a

Python Programming

Invoice Class

Introduction:

Assignment requires creating classes and instantiating objects from created class

Instructions:

Follow the instructions below

1. Add a title comment block to the top of the new Python file using the following form

2. Complete assignment and create the Invoice class as per instruction:

(Invoice Class) Make a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as data attributesa part number (a string), a part description (a string), a quantity of the item being purchased (an int) and a price per item (a Decimal). Your class should have an _init_ method that initializes the four data attributes. Provide a property for each data attribute. The quantity and price per item should each be non-negativeuse validation in the properties for these data attributes to ensure that they remain valid. Provide a calculate_invoice method that returns the invoice amount (that is, multiplies the quantity by the price per item). Demonstrate class Invoice's capabilities.

3. Once you have written the class, design a program that creates two Invoice Objects to hold the following data:

_____________________________________________________________________________________

Part NumDescriptionQuantity PriceTotal

1001Hammer2015300

1002locks15575

4. The program should store this data in the two objects, then display the object information in the manner shown in the table above , note that the total is NOT hardcoded, it's calculated based on the item's quantity and price

Write program Pseudocode (detail algorithm) and add it as a comment block.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!