Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

%%%%% Python %%% Object orientated programming %%%%% Python%%%%%% Python interpreter Atom %%%%%%%% Background A company sells widgets and offers incentives for customers who buy larger

%%%%% Python %%% Object orientated programming %%%%% Python%%%%%% Python interpreter Atom %%%%%%%%

image text in transcribed

Background A company sells widgets and offers incentives for customers who buy larger quantities. The base price of a widget is $30. Customers who by 50 or more widgets pay $25 per widget. Customers who buy 100 or more widgets get the first 10 widgets free and pay $22 per widget for the remaining widgets. Most customers have to pay Maryland sales tax (which is 6%), but some organizations are tax-exempt Instructions Upload a file containing a function that calculates the total cost of a customer's order. Your function should satisfy the following specifications: the function should take two arguments, in the following order: o the number of widgets a customer has ordered (assume this will be a non-negative integer) o whether or not the customer must pay sales tax (assume this will be a boolean value; True means the customer has to pay tax; False means they do not) the function should calculate the total cost of the customer's order, including tax if applicable, according to the pricing scheme in the Background section o Hint: you can calculate the total cost with tax by multiplying the pre- tax amount by 1.06 the function should return the total cost as a float (an integer is okay in cases where the total cost can be expressed as an integer with no loss of precision)

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_2

Step: 3

blur-text-image_3

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

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions