Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

1. What types of market research method did Ballygowan use?

Answered: 1 week ago