Jeremy Fallick's Computer Science 7 Portfolio-True Basic-Chapter 1_2

Jeremy Fallick's Portfolio-True Basic-Chapter 1_2



Home
HTML
→True Basic
→Chapter 1
→Chapter 1_2
→Chapter 2
→Chapter 3
→Chapter 4
→Chapter 5
→Linear Functions Program
Article Reviews
! Jeremy Fallick
! September 9, 2004
! Period 6
! Chapter 1, Problem 3
print "Length of side 1:"
input side1
print "Length of side 2:"
input side2
let area=side1*side2
print "Given a rectangle with one side"; side1
print "feet long, and the other side"; side2
print "feet long, the area would be"; area
print "square feet."
end
! Jeremy Fallick
! September 9, 2004
! Period 6
! Chapter 1, Problem 4
input prompt "Length of side:":side
input prompt "Height:":height
let volume=side^2*height/3
print "Given a square pyramid with each side"; side
print "feet long, and a height of"; height
print "feet, the volume will be"; volume
print "cubic feet."
end
! Jeremy Fallick
! September 9, 2004
! Period 6
! Chapter 1, Problem 5
print "Miles at start:"
input start_miles
print "Miles at end:"
input end_miles
print "Gallons of gas used:"
input gallons_of_gas
let miles_driven=end_miles-start_miles
let miles_per_gallon=miles_driven/gallons_of_gas
print "If the odometer started at"; start_miles
print "miles, and ended at"; end_miles
print "miles, and"; gallons_of_gas
print "gallons of gas were used, then the car got"; miles_per_gallon
print "miles per gallon."
end
! Jeremy Fallick
! September 9, 2004
! Period 6
! Chapter 1, Problem 6
input prompt "End value:":end_value
input prompt "Start value:":start_value
let total_increase=end_value-start_value
let average_monthly_increase=total_increase/12
print "If the stock started the year at $"; start_value
print "and ended the year at $"; end_value
print "then the average monthly increase is $"; average_monthly_increase; "."
end
! Jeremy Fallick
! September 9, 2004
! Period 6
! Chapter 1, Problem 7
print "Temperature in Celsius"
input Celsius
let Fahrenheit=9/5*Celsius+32
print "If the temperature is"; Celsius
print "degrees Celsius, then it is"; Fahrenheit
print "degrees Fahrenheit."
end
!Jeremy Fallick
!September 13, 2004
!Period 6
!Chapter 1, Problem 8
input prompt "Number of miles:":miles
let feet=miles*5280
let inches=feet*12
let centimeters=inches*2.54
print "There are"; centimeters
print "centimeters in"; miles
print "miles."
end
!Jeremy Fallick
!September 13, 2004
!Period 6
!Chapter 1, Problem 9
print "Ounces in first box:"
input ounces_1
print "Pounds in second box:"
input pounds
let ounces_2=pounds*16
print "Price of first box:"
input price_1
print "Price of second box:"
input price_2
let unit_price_1=price_1/ounces_1
let unit_price_2=price_2/ounces_2
print "If the"; ounces_1
print "-ounce box costs $"; price_1
print ", and the"; pounds
print "-pound box costs $"; price_2
print ", then the cost per ounce for the"; ounces_1
print "-ounce box is $"; unit_price_1
print ", and the cost per ounce for the"; pounds
print "-pound box is $"; unit_price_2
end