Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exception Handling You decide to upload your recent project to a programming community website for feedback, and one thing that community users keep pointing to

Exception Handling

You decide to upload your recent project to a programming community website for feedback, and one thing that community users keep pointing to is the lack of exception handling. Realizing that they are correct, you decide to rectify the situation and improve your programs or at least one of them. Take one of the programs you designed over the past couple of weeks and enhance the program with exception handling code. Your program should incorporate the TRY and EXCEPT blocks and handle any errors and exceptions that you can find.

For this project:

You will submit your python code in either the original .py file, or copied into a .txt file.

A screenshot of your code having been executed and demonstrating your exception handling

Week #1

#!/usr/bin/python print('Welcome to the Express Lane!') firstPrice =float(input('Enter the first price: ')) secondPrice =float(input('Enter the second price: ')) thirdPrice =float(input('Enter the third price: ')) fourthPrice =float(input('Enter the fourth price: ')) finalPrice =float(input('Enter the final price: ')) subTotal =firstPrice + secondPrice + thirdPrice + fourthPrice + finalPrice salesTax = 0.06*subTotal grandTotal =subTotal + salesTax print ('Subtotal: {:.2f}'.format(subTotal)) print ('Sales tax:{:.2f}'.format(salesTax)) print ('Total:{:.2f}'.format(grandTotal)) 

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago