Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part A Create a program called ph.py that determines the acidity or basicity of a solution. It should ask the user to enter a numeric

image text in transcribed
image text in transcribed
Part A Create a program called ph.py that determines the acidity or basicity of a solution. It should ask the user to enter a numeric pH value. It should then call a function that accepts the value as a parameter and returns a string indicating that the solution is acidic (pH less than 7), basic (pH greater than 7), or neutral (pH is 7); it should return "invalid" if the value is greater than 14 or less than zero*. Finally, your script should then output the returned string for the user to see. *Note that values less than 0 or greater than 14 are okay in reality--but for this assignment we'll consider them invalid. Part B Create a program called price.py that calculates the price of a purchase, including tax. Use a prompt to get (from the user) the subtotal of a purchase and the tax rate percentage. Then call a user-defined function that accepts both values as parameters and returns a total price. Display this returned value for the user. Create a program called price.py that calculates the price of a purchase, including tax. Use a prompt to get (from the user) the subtotal of a purchase and the tax rate percentage. Then call a user-defined function that accepts both values as parameters and returns a total price. Display this returned value for the user. What To Submit 1. ph.py 2. price.py Be sure to include a comment block at the top of each submitted file with a heading that includes your name, the assignment name, and a brief description of the program/script. See below for an example. Sample comment block: # John Smith # Module 04 Programming Assignment # Part B # This program converts temperatures f

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

If you were Adidas, how would you compete with Nike?

Answered: 1 week ago