Skip to main content

Programming Fundamentals assessment

Test what you learned across the Programming Fundamentals path. Every answer comes with an explanation, and you can retry as often as you like.

This assessment covers

  • Explain how source code becomes a running program on the Java Virtual Machine
  • Store and change data with variables, primitive types and operators
  • Make decisions in code with if, else if, else and switch
  • Repeat work with for, while and do-while loops
  • Break a problem into small methods and solve a beginner coding exercise

Programming Fundamentals assessment

8 questions • 70% to pass • Practice only, no certificate

  1. 1.What does the Java compiler (javac) produce from a .java source file?
  2. 2.Which type should you use to store the value true or false?
  3. 3.What is printed?
    CODE
    int a = 7;
    int b = 2;
    System.out.println(a / b);
  4. 4.What is the value of 17 % 5?
  5. 5.Which condition is true only when age is between 18 and 60, inclusive?
  6. 6.How many times does this loop print "Hi"?
    CODE
    for (int i = 0; i < 4; i++) {
        System.out.println("Hi");
    }
  7. 7.Which loop always runs its body at least once?
  8. 8.What does the keyword void mean in a method declaration?
0 of 8 answered