Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 1.76 KB

quiz.md

File metadata and controls

51 lines (38 loc) · 1.76 KB

CSE 142

Quiz

Week 1

  1. Below is a program, but it is not executable. Explain what executable means, why the program below is not executable, and what you need to add to make it executable?

        public class Hello {
    
        }
  2. Write an executable program that prints "Hello World!"

  3. Describe the errors in the program below.

    public MyProgram {
       public static void main(String[] args) {
           System.out.println("This is a test of the")
           System.out.Println("emergency broadcast system.");
       }
    }
  4. What is the name of the character shown: \

  5. What is the name of the character shown: /

  6. Fill in the escape sequence that matches each character described in the table below.

    Escape sequence Description
    Newline
    Tab
    Double quote
    Backslash
  7. What will be printed to the console when the program below is run?

    System.out.println("\"Quotes\"");

  8. What will be printed to the console when the program below is run?

    System.out.println("Slashes \\//");

  9. Fill in the table below, evaluating the expressions

    Expression What does it evaluate to
    3 + 4 + " 2 + 2"
    4.0 / 2 * 9 / 2
    8 / 5 + 13 / 2 / 3.0
    "hello 34 " + 2 * 4