

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A series of programming exercises designed to introduce fundamental concepts in python programming. The exercises cover various topics, including time conversion, geometric calculations, and basic input/output operations. Each exercise provides a clear problem statement and instructions, allowing students to practice their coding skills and gain practical experience in python.
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!


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πr