Skip to main content

Midtem Exam Oracle Java Fundamental

Java Fundamental Midterm Exam
Section 2
                (Answer all questions in this section)

1.            Which of the following is not a type of event listener in Alice?    Mark for Review
(1) Points
                Keyboard
                Scene Activation/Time
                Mouse
                Position/Orientation
                Cursor (*)

2.            In Alice, what tab would you choose to start a new animation with a pre-populated world?          Mark for Review
(1) Points
                Blank Slate
                Starters (*)
                Recent
                My Projects

3.            In Alice, you can access the Java on the side option through which menu option?              Mark for Review
(1) Points
                Window (*)
                Project
                Run
                Edit

4.            From your Alice lessons, variables are fixed and cannot be changed. True or false?           Mark for Review
(1) Points
                True
                False (*)

5.            You have a Class representing Cat. A cat can meow, purr, catch mice, and so on. When you create a new cat, what is it called?               Mark for Review
(1) Points
                A subprogram
                A submethod
                A subclass
                A variable class
                An instance (*)

Section 2
                (Answer all questions in this section)

6.            Which of the following statements about methods is false?         Mark for Review
(1) Points
                Classes must be defined directly within a method definition. (*)
                Methods whose return type is not void are required to include a return statement specifying what to return.
                The order in which methods are listed within the class is not important.
                Java does not permit nesting one method definition within another method's definition.

7.            In Alice, the use of conditional control structures allows what two types of loops?            Mark for Review
(1) Points
                                                (Choose all correct answers)      
                conditional (*)
                together
                infinite
                switch

8.            From your Alice lessons, where on an object do an object's axes intersect?         Mark for Review
(1) Points
                At the object's head
                At the object's bottom
                At the object's chest
                At the object's center point (*)

9.            Which of the following are examples of elements you would test in your Alice animation?            Mark for Review
(1) Points
                                                (Choose all correct answers)      
                Math expressions calculate as expected. (*)
                All of the procedures display in alphabetical order in the Procedures tab.
                Event listeners trigger the correct responses. (*)
                Objects move with smooth timing. (*)

10.          What type of Alice listener object is required to target a mouse-click on any object in the scene, allowing the user to drag that object around the scene when the animation is running?           Mark for Review
(1) Points
                addMouseListener procedure
                addListener procedure
                addDefaultManipulation procedure
                addDefaultModelManipulation procedure (*)

Section 2
                (Answer all questions in this section)

11.          In Alice, which of the following arguments could be replaced with a random number?    Mark for Review
(1) Points
                                                (Choose all correct answers)      
                Direction
                Duration (*)
                Distance (*)
                Object name
                Procedure name

12.          Alice uses built-in math operators. They are:       Mark for Review
(1) Points
                Add
                Subtract
                Multiply
                Divide
                All of the above (*)

13.          In Alice, which of the following programming statements moves the butterfly forward, double the distance to the tree?        Mark for Review
(1) Points
                this.Butterfly move backward {this.Butterfly getDistanceTo this.Tree * 2}
                this.Butterfly move forward {this.Butterfly getDistanceTo this.Tree / 2}
                this.Butterfly move forward {this.Butterfly getDistanceTo this.Tree * 2} (*)
                this.Butterfly move backward {this.Butterfly getDistanceTo this.Tree / 2}

14.          In Alice, which function is used to move an object directly to the center point of another object?              Mark for Review
(1) Points
                getDuration
                getDistance (*)
                getDepth
                getObject

15.          When you disable a programming instruction, it is still executed when you run the Alice animation. True or false?    Mark for Review
(1) Points
                True
                False (*)

Section 2
                (Answer all questions in this section)

16.          In Alice, Do In Order and Do Together:   Mark for Review
(1) Points
                Are move statements
                Are control statements (*)
                Are complex statements
                None of the above

17.          In Alice, the procedures' arguments allow the programmer to adjust the object, motion, distance amount, and time duration. True or false?              Mark for Review
(1) Points
                True (*)
                False

18.          In Alice, a walking motion for a bipedal object can be achieved without the Do Together control statement. True or false?    Mark for Review
(1) Points
                True
                False (*)

19.          In Alice, what are the forms of a scenario?           Mark for Review
(1) Points
                                                (Choose all correct answers)      
                A task to perform. (*)
                A person to help.
                A problem to solve. (*)
                A section of code to write.
                A system to start.

