hey i need help writing an algorithm and code for this program. I know it was si
ID: 440426 • Letter: H
Question
hey i need help writing an algorithm and code for this program. I know it was simple but for some reason i cant figure out how to get started or do anything. So i would really appreciate it if someone helped me with it. And it is for python3. The program is have the user enter a subtotal and tax rate and compute/print the total. Remember that all data in python is read from keyboard as strings, so you will need to convert the input data to float before you can calculations with it and also you will need to divide the tax rate by 100 before calculating the total. And also if you can even me some example of values to make sure that the code works i would appreciate it. So i know its meant to be simple because our teacher said the program requires less than 10 lines of actual code. But again i just cant wrap my mind around it. So someone please help me!Explanation / Answer
subtotal = float(input()) taxrate = float(input())/100.0 print("tax = ", taxrate*subtotal) print("Left Amount = ", subtotal*(1-taxrate)) input: 100 25 output: tax = 25.0 Left Amount = 75.0
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.