Programming in Python
22.1Given two numbers that represent the lengths of a right triangle's legs (sides
adjacent to the right angle), output the length of the third side (i.e. hypotenuse) with two
digits after the decimal point.
22.2 Lab: Area of a Triangle
Using Heron's formula, you can calculate the area of a triangle if you know the lengths
of all three sides. Given the length of each side of a triangle as input, calculate the area
of the triangle using Heron's formula as follows:
s = half of the triangle's perimeter
area = the square root of s(s-a)(s-b)(s-c), where a, b, and c are each sides of the
triangle.
22.3Ordering Pizza
A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order
as input, output the subtotal for the pizzas, and then output the total after applying a
sales tax of 6%
22.4 LAB: Square root
Given a floating-point number as input, output the square root of the given number.