Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are to create a module that I can import into my program that performs according to specification. Here's what the module will do: 1.

You are to create a module that I can import into my program that performs according to specification. Here's what the module will do: 1. The first program will be named get_state_sales_tax().

this function doesn't have any parameters, but does return a dictionary

the function reads a file named taxes.csv, attached, and splits the data into state and sales tax rate multiplier

the state serves as the key and tax rate multiplier as the value for each key-value pair in the dictionary

note that the name of the function MUST BE named get_state_sales_tax()

2. The second program will be named get_state_total(s, p, r)

The first parameter is a string and contains the name of a state

The second is a floating point value representing a price

The third is a floating point value representing a sales tax multiplier

The purpose of the function is to return a string suitable for display that includes the state, the price and the total price, including sales tax

The string should look like this

New Jersey (price / with tax): $1.95 / $2.09

where s is "New Jersey", p is 1.95 and r is 1.07

The field width for the state must be 15 characters wide with blank fill so that the dollar signs all line up (refer to the video)

3. The third program is named log_it(m) and logs a message, m, appending it to the end of a text file.

The log file must be named tax_log.txt

The old messages must be preserved, meaning the file gets longer and longer each time log_it(m) is called.

Remember to open and close the file at the start and end of the function

Remember to append a new line to each message when writing the file

Note that all files must be in the same directory. That includes the test programs, your module and the CSV file. Resources: Here's a video demonstrating how your program should behave and what the display should look like: https://youtu.be/HBOjFmJC17g unit_test1.py - This program tests just your taxes.get_state_sales_tax() function. Make no changes to unit_test1.py. Just run it. unit_test2.py - This program tests just your taxes.get_state_total() function. Make no changes to unit_test2.py. Just run it. unit_test3.py - This program tests your taxes.log_it() function. Make no changes to unit_test3.py. Just run it. test_taxes.py - System test program. You run this program to test that all of the functions in your module work. You do not make any changes to this file. You just run it.

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

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

5 The mechanics of the circular flow model.

Answered: 1 week ago

Question

1 The difference between a command system and a market system.

Answered: 1 week ago

Question

4 How the market system adjusts to change and promotes progress.

Answered: 1 week ago