20.          In Alice, when a new procedure is declared, all subclasses of the superclass will inherit the procedure. True or false?               Mark for Review
(1) Points
                True (*)
                False

Section 2
                (Answer all questions in this section)

21.          Procedural abstraction may need to be implemented if an object in Alice needs to perform an action, but there isn't an inherited procedure that accomplishes that action. True or false? Mark for Review
(1) Points
                True (*)
                False

22.          The list below describes variables. All are correct except which one?       Mark for Review
(1) Points
                Has a type associated with it.
                Has a unique name.
                A place in memory where data of a specific type can be stored for later retrieval and use.
                Arranged in rows and columns. (*)

23.          The list below displays valid primitive types in Java, except which one?  Mark for Review
(1) Points
                String (*)
                int
                double
                long
                boolean

24.          Alice 3 will periodically remind you to save your project. True or false?   Mark for Review
(1) Points
                True
                False (*)

Section 3
                (Answer all questions in this section)
25.          In Greenfoot, which of the following methods return the world that the instance lives in?            Mark for Review
(1) Points
                World getWorld() (*)
                World getClass()
                getXY()
                getRotation()

Section 3
                (Answer all questions in this section)

26.          From your Greenfoot lessons, in an if-statement, the programming statements written in curly brackets are executed simultaneously. True or false?               Mark for Review
(1) Points
                True
                False (*)

27.          In Greenfoot you can only access the methods of the current class?        Mark for Review
(1) Points
                True
                False (*)

28.          In the Greenfoot IDE, what does the AND operator (&&) do?     Mark for Review
(1) Points
                Compares two boolean values, and returns a boolean value which is true if and only if one of its operands are true.
                Compares two boolean values, and returns a boolean value which is true if and only if both of its operands are true. (*)
                Compares two boolean values and returns a boolean value which is true if either one of the operands is true.
                Compares two boolean variables or expressions and returns a result that is true if either of its operands are true.

29.          In Greenfoot, which of the following statements could prevent an infinite loop from occurring?                Mark for Review
(1) Points
                I = 100 + i
                i = i + 1 (*)
                i = i
                i=1

30.          In Greenfoot, a local variable is declared at the beginning of a class. True or false?            Mark for Review
(1) Points
                True
                False (*)

Section 3
                (Answer all questions in this section)

31.          In Greenfoot, what types of values cannot be stored in a local variable?                Mark for Review
(1) Points
                Method (*)
                Integers
                Objects
                Class name
                World name

32.          Which of the following type of audience should you ask to play your Greenfoot game during the testing phase? Mark for Review
(1) Points
                Testing
                Programmer
                Target (*)
                Primary

33.          In object oriented programming, programmers analyze a problem and create objects to solve the problem. True or false?    Mark for Review
(1) Points
                True (*)
                False

34.          Which one of the following can be used to detect when 2 actors collide?               Mark for Review
(1) Points
                isCollision()
                hasCollided()
                isContact()
                isTouching() (*)

35.          In Greenfoot, a way to have all subclasses of a superclass inherit a method is by adding the method to the superclass. True or false?             Mark for Review
(1) Points
                True (*)
                False

Section 3
                (Answer all questions in this section)

36.          What type of parameter does the Greenfoot playSound method expect?            Mark for Review
(1) Points
                name of a keyboard key (as String)
                name of a sound file (as String) (*)
                name of the class (as String)
                name of an integer (as int)

37.          Greenfoot has tools to record sound. True or false?        Mark for Review
(1) Points
                True (*)
                False

38.          Which of the following answers have the correct syntax for declaring a class variable in Greenfoot?         Mark for Review
(1) Points
                                                (Choose all correct answers)      
                public variable-name variable type;
                public variable-type variable-name; (*)
                private variable-name, variable-type;
                private variable-type variable-name; (*)

39.          In Greenfoot, which method is used to add a new instance to a scenario when the world is initialized?   Mark for Review
(1) Points
                addObject (*)
                addClass
                addWorld
                addInstance

40.          Constructors are called automatically when a new intance of a class is created? True or false?     Mark for Review
(1) Points
                True (*)
                False

41.          In Greenfoot, the instance has a source code editor. True or false?          Mark for Review
(1) Points
                True
                False (*)

