Try It! In the InputSnippet file, add code to prompt the user for two more values, read those values into variables, and write a message using each value in a sentence. Create comments 4 and 5 to describe what you are doing. Identify and choose the correct data types to use. Compile and run the program to check your work. input the sales tax rate for the user’s state input the number of courses the user is taking SECTION REVIEW 4.2 Check Your Understanding 1. Which symbol is used as the assignment operator in Java? 2. A String literal is surrounded by _____. 3. Describe the function of the concatenation operator. 4. How is a variable in Java set to be a constant? 5. What does this statement do, and when would it be used? Scanner input = new Scanner( System.in ) Build Your Vocabulary As you progress through this course, develop a personal computer science glossary. This will help you build your vocabulary and prepare you for a career. Write a definition for each of the following terms and add it to your computer science glossary. call concatenation operator constant exception hard-coding literal value prompt String literal Copyright Goodheart-Willcox Co., Inc. Chapter 4 Variables 93
Previous Page Next Page