Mld1 Mid-term Exam Part1

10 Questions | Total Attempts: 66

SettingsSettingsSettings
Please wait...
Mld1 Mid-term Exam Part1

MLD1 Mid-Term Exam Part1


Questions and Answers
  • 1. 
    To make variable "dat" equal to 5 which of the following lines of Java code should be used:
    • A. 

      Int dat = 5;

    • B. 

      String dat = 5;

    • C. 

      System.print.out(dat);

    • D. 

      Dat = dat + 5;

  • 2. 
    To make a Java program print "Java", which of the following lines of Java code should be used:
    • A. 

      Print(Java);

    • B. 

      Print"Java";

    • C. 

      System.out.print "Java";

    • D. 

      System.out.print("Java");

  • 3. 
    A program "class SavProg2" should be saved as:
    • A. 

      SavProg2

    • B. 

      SavProg2.txt

    • C. 

      SavProg2.java

    • D. 

      Class SavProg2.java

  • 4. 
    Which character usually ends up a Java program code?
    • A. 

      @

    • B. 

      }

    • C. 

      &

    • D. 

      #

  • 5. 
    You cannot compile your Java program until you
    • A. 

      Erase it

    • B. 

      Run it

    • C. 

      Save it

    • D. 

      Memorize it

  • 6. 
    A Java class code contains the following line:public class Diamondwhat is the actual name of the program (class)?
    • A. 

      Public static void class Diamond

    • B. 

      Class Diamond

    • C. 

      Diamond

    • D. 

      Diamond

  • 7. 
    A computer keyboard is a:
    • A. 

      The main part of a computer

    • B. 

      Output device

    • C. 

      Input device

    • D. 

      Storage device

  • 8. 
    The line of Java code below has the last character missed.answer = number1 + 3The missed character is:
    • A. 

      @

    • B. 

      /

    • C. 

      &

    • D. 

      ;

  • 9. 
    The text below is a fragment of a Java code. public class CalcNum {public static void main(String[] args) {double circ = 0This code should be saved as:
    • A. 

      Public class CalcNum

    • B. 

      CalcNum.java

    • C. 

      Class CalcNum

    • D. 

      Class CalcNum.java

  • 10. 
    An integer is:
    • A. 

      Any whole number (includes positive, negative, and zero)

    • B. 

      A whole number or a decimal

    • C. 

      A negative whole number

    • D. 

      A fraction

Back to Top Back to top