Question: 1) Write a tax calculator. (in python) Define a variable called price, and assign a float value (cost of a burrito) to price. Define a
1)
Write a tax calculator. (in python)
- Define a variable called "price", and assign a float value (cost of a burrito) to "price".
- Define a variable called "taxRate", and assign a percentage value to "taxRate" (use the sales tax rate for California).
- Define a variable called "tax", and assign a 0 to it
- calculate the tax using equation: tax = price * taxRate.
- Print out the string "The tax is:" and the tax value on the same line.
2)
Get user input and convert to different base. (in python)
- Use the input statement to ask the user to input an integer (decimal number with no decimal point).
- Print out "the number you entered is: " and print out the number they entered.
- Print out "Your number in binary is: " and print out the answer on the same line (in binary).
- Print out "Your number in hexadecimal is: " and print out the answer on the same line (in hexadecimal).
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
