Application and Extension of Knowledge 1. Write a program to ask the user how many hours were worked in the month and how much he or she is paid per hour. Output both values in a sentence. 2. Astronomical distances are measured in light years. A light year is the distance light travels in one year. It is not a measure of time. One light year is about six trillion miles. Define and assign a value to a variable to express the distances in miles. 3. Write a program that prompts the user to enter if this year is a leap year. The user should enter true or false. Hint: use the Scanner class nextBoolean method to input a boolean value. 4. Punctuation is important in most programming languages. Exact placement of semicolons, parentheses, and braces is essential. Write a short paragraph that describes the errors you have made so far and what you are going to look for if your program does not compile. 5. Refer to Figure 4-4. Compare the maximum values that can be stored based on the integer data types. For example, using two bytes instead of one byte increases the maximum value from 127 to 32,767. Two bytes provide a capacity of 32,767, which is 258 times that provided by one byte (32,767 ÷ 127 = 258). Make this comparison for each of the integer data types. Provide an explanation of why there is such a big jump in capacity. Distant Distant Object Object Description Description Light Years Light Years Away Away Miles Miles Away Away Proxima Centauri Nearest Star 4.22 Sirius Brightest star in the sky 8.6 A0620-00 Nearest known black hole 3,000 Online Activities Complete the following activities, which will help you learn, practice, and expand your knowledge and skills. Vocabulary. Practice vocabulary for this chapter using the e-flash cards, matching activity, and vocabulary game until you are able to recognize their meanings. Communication Skills Reading. Print awareness is the understanding that printed text is organized in a methodical way. For example, texts written in English contain individ- ual letters that make up words, which are separated by spaces. Words are read from left to right and top to bottom. Print awareness helps readers understand text can be separated by images, pages, or other divi- sions. These breaks may or may not indicate a break in thought. Review the pages of this chapter. How does your understanding of print awareness help you read and understand the text? Writing. Rhetoric is the study of writing or speak- ing as a way of communicating information or per- suading someone. When you persuade, you convince a person to take a proposed course of action. There will be many instances in which you will be required to write paragraphs to persuade a reader. Write a script you could use as the basis for a conversation with a classmate about whether a clean learning environment is important. Use your best persuasive techniques to argue for or against the value of a clean school. Use solid reasoning that will influence your classmate’s understanding of the topic. Speaking. What role do you think ethics and in- tegrity have in decision-making? Think of a time when your ideals and principles helped you make a deci- sion involving ethics. Do you think you made the cor- rect decision? What was the impact of your decision? Deliver an informal speech to your class to narrate the situation that led to the decision. Describe your thoughts and opinions. Explain how ethics and integ- rity influenced your decision. Copyright Goodheart-Willcox Co., Inc. 96 Introduction to Computer Science: Java Programming