General Requirements
program2_1.pyWrite a program that converts miles to kilometers. Look up the conversion factor and assign it to aproperly named constant(see page 80). The program should permit the user to enter the miles perhaps with decimals,from the keyboard.Print the resultshowing both distancesusing anf_stringwith the kilometers accurate tothree decimal places.Required OutputEnter the miles 12.7512.75 miles is 20.519 kilometers
program2_2.pyWrite a program that prompts the user to enter both thenumeratoranddenominatorof animproper fraction.Review the Python math operators onpage 54anduse an f_stringto express the improper fraction asa mixed number.Example OutputEnter the numerator 34Enter the denominator 7As a mixed number that is 4 and 6/7
program2_3.pyA taxable item is available in multiple quantities. Write a program that prompts the user for theunit priceof the item and thenumberbeing purchased. The sales tax rate is 7%. Store that toproperly named constantas a decimal. Calculate and print the subtotal, the sales tax, and the total amount due. Displaycommasfor numbers of 1,000 or more. Note theapostropheinitem'sin the Example Output below. Your prompt should do that, too.Example OutputEnter the item's unit price 749.99Enter the quantity 2The subtotal is $1,499.98Sales tax is $105.00Total due is $1,604.98
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here