OCA Quiz 1a

Section 17 quiz questions
  • public class one { //line 1
      private static int _123; //line 2
      public static String $Dollar; //line 3
      static double 10.00; //line 4

      public static void main(String[] Goto) { //line 5
        System.out.println(_123 * 10.00 + " $Dollar"); //line 6
       }}
  • public class Three {
      //line 2
      public void study(boolean time) {
        //line 3
        while(time) {
         //line 4
    }
         System.out.println(result);
         //line 5
    }
         //line 6
    }
  • package oca.review;
    Question{}

    package oca;
    class Quiz {}

    package exam;
    //INSERT IMPORTS HERE
    class Review {
      public void practice(Quiz quiz){}
    }
  • package com.franchise;
    public class Menu {
       private int entreeNum;
       protected double price;
       public boolean happyHour;
       static double couponCode = 0.15;
       public Menu(int choice, double price) {
         entreeNum = choice;
         this.price = price; } }

    package my.restaurant; //line 1
    import com.franchise.*; //line 2
    public class DailySpecial { //line 3
       public static void main(String[] args) { // line 4
         Menu menu1 = new Menu(1, 5.99); //line 5
         System.out.println(menu1.entreeNum); //line 6
         System.out.println(menu1.price); //line 7
         System.out.println(menu1.happyHour); // line 8
         System.out.println(Menu.couponCode); //line 9
    }}
  • 1: public class Sizes {
    2: public void size(byte x) {
    3: System.out.print(" Dozen");
    4: }
    5: public void size(int x) {
    6: System.out.print(" Gross");
    7: }
    8: public void size(float x) {
    9: System.out.print(" Pi");
    10: }
    11: public void size(char x) {
    12: System.out.print(" Roman numeral for 100");
    13: }
    14: public static void main(String[] args) {
    15: Sizes s = new Sizes();
    16: short sh = 144;
    17: s.size(sh);
    18: s.size(‘C’);
    19: s.size(3.14);
    20: }
    21: }
  • 1: public class Squares {
    2: public static long square(int x) {
    3: long y = x * (long) x;
    4: x = -1;
    5: return y;
    6: }
    7: public static void main(String[] args) {
    8: int value = 9;
    9: long result = square(value);
    10: System.out.println(value);
    11: } }