Docsity

D335 Introduction to Programming in Python exam with correct answers, Exams of Nursing

Toggle sidebar
bg1
D335 ||\\||\\ Introduction ||\\||\\ to ||\\||\\ Programming ||\\||\\ in ||\\||\\
Python ||\\||\\ exam ||\\||\\ with ||\\||\\ correct ||\\||\\ answers
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.
pf3
pf4
pf5

Partial preview of the text

Download D335 Introduction to Programming in Python exam with correct answers and more Exams Nursing in PDF only on Docsity!

D335||\||\ Introduction||\||\ to||\||\ Programming||\||\ in||\||\

Python||\||\ exam||\||\ with||\||\ correct||\||\ answers

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||\||\

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 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||\||\