Explain why each of the following names does or does not...

This preview shows page 1 - 3 out of 16 pages.

Programming Logic and Design, 6e Solutions 2-1 Programming Logic and Design, 6th Edition Chapter 2 Exercises 1. Explain why each of the following names does or does not seem like a good variable name to you. 17
2. If myAge and yourRate are numeric variables, and departmentName is a string variable, which of the following statements are valid assignments? If a statement is not valid, explain why not. Answer :
Programming Logic and Design, 6e Solutions 2-2 n. departmentName = myAge Invalid, cannot assign numeric to string o. departmentName = yourRate Invalid, cannot assign numeric to string p. 413 = departmentName Invalid, cannot assign a value to a literal constant q. “413” = departmentName Invalid, cannot assign a value to a literal constant 3. Assume that cost = 10 and price = 12 . What is the value of each of the following expressions? Answer :
4. Draw a typical hierarchy chart for a paycheck-producing program. Try to think of at least 10 separate modules that might be included. For example, one module might calculate an employee’s dental insurance premium.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture