Question: Use python language to code thanks in advance For this assignment, there are several parts. Make sure to identify each part in your code with
Use python language to code thanks in advance
For this assignment, there are several parts. Make sure to identify each part in your code with comments (example: # PART 1). Display the part to the screen as well, and skip lines between each part for readability (example: print(" PART2"))
Display a "hello" message, then skip a line.
PART 1
- Prompt for the user's full (first and last) name and store it in a variable
- Echo the response
PART 2
- Prompt the user for two integers and store them in variables
- Add the two numbers and store the result in another variable
- Display the expression and result (example: user inputs 8 and 4, display 8 + 4 = 12)
- Using the same two integers (i.e. don't prompt for new values), calculate and display the subtraction expression (example: 8 - 4 = 4)
- NOTE: Do not assume the two integers are 8 and 4, the user could enter ANY integer (positive, negative, or zero)
PART 3
- Prompt the user for an integer number of seconds and store it in a variable
- Display the equivalent number of hours, minutes, and seconds
- Example: 9999 seconds is 2 hours, 46 minutes, and 39 seconds
- NOTE: There are 3600 seconds in an hour, 60 minutes in an hour, and 60 seconds in a minute
- NOTE: In Python, integer division (int / int) could result in a decimal value (example: 17 / 5 results in 3.4)
- NOTE: In Python, integer modulus (int % int) will result in the integer remainder (example: 17 % 5 results in 2)
- NOTE: Do not assume the time is 9999 seconds, or the result will be 2 hours, 46 minutes, and 39 seconds
PART 4
- Prompt the user for an item price (example: How much does the first item cost?) and store it in a variable
- Prompt the user for another item price and store it in a variable
- Calculate and display in a table the after-tax price of both items for 6%, 7%, and 8% sales tax
- Column 1 should be center-aligned, all other columns should be right-aligned
- In the header row, format the sales taxes as percentages with 1 decimal place
- Include a separator line (as shown in the image below)
- Show 2 decimal places for all prices
- Column 1 width should be 6
- Column 2, 3, 4, and 5 widths should be 10
- NOTE: When combining formatting types, the alignment goes first, followed by the display (example: {:<8.3f} is left-aligned in 8 spaces, and the number is displayed in fixed notation to 3 decimal places)
- NOTE: To get the after-tax price at 6%, multiply the price by 1.06 (example: if price is $10.00, then after-tax price at 6% is $10.60)
- NOTE: Do not assume prices and after-tax values will be as shown above (user will enter their own prices)
- NOTE: Use placeholders and format() to display the table (except for the separator line, which is just a print())
-
Skip a line, then display a "goodbye" message
Make sure to include your header comments and use "good style" to make your code readable.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
