This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: totalOranges = numberOfBaskets * orangesPerBasket System.out.println ("You now have") System.out.println (orangesPerBasket + " oranges per basket and") System.out.println (numberOfBaskets + " baskets.") System.out.println ("The new total number of oranges is " + totalOrange$ } } Compiling [email protected]:~$ time javac OrangeBasket.java real 0m0.820s user 0m0.390s sys 0m0.540s Running [email protected]:~$ time java OrangeBasket Enter the number of oranges in each basket: 12 Enter the number of baskets: 3 If Ken Perry has 12 oranges per basket and 3 baskets, then the total number of oranges is 36 Now we take 6 oranges out of each basket. Sheet1 Page 2 You now have 6 oranges per basket and 3 baskets. The new total number of oranges is 18 real 0m7.407s user 0m0.070s sys 0m0.110s...
View Full Document
- Spring '10
- Ken Perry, Ken Perry OrangeBasket