42.          In Greenfoot, the move method expects what type of information in its parameters?    Mark for Review
(1) Points
                Integer of steps to move forward (*)
                Degrees to turn
                String statement
                True or false response

43.          Using the Greenfoot IDE, only five instances can be added to a scenario. True or false?  Mark for Review
(1) Points
                True
                False (*)

44.          In Greenfoot, the body of the method is located in between which of the following characters?               Mark for Review
(1) Points
                Curly brackets { } (*)
                Square brackets [ ]
                Asterisks **
                Parnetheses ( )

45.          In Greenfoot, a subclass is a specialization of a superclass. True or false?               Mark for Review
(1) Points
                True (*)
                False

Section 3
                (Answer all questions in this section)

46.          In Greenfoot, the Run button repeatedly executes all of the programming statements in the class's act method in sequential order until the pause button is clicked. True or false?         Mark for Review
(1) Points
                True (*)
                False

47.          From your Greenfoot lessons, what can methods belong to?      Mark for Review
(1) Points
                                                (Choose all correct answers)      
                Galleries
                Classes (*)
                Scenarios
                Objects (*)
                All of the above

48.          In Greenfoot, the origin of the world coordinate system (0,0) starts in the center of the world. True or false?                Mark for Review
(1) Points
                True
                False (*)

49.          The first step to executing an if-else statement is to:____________.     Mark for Review
(1) Points
                Execute the else statement
                Evaluate the class
                Execute the if statement
                Evaluate the condition (*)

50.          An if-else statement executes its first code block if a condition is true, and its second code block if a condition is false, but not both. True or false?    Mark for Review
(1) Points
                True (*)

                False

Comments

Post a Comment

Popular posts from this blog

Section 6 Quiz Oracle Database Programming with SQL

Section 6 Quiz             (Answer all questions in this section)                                                             1.         Given the following descriptions of the employees and jobs tables, which of the following scripts will display each employee ï¾’ s possible minimum and maximum salaries based on their job title? EMPLOYEES Table: Name   Null?    Type EMPLOYEE_ID          NOT NULL     NUMBER (6) FIRST_NAME             VARCHAR2 (20) LAST_NAME  NOT NULL     VARCHAR2 (25) EMAIL NOT NULL     VARCHAR2 (25) PHONE_NUMBER                  VARCHAR2 (20) HIRE_DATE   NOT NULL     DATE JOB_ID           NOT NULL     VARCHAR2 (10) SALARY                     NUMBER (8,2) COMMISSION_PCT                NUMBER (2,2) MANAGER_ID                       NUMBER (6) DEPARTMENT_ID                 NUMBER (4) JOBS Table: Name   Null?    Type JOB_ID           NOT NULL     VARCHAR2 (10) JOB_TITLE     NOT NULL     VARCHAR2 (35) MIN_SALARY                      

Section 10 Quiz Database Programming With SQL

Section 10 Quiz             (Answer all questions in this section) 1.         A multiple-row operator expects how many values?   Mark for Review (1) Points             One or more (*)             Only one             Two or more             None 2.         The salary column of the f_staffs table contains the following values: 4000 5050 6000 11000 23000 Which of the following statements will return the last_name and first_name of those employees who earn more than 5000?  Mark for Review (1) Points             SELECT last_name, first_name FROM f_staffs WHERE salary IN (SELECT last_name, first_name FROM f_staffs WHERE salary <5000 o:p="">             SELECT last_name, first_name FROM f_staffs WHERE salary = (SELECT salary FROM f_staffs WHERE salary < 5000);             SELECT last_name, first_name FROM f_staffs WHERE salary IN (SELECT salary FROM f_staffs WHERE salary > 5000); (*)             SELEC

Section 2 Quiz Database Design Oracle

Section 2 Quiz             (Answer all questions in this section) 1.         An Entity Relationship model is independent of the hardware or software used for implementation. True or False?  Mark for Review (1) Points             True (*)             False 2.         A well structured ERD will show only some parts of the finished data model. You should never try to model the entire system in one diagram, no matter how small the diagram might be. True or False?           Mark for Review (1) Points             True             False (*) 3.         The purpose of an ERD is to document the proposed system and facilitate discussion and understanding of the requirements captured by the developer. True or False?          Mark for Review (1) Points             True (*)             False 4. Documenting Business Requirements helps developers control the scope of the system and prevents users from claiming that the new system does not meet their business req