Homwork 2 questions, COMP 110-001 (F '07), Stough Ch. 3 (p170) 2. How does a variable of aprimitive type differ from a reference variable? 4. What does the operator "new" do? 7. Assume the declarations: String str = "Going to the amusement park"; char ch; int len; int position; What is the output of the following statements? a. System.out.println(str.substring(0, 5)); b. System.out.println(str.substring(13, 22)); c. System.out.println(str.toUpperCase()); d. System.out.println(str.toLowerCase()); e. System.out.println(str.replace('t', '*')); 8. a. What method is used to create an input dialog box? b. what method is used to create an output dialog box? c. What is the name of the class that contains the methods to create the input and output dialog boxes? d. What is the name of the package that contains the class described in part c.? 9. What does the floowing statement do? (Assume that scoreStr is a String variable.) scoreStr = JoptionPane.showInputDialog("Enter the score:"); 10. Write a Java statement that creates the output dialog box in Figure 3-18. //Figure 3-18 shows a window box titled Summing, with the information icon, and //in the box is the text "The sum of 2 and 3 = 5" 13. Consider the statements: int x, y; char ch; and the input: 46 A 49 Write the Java statements that would store 46 into x, 'A' into ch, and 49 into y.