All posts by Verified


1. When debugging a class, you can step through the code to follow the flow of the program. There are four ways you can step through the code. Explain each option for stepping through the code of a class.

2. You have in your program an ArrayList that contains employee names (strings) in arbitrary order. You need to display the employees ordered alphabetically by name. Provide detailed steps of how you plan to accomplish this task. You do not need to give correct Java code (a detailed pseudocode is sufficient) but indicate which method(s) and which Java class(es) you would use.

3. Do we need to format our program output? Does formatting only apply to numeric values? What about percent values and currencies? Give an example that uses the NumberFormat class in the java.text package that formats numbers.

Expert Answers

1. A popular late-night talk show host discusses the health benefits of not smoking and has several celebrity guests promote this idea with entertaining anti-smoking skits. This has convinced a significant number of people to quit smoking. How will this affect the market for cigarettes?
2. The price of computer chips decreases significantly, enabling manufacturers of hard drives to produce more hard drives. How will this affect the market for hard drives?
3. A national prescription lens association engages in a major ad campaign to convince people that glasses that automatically darken with exposure to sunlight are much healthier for your eyes than glasses that do not. The campaign has been very effective. How will this affect the market for prescription lens that automatically darken?
4. The price of fertilizer has increased. How will this affect soybean production?
5. Swimming pool service providers can service more pools this year than last year due to an advanced sweeper that automatically adjusts chemicals in the water while sweeping the pool. How will this affect the market for pool-cleaning services?
6. A news report recently announced that baby boomers planned to sell their homes in the suburbs and buy condos in the city sometime in the next three years. How will this affect the demand for condos in the city?
7. To encourage energy conservation, the government will give companies a $10 credit on each residential solar panel that they produce. Companies can deduct the credit from their taxes. How will this affect the market for solar panels?
8. Consumers learn that tap water is healthier than bottled water. How will this affect the bottled-water market?
9. The price of movie tickets has increased significantly. How will this affect the market for DVD rentals?
10. Laptop computer sales have doubled over the past ten months. How will this affect the market for wireless Internet service?