Homework: Java Overview, Input, Output, Strings


All homework assignments will be done this way: After reading the required materials, answer the homework questions and turn them in at the beginning of class. Please note the policies on homework grading (part of the first reading assignment).

  1. (Nothing to turn in for this question) Add a recent, clear photo of yourself to both your Zoom profile and to your Carmen profile.
  2. In CSE 2221, what constitutes "going over the line" with regard to acceptable collaboration vs. academic misconduct?
  3. Will your homework grade be better if you look up and copy the answers rather than thinking about the questions and providing your own answers?
  4. What are the two most important benefits of the Java language?
  5. What's an algorithm?
  6. What two main categories of errors can you expect to encounter when programming?
  7. (These are from Self Check questions 15-19 in Section 1.6 of Java for Everyone.)
    1. Suppose you omit the "" characters around Hello, World! from the HelloPrinter.java program. Is this a compile-time error or a run-time error?
    2. Suppose you change println to printline in the HelloPrinter.java program. Is this a compile-time error or a run-time error?
    3. Suppose you change main to hello in the HelloPrinter.java program. Is this a compile-time error or a run-time error?
    4. When you used your computer, you may have experienced a program that "crashed" (quit spontaneously) or "hung" (failed to respond to your input). Is that behavior a compile-time error or a run-time error?
    5. Why can’t you test a program for run-time errors when it has compile-time errors?
  8. Show what this program prints. Be exact and complete. Can you explain the behavior of each print statement?
    public class Test {
        public static void main(String[] args) {
            System.out.println("39 + 3");
            System.out.println(39 + 3);
            System.out.println("39" + 3);
        }
    }
    

Additional Questions

Some homework assignments will have "additional questions". These questions are not required as part of your homework submission. However, you will benefit from thinking about them and you may turn them in for feedback. They may be related to non-required readings.

  1. Acronym Attack! Software Engineers love to use TLAs (three letter acronyms) to compress complex ideas into small efficient packets. If you want to keep up, you need to learn the code. For each of the following, expand the acronym and give a brief definition.
    1. API
    2. CPU
    3. IBM
    4. IDE
    5. JDK
    6. JVM
    7. GUI
    8. LAN
    9. MAC (the acronym, often followed by "address"; not a Macintosh)
    10. RSS
    11. UUT
    12. XML