1.22.1 VFLab: VFConvert VFto VFSeconds
Write VFa VFprogram VFthat VFreads VFin VFhours, VFminutes, VFand VFseconds
nput,
VFas VFi VFoutputs VFthe VFtime VFin VFseconds VFonly.: VFand
2.22.2 VFLab: VFConvert VFfrom VFSeconds
People VFfind VFit VFeasier VFto VFread VFtime VFin VFhours, VFminutes, VFandrather
VFseconds VFjust VFseconds. VFthan
Write VFa VFprogram VFthat VFreads VFin VFseconds VFas VFinput VFand
VFoutputs VFthe VFt VFminutes, VFand VFseconds.: ime VFin
3.22.3 VFLab: VFPizza VFParty
Given VFthe VFnumber VFof VFpeople VFattending VFa VFpizza VFparty, umber VFof
VFoutput VFthe VFn VFneeded VFpizzas VFand VFtotal VFcost. VFFor VFthe VFeople
VFcalculation, VFassume VFthat VFp VFslices VFon VFaverage VFand VFeachVFeat VF2
VFpizza VFhas VF12 VFslices VFand VFcosts VF$14.95.:
4.22.4 VFLab: VFHypotenuse
Given VFtwo VFnumbers VFthat VFrepresent VFthe VFlengths VFof VFas VFlegs
VFright VFtriangle' VFadjacent VFto VFthe VFright VFangle), VFoutput VFthe VF(sides
VFlength VFof VFthe VFthird VFside VF(i.e. VFwith VFtwo VFdigits VFafter VFthe VFhypotenus
VFdecimal VFpoint.:
5.22.5 VFLab: VFArea VFof VFa VFTriangle
Using VFHeron's VFformula, VFyou VFcan VFcalculate VFthe VFarea VFof VFa you VFknow
VFtriangle VFif VFlengths VFof VFall VFthree VFsides. VFGiven VFthe VFlength VFthe VFngle
VFof VFeach VFside VFof VFa VFtria VFcalculate VFthe VFarea VFof VFthe VFas VFinput,
VFtriangle VFusing VFHeron's VFformula VFas VFfollow VFs VF= VFhalf VFof s:
VFthe VFtriangle's VFperimeter
area VF= VFthe VFsquare VFroot VFof VFs(s-a)(s-b)(s-c), VFwhere VFa, VFb, VFand VFc VFare
VFeach VFsides VFof VFthe VFtriangle.:
6.22.6 VFOrdering VFPizza
A VFlocal VFpizza VFshop VFis VFselling VFa VFlarge VFpizza VFfor VF$9.99. mber VFof
VFpizzas
VFGiven VFthe VFnu VFto VForder VFas VFinput, VFoutput VFthe VFsubtotal VFfor
VFthe VFpizzas, VFand VFthen VFou VFafter VFapplying VFa VFsales VFtax VFof VFtput VFthe
VF6%:
7.22.7 VFLAB: VFSquare VFroot
Given VF a VF floating-point VF number VF as VF input, VF output VF thef VFthe
VFgiven
1
VF/
Write VFa VFprogram VFthat VFreads VFin VFhours, VFminutes, VFand VFseconds
nput,
VFas VFi VFoutputs VFthe VFtime VFin VFseconds VFonly.: VFand
2.22.2 VFLab: VFConvert VFfrom VFSeconds
People VFfind VFit VFeasier VFto VFread VFtime VFin VFhours, VFminutes, VFandrather
VFseconds VFjust VFseconds. VFthan
Write VFa VFprogram VFthat VFreads VFin VFseconds VFas VFinput VFand
VFoutputs VFthe VFt VFminutes, VFand VFseconds.: ime VFin
3.22.3 VFLab: VFPizza VFParty
Given VFthe VFnumber VFof VFpeople VFattending VFa VFpizza VFparty, umber VFof
VFoutput VFthe VFn VFneeded VFpizzas VFand VFtotal VFcost. VFFor VFthe VFeople
VFcalculation, VFassume VFthat VFp VFslices VFon VFaverage VFand VFeachVFeat VF2
VFpizza VFhas VF12 VFslices VFand VFcosts VF$14.95.:
4.22.4 VFLab: VFHypotenuse
Given VFtwo VFnumbers VFthat VFrepresent VFthe VFlengths VFof VFas VFlegs
VFright VFtriangle' VFadjacent VFto VFthe VFright VFangle), VFoutput VFthe VF(sides
VFlength VFof VFthe VFthird VFside VF(i.e. VFwith VFtwo VFdigits VFafter VFthe VFhypotenus
VFdecimal VFpoint.:
5.22.5 VFLab: VFArea VFof VFa VFTriangle
Using VFHeron's VFformula, VFyou VFcan VFcalculate VFthe VFarea VFof VFa you VFknow
VFtriangle VFif VFlengths VFof VFall VFthree VFsides. VFGiven VFthe VFlength VFthe VFngle
VFof VFeach VFside VFof VFa VFtria VFcalculate VFthe VFarea VFof VFthe VFas VFinput,
VFtriangle VFusing VFHeron's VFformula VFas VFfollow VFs VF= VFhalf VFof s:
VFthe VFtriangle's VFperimeter
area VF= VFthe VFsquare VFroot VFof VFs(s-a)(s-b)(s-c), VFwhere VFa, VFb, VFand VFc VFare
VFeach VFsides VFof VFthe VFtriangle.:
6.22.6 VFOrdering VFPizza
A VFlocal VFpizza VFshop VFis VFselling VFa VFlarge VFpizza VFfor VF$9.99. mber VFof
VFpizzas
VFGiven VFthe VFnu VFto VForder VFas VFinput, VFoutput VFthe VFsubtotal VFfor
VFthe VFpizzas, VFand VFthen VFou VFafter VFapplying VFa VFsales VFtax VFof VFtput VFthe
VF6%:
7.22.7 VFLAB: VFSquare VFroot
Given VF a VF floating-point VF number VF as VF input, VF output VF thef VFthe
VFgiven
1
VF/