|
What would happen to the original program if the brace after the else and its matching brace were removed? A good answer might be:In this case, nothing. With the braces in place, what follows the else is a block statement containing one statement. Without the brackes, what follows the else is the one statement contained in the block. |
Live Factorial CalculatorHere is a web page version of the factorial calculator: When you try a value of about 25 something surprising happens. The numbers the program gives for factorial are very large! In fact, they are so large that they have to be expressed in scientific notation. JavaScript (in which this program is written) will automatically do this. Java will not do this, so there is an important difference in how this program behaves and how the Java program behaves. If you needed the values of large factorials, you would have to use a double precision variable for fact. This is not completely satisfactory, however, because it will not be completely accurate (double precision floating point values have only about 15 decimal digits of accuracy). |
QUESTION 11:If you drop a brick from a tower, what will happen to the brick? Click Here after you have answered the question |