You can customize the handout master so that it coordinates visually with the presentation slides and reinforces your message.
Answer the following statement true (T) or false (F)
True
You might also like to view...
Some people want to eliminate sexism in all forms of communication. You’ve been asked to create a program that can process a paragraph of text and replace gender-spe- cific words with gender-neutral ones. Assuming that you’ve been given a list of gender-specific words and their gender-neutral replacements (e.g., replace “wife” with “spouse,” “man” with “per- son,” “daughter” with “child” and so on), explain the procedure you’d use to read through a para- graph of text and manually perform these replacements. How might your procedure generate a strange term like “woperchild?” In Chapter 4, you’ll learn that a more formal term for “procedure” is “algorithm,” and that an algorithm specifies the steps to be performed and the order in which to perform them.
What will be an ideal response?
Write an application that calculates the cost of all the supplies added to the user’s shopping list (Fig. 23.17). The application should contain two JLists. The first JList contains all the supplies offered and their respective prices. Users should be able to select the desired supplies from the first JList and add them to the second JList. The user may select an item in the first JList multiple times. Provide a Calcu- late JButton that displays the total price for the user’s shopping list (the contents of the second JList).
a) Copying the template to your working directory. Copy the C:Examples Tutorial23ExercisesSupplyCalculator directory to your C:SimplyJava directory.
b) Opening the template file. Open the SupplyCalculator.java file in your text edi- tor.
c) Adding code to the calculcateJButtonActionPerformed method. In the calcu- lateJButtonActionPerformed method (lines 242–245), declare two variables—the first should be a double (called total), which will keep track of the total price. The second will be a String (called price) used as a temporary variable for the price. Then, add a for statement to loop through all the items in the ArrayList userAr-
rayList. You will use this for statement to iterate through each item in the Items in Your List: JList. These items have already been added to the userArrayList for you.
d) Extracting the prices and calculating the total. Inside the for statement you added in Step c, convert the current item from the userArrayList into a String. Store t