24. Rewrite these two statements as one: String name; name = “John”; 25. Rewrite these two statements as one: Bank john; john = new Bank(); Refer to program Java0604.java for questions 26 and 27. 26. Write 1 line of Java code that will make a $150,000 withdrawal from your checking account. 27. Write 1 line of Java code that will make a $400,000 withdrawal from your savings account. 28. Which class lets you control the output appearance of numbers? Refer to program Java0605.java for questions 29 and 30. 29. Write 1 line of Java code that will create a DecimalFormat object that will be used to display numbers with up to 3 digits. 30. Write 1 line of Java code that will use the object you created in the previous question to display the as number “23” “023”. Refer to program Java0606.java for question 31. 31. If the following line of Java code was added to the program, what would be its output? System.out.println(output.format(1234567890)); Refer to program Java0607.java for questions 32 through 34. 32. Does the object always need to be called DecimalFormat output? 33. If the following line of Java code was added to the program, what would be its output? System.out.println(money.format(Math.PI)); 34. If the following line of Java code was added to the program, what would be its output? System.out.println(money.format(345.678)); Refer to program Java0608.java for questions 35.
24. Rewrite these two statements as one: String name; name = “John”; 25. Rewrite these two statements as one: Bank john; john = new Bank(); Refer to program Java0604.java for questions 26 and 27. 26. Write 1 line of Java code that will make a $150,000 withdrawal from your checking account. 27. Write 1 line of Java code that will make a $400,000 withdrawal from your savings account. 28. Which class lets you control the output appearance of numbers? Refer to program Java0605.java for questions 29 and 30. 29. Write 1 line of Java code that will create a DecimalFormat object that will be used to display numbers with up to 3 digits. 30. Write 1 line of Java code that will use the object you created in the previous question to display the number “23” as “023”. Refer to program Java0606.java for question 31. 31. If the following line of Java code was added to the program, what would be its output? System.out.println(output.format(1234567890)); Refer to program Java0607.java for questions 32 through 34. 32. Does the DecimalFormat object always need to be called output? 33. If the following line of Java code was added to the program, what would be its output? System.out.println(money.format(Math.PI)); 34. If the following line of Java code was added to the program, what would be its output? System.out.println(money.format(345.678)); Refer to program Java0608.java for questions 35.
Exercises06.01-04.docx