This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Print out “kilometers traveled gas consumed mileage” Print out kilometers traveled and kilometers / gallon. Stop More Examples Prompt user for values for x and y (integers) Read in values for x and y If x > 15 // Selection Multiply x by 5.4 Print out value of new x // sequence within selection Else Print out value for y Endif If y < 3 // Selection Divide y by 4 Multiply x by y giving new total End if Set a to 1. For a = 1 to 10 step by 1 // iteration Print out a End for Set I = 0 While (I < 10) // iteration Multiply xxxxx Print …. Increment I by 1 End-while For (j = 0, j < 100, increment j by 1) // iteration Add Subtract Print Prompt Read in … End for If a > b Add 3 to total While total < 345 (// as long as total is less than 345 do the following…) Multiply xxxxx Divide xxxxxx Print out xxxxx Increment total by 20 End while Else Print “That’s all folks” End if...
View Full Document
- Summer '08