D335: Introduction to Programming in Python
10 studiers recently Leave the first rating Students also studied Terms in this set (10) Western Governors UniversityD 278 Save Intro to python (OA) practice Teacher 14 terms coreillyscience Preview WGU D335 Practice Test 2 15 terms kailee_kovach5 P Preview C859 Python Syntax Teacher 83 terms cmwebPreview WGU D 15 terms xxD
22.1 Lab: Convert to Seconds
Write a program that reads in hours, minutes, and seconds as input, and outputs the time in seconds only.
22.2 Lab: Convert from Seconds
People find it easier to read time in hours, minutes, and seconds rather than just seconds.Write a program that reads in seconds as input and outputs the time in hours, minutes, and seconds.
22.3 Lab: Pizza Party
Given the number of people attending a pizza party, output the number of needed pizzas and total cost. For the calculation, assume that people eat 2 slices on average and each pizza has 12 slices and costs $14.95.
22.4 Lab: Hypotenuse
Given 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.5 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.6 Ordering 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.7 LAB: Square root
Given a floating-point number as input, output the square root of the given number.
22.8 LAB: Volume and area of cylinder
The volume and area of a cylinder are calculated as:
Volume = πr2h Area = 2πrh + 2πr2 Given the radius and height of a cylinder as floating-point numbers, output the volume and area of the cylinder.
22.9 LAB: Warm up: Variables, input, and type conversion (1) Prompt the user to input an integer between 32 and 126, a float, a character, and a string, storing each into separate variables. Then, output those four values on a single line separated by a space.(2) Extend to also output in reverse.(3) Extend to convert the integer to a character by using the 'chr()' function, and output that character.