COP 2250 - Programming in Java Professor: Michael Robinson e-mail : mrobi002@cs.fiu.edu Web Page : www.cs.fiu.edu/~mrobi002/teaching Program 3, covering Multidimensional Arrays, swap, endless while loop, DUE ON Thursday October 20th, 2011 AT THE BEGINNING OF CLASS - Passing 3 numbers call a function that will print these numbers in ascending order, e.i. if you pass (98, 234, 6) print 6 98 234 - Using a while(1) loop, print the upper case alphabeth and its corresponding ascii values, from Z to A Note: You must terminate/exit/break this loop once you print the last letter (A) The while(1) loop is called an endless loop because the 1 inside the while means that the loop is true, and it is not a terminating variable. - Create a two dimensional array of 10 rows by 10 columns to store integers Load each location in this array with the sum its row + column Add all the diagonal values in this array (from 0,0 to 9,9), and print the total Add all the diagonal values in this array (from 0,9 to 9,0), and print the total Subtract the values of the second computation from the first one, and print the total. - Implement division by 0, with error trapping, using if and while() commands, make sure to use "casting" e.i. float result = (float)int/int; How: Using a while loop, read 2 numbers from the user. Using the if statement, test that the second number in not zero, if it is zero inform the user of the error, and do the loop again to ask for a correct second number. if the second number is NOT a zero, do the division, display all numbers and the computation using labels, the result MUST have 2 decimal places, e.i. "The first number 10 divided by the second number 5 is 2.00" then exit the while loop entering the value 999 for the first or the second number. - Using the loop of your choice, and the print of your choice display all numbers from 0 to 1,000 where "mod 5 = 3". Hint: %