Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

Program 1: Receipt Cruncher Assignment

Program 1: Receipt Cruncher Assignment

Program 1: Receipt Cruncher Assignment

Question Description

Background Information

  • Some stores are expensive; others are less so. Our mission is to generalize a grocery store into one of three categories: typical, cheap, or expensive. We’ll do this by going through each line of a receipt, and calculating the average cost of a single item including tax.
  • Let’s say a “typical” store has an average cost of $3 to $5 for an item. If it’s less than that, we’ll call it “cheap,” and a higher average cost will get our “expensive” rating.
  • Example Receipt: There are two entries. The first line shows 3 of some item (at $4.25 ea) for $12.75, and second is one item for $6.90. Sales tax is 2.5 percent.
  • Example Receipt Cruncher Calculation: 12.75 + 6.95 + $0.4925 tax is $20.1925. We have 4 items, and 20.1925 ÷ 4 is 5.048125, so we’d end up labeling that store as “expensive” (just barely!)

Assignment

  • Write a Python program that prompts the user for the number of entries on a receipt, and then for each entry prompts the user for the number of items in that entry, followed by a prompt for the cost of the entry. Output the unit price of each item.
  • After all of the entries have been entered, prompt the user to enter the sales tax (ex: 5.3)
  • Calculate the average price per item, and output whether store should be considered typical, expensive, or cheap. If it’s answer is expensive or cheap, consider the sales tax, and explain that may have impacted the rank. (See below for details.)
  • See the sample transcript below. You can assume that all user inputs will be valid when we test the program. Your solution should match the output format exactly.

Grading – 100 points

  • 35 points – The Average Cost Per Item calculation is correct.
  • 15 points – The user is prompted to enter the number of entries from the receipt (5 points), the price of each entry (5 points) and the quantity of items on each entry (5 points).
  • 10 points – With the exception of the actual average cost per item, the output format matches the output format of the transcript exactly (2 points for each type of difference up to 10 points).
  • 5 points – The average cost per item is displayed with two digits to the right of the decimal. (Look up how to round numbers in the Python documentation.)
  • 10 points – A function named get_rating is defined that takes four float parameters (item, lo, hi, tax) and correctly returns a rating as a string (e.g. “cheap”, “expensive”, or “typical”… or one of the outputs below…)
    • NEW! in the case of an extra high tax (5% or more) or an extra low tax (less than 2%) output the following:
      • (extra high tax): expensive, but you could blame that on the X% tax. (where X is the amount of the tax)
      • (extra low tax): “cheap, but it helps that the sales tax is X%!” (where X is the amount of the tax)
  • 10 points – A function named main is defined (5 points). The only python statement that does not appear in this function or the translate function is the call to the main function, e.g. main() (5 points).
  • 10 points – The Python solution is easy to understand and does not contain unnecessary code (2 points for each type of improvement up to 10 points).
  • 5 points – An appropriate Python comment appears at the top of the submission. See below for the type of information that should appear.

Sample Python Header Comment

# ---------------------------------------# CSCI 127, Joy and Beauty of Data# Program 1: Receipt Cruncher# Your Name(, Your Partner's Name)# Last Modified: January ??, 2020 # ---------------------------------------# A brief overview of the program.# ---------------------------------------

Sample Transcripts

How many entries are listed on the receipt? 1
Enter number of items in entry 1: 2
Enter that entry’s total cost: 8
Cost per item of entry 1 is: 4.0
Enter sales tax (%): 4
total cost (with tax): 8.32
total number of items: 2
average cost per item is 4.16
That store seems typical

How many entries are listed on the receipt? 1
Enter number of items in entry 1: 2
Enter that entry’s total cost: 9.98
Cost per item of entry 1 is: 4.99
Enter sales tax (%): 7.5
total cost (with tax): 10.73
total number of items: 2
average cost per item is 5.36
That store seems expensive, but you could blame that on the 7.5% tax.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20