hon
1.22.1aaLab:aaConvertaatoaaSeconds
Writeaaaaaprogramaathataareadsaainaahours,aaminutes,aaandaasecondsnput,
aaas aaan
aaiaaoutputsaatheaatimeaainaasecondsaaonly.: d
2.22.2aaLab:aaConvertaafromaaSeconds
Peopleaafindaaitaaeasieraatoaareadaatimeaainaahours,aaminutes,aaandaasecoratheraathan
ndsaajustaaseconds.
Writeaaaaaprogramaathataareadsaainaasecondsaaasaainputaaandaaoutputsime aat aainaahour
heaataaminutes,aaandaaseconds.: s,
3.22.3aaLab:aaPizzaaaParty
Givenaatheaanumberaaofaapeopleaaattendingaaaaapizzaaaparty,aaoutputaaumber
th aaofa
eaanaaneededaapizzasaaandaatotalaacost.aaForaatheaacalculation,aaassume
aeoplea aaeata
athataapaaslicesaaonaaaverageaaandaaeachaapizzaaahasaa12aaslicesaaandaaa
2co
stsaa$14.95.:
4.22.4aaLab:aaHypotenuse
Givenaatwoaanumbersaathataarepresentaatheaalengthsaaofaaaaarightaatri saalegsaa(side
angle'aaadjacentaatoaatheaarightaaangle),aaoutputaatheaalengthaaofaatheaa saahypotenu
thirdaasideaa(i.e.aawithaatwoaadigitsaaafteraatheaadecimalaapoint.: se)
5.22.5aaLab:aaAreaaaofaaaaaTriangle
UsingaaHeron'saaformula,aayouaacanaacalculateaatheaaareaaaofaaaaatrian youaaknowaath
gleaaifaalengthsaaofaaallaathreeaasides.aaGivenaatheaalengthaaofaaeachaaesiaangleaaasaain
deaaofaaaaatriaaacalculateaatheaaareaaaofaatheaatriangleaausingaaHeron'sput,
a
aformulaaaasaafollowaasaa=aahalfaaofaatheaatriangle'saaperimeter s:
areaaa=aatheaasquareaarootaaofaas(s-a)(s-b)(s-
c),aawhereaaa,aab,aaandaacaaareaaeachaasidesaaofaatheaatriangle.:
6.22.6aaOrderingaaPizza
Aaalocalaapizzaaashopaaisaasellingaaaaalargeaapizzaaaforaa$9.99.aaGivenmber
aat aaofaapizza
heaanuaatoaaorderaaasaainput,aaoutputaatheaasubtotalaaforaatheaapizzas,aasaatputaatheaat
andaathenaaouaaafteraaapplyingaaaaasalesaataxaaofaa6%: otal
7.22.7aaLAB:aaSquareaaroot
Givenaaaaafloating- faatheaagive
pointaanumberaaasaainput,aaoutputaatheaasquareaarootaaoaanumber.: n
8.22.8aaLAB:aaVolumeaaandaaareaaaofaacylinder
1aa
/