Object Oriented Programming with Java
ToledoSlackGitHub Org 1GitHub Org 2
Primary version
Primary version
  • About this Course
  • Introduction to Computer Programming
    • Introduction to Computer Programming
    • Challenges
    • Multiple Choice
  • Basic Building Blocks
    • Basic Building Blocks
    • Challenges
    • Multiple Choice
  • Starting in Java
    • Starting in Java
    • Challenges
    • Multiple Choice
  • Storing and Processing Data
    • Storing and Processing Data
    • Challenges
    • Multiple Choice
  • Making Decisions
    • Making Decisions
    • Challenges
    • Test Yourself
    • Multiple Choice
  • Loop Constructs
    • Loop Constructs
    • Challenges
    • Multiple Choice
  • Strings
    • Strings
    • Challenges
    • Multiple Choice
  • Arrays
    • Arrays
    • Challenges
    • Multiple Choice
  • Object Oriented Thinking
    • Object Oriented Thinking
  • All About Objects
    • All About Objects
    • Multiple Choice
  • Defining Classes
    • Defining Classes
    • Challenges
    • Multiple Choice
  • Methods
    • Methods
    • Challenges
    • Multiple Choice
  • Constructors
    • Constructors
    • Multiple Choice
  • Inheritance
    • Inheritance
  • Starting with JavaFX
    • Starting with JavaFX
  • Hands On
    • Hands on MQTT
    • Hands on GSON
  • Hack @ IT
    • Hack @ IT
    • Caesar Encryption
      • Solution
    • Complex Numbers
  • Assignments
    • Number Characteristics
    • Linear Equation
    • LineSegment
  • Videos
    • Videos
  • Sources
    • Sources
Powered by GitBook
On this page
  1. Storing and Processing Data

Multiple Choice

  1. What has the same result as counter++?

  2. What is the result of 89 % 4?

  3. What is the result of number after int number = 7.0 / 2.0;?

  4. What is a valid value for a boolean?

  5. Suppose you want to store the age of your dog in a variable (the years). What would be the most obvious datatype for this?

  6. What is the result of 11 / 5?

  7. What is the correct definition of a primitive datatype?

  8. Which of the data types below is not a primitive datatype?

  9. What is the result of 83 % 4?

  10. What is the resulting value in q?

    int x = 5;
    int y = 2;
    double q = (double) x / y;
  11. What is the most correct and complete definition of a variable?

  12. Why are the operators +, -, *, /, ... called binary operators?

  13. Which of the following code blocks makes use of compound operators?

    // Code block A
    int x = ( 25 / 3 ) * (15 % 4);
    // Code block B
    int z = 0;
    for (int i = 0; i < 5; i++) {
      int y = i + 5;
      z++;
    }
    // Code block C
    double vatPercent = 21;
    double priceTag = 55;
    double vat = priceTag * vatPercent / 100;
    // Code block D
    int x = 32;
    int y = 88;
    
    while (x <= 1000) {
      x += 5;
    }
  14. Which of the following code snippets will not result in the value of b incrementing with 1?

    int x = 15;
    int b = 3;
    x = b++;
    int x = 15;
    int b = 3;
    x += (++b);
    int x = 15;
    int b = 3;
    x = (b + 1);
    int x = 15;
    int b = 3;
    b += 1;
PreviousChallengesNextMaking Decisions

Last updated 6 years ago