pretty_receipt.py. OK, it is time to combine a few of the things you have been learning. This will expand upon the receipt.py program written earlier. It will also require you to lookup on the Internet a bit of how to do two of the requirements, as that is an important skill to learn, too. Don't worry, it is a simple requirement that is easy to locate online with examples. You will need to take strings, process them using some of the functions in chapter 8, and output a pretty, and organized, receipt. 1) Like the prior receipt program, this script will prompt users for items that are being purchased. This time, however, you will need to also capture a category for each product. This capture should be done in one entry (so it is easy on the user) and your program should manage the processing of what the user entered in the program. The format should be Category Product Quantity Price. Here is a sample item: Dairy, Milk-gallon, 2, 2.29 2) when the user is done processing your program should output in the following manner ***** RECEIPT ***** 10/13/2022 1:03 PM Total items: Cat Product Dairy Milk-gallon Yogurt Pet Tug toy 1 $5.39 Apple-Macintosh, 3lb 1 $3.97 Produce Subtotal Tax Qty Price 2 $2.29 3 $1.28 Total Paid Change $13.02 $0.86 ******** $13.88 $20.00 $6.02 parts of the requirements Numbers should be aligned on the right side of the receipt. They should be formatted according the designated currency using a locale (i.e. not hard coded... so your program shouldn't use $ in it)-- this is what you need to search online for Your products will be grouped into the categories and should be printed, in sorted order by category and sorted by product name within a category (think back to the sports roster assignment) Also output the date the program is run as the date and time for the receipt (also, you can look up how to do this fairly simply) You can decide how "wide" the recient is but columns should alion appropriately right aligned numbers and left aligned text)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Help me on the python program
**Title: Understanding and Implementing Receipt Generation in Python**

---

**Introduction:**

This guide focuses on expanding a receipt generation program ("pretty_receipt.py") using Python. It details the steps and requirements for creating a structured receipt that includes categories for purchased items.

---

**Requirements:**

1. **Prompting User Input:**
    - Similar to a previous version, the script will ask users for details about items being purchased.
    - This version requires users to input a category alongside each product for organizational purposes.
    - Input format: `Category Product Quantity Price` (e.g., Dairy, Milk-gallon, 2, 2.29).

2. **Output Structure:**
    - The receipt will be printed in a formatted manner.
    - Sample output format:
    
      ```
      ***** RECEIPT *****
      10/13/2022 1:03 PM
      ---------------------------------------------
      Total items: 7
      ---------------------------------------------
      Cat  Product                Qty   Price
      Dairy 
          Milk-gallon              2       $2.29
          Yogurt                   3       $1.28
      Pet
          Tug toy                  1       $5.39
      Produce
          Apple-Macintosh, 3lb     1       $3.97

      Subtotal                              $13.02
      Tax                                     $0.86
      Total                                 $13.88
      Paid                                  $20.00
      Change                                 $6.02
      ```

3. **Key Aspects to Implement:**

    - **Alignment and Formatting:**
        - Numbers must be right-aligned using locale-based formatting to ensure correct currency representation.

    - **Category Grouping:**
        - Products should be organized by category and printed in a sorted order.

    - **Date and Time:**
        - Automatically include the current date and time on the receipt.

    - **Receipt Width:**
        - Ensure columns are appropriately aligned for clarity, with numbers right-aligned and text left-aligned.

---

**Conclusion:**

By following these guidelines, the program will generate a clear and organized receipt, improving user interaction and data presentation. This approach not only refines the appearance of the receipt but also enhances functionality by adding categorization and detailed output formatting.
Transcribed Image Text:**Title: Understanding and Implementing Receipt Generation in Python** --- **Introduction:** This guide focuses on expanding a receipt generation program ("pretty_receipt.py") using Python. It details the steps and requirements for creating a structured receipt that includes categories for purchased items. --- **Requirements:** 1. **Prompting User Input:** - Similar to a previous version, the script will ask users for details about items being purchased. - This version requires users to input a category alongside each product for organizational purposes. - Input format: `Category Product Quantity Price` (e.g., Dairy, Milk-gallon, 2, 2.29). 2. **Output Structure:** - The receipt will be printed in a formatted manner. - Sample output format: ``` ***** RECEIPT ***** 10/13/2022 1:03 PM --------------------------------------------- Total items: 7 --------------------------------------------- Cat Product Qty Price Dairy Milk-gallon 2 $2.29 Yogurt 3 $1.28 Pet Tug toy 1 $5.39 Produce Apple-Macintosh, 3lb 1 $3.97 Subtotal $13.02 Tax $0.86 Total $13.88 Paid $20.00 Change $6.02 ``` 3. **Key Aspects to Implement:** - **Alignment and Formatting:** - Numbers must be right-aligned using locale-based formatting to ensure correct currency representation. - **Category Grouping:** - Products should be organized by category and printed in a sorted order. - **Date and Time:** - Automatically include the current date and time on the receipt. - **Receipt Width:** - Ensure columns are appropriately aligned for clarity, with numbers right-aligned and text left-aligned. --- **Conclusion:** By following these guidelines, the program will generate a clear and organized receipt, improving user interaction and data presentation. This approach not only refines the appearance of the receipt but also enhances functionality by adding categorization and detailed output formatting.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY