pg142-22 - sweater:= (height*weight)/301 end Procedure

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 program Sizes vars height, weight, age, hatsize, sweatersize, pantsize : real Procedure GetData(var height, weight, age: real) begin writeln('Please enter your height in inches, then press enter:') readln(height) writeln('Please enter your weight in pounds, then press enter:') readln(weight) writeln('Please enter your age in years, then press enter:') readln(age) end Procedure CalcHat(height, weight, age :real var hat:real) begin hat:= (weight/height)*2.9 end Procedure CalcSweater(height,weight,age :real var sweater:real) begin If age>30 then sweater= ((height*weight)/301) + (0.125*(age/10)) else {age<30}
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: sweater:= (height*weight)/301 end Procedure CalcPant(height,weight,age:real var pant:real) begin If age>28 then pant:= (weight/5.7) + (0.10*(age/2)) else pant:= weight/5.7 Sheet1 Page 2 end Procedure OutputSizes(hat,sweater,pant:real) begin writeln('Your hat size is: ', hat) writeln('Your sweater size is: ',sweater) writeln('Your pant size is: ' pant) end begin {program} GetData(height,weight,age) CalcHat(height,weight,age,hatsize) CalcSweater(height,weight,age,sweatersize) CalcPant(height,weight,age,pantsize) OutputSizes(hatsize,sweatersize,pantsize) end....
View Full Document

This note was uploaded on 03/27/2008 for the course CPSC 110 taught by Professor Logan during the Spring '07 term at Texas A&M.

Page1 / 2

pg142-22 - sweater:= (height*weight)/301 end Procedure

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online