Kamis, 30 November 2017

Java fundamental midterm

Section 2

1. In Alice, objects inherit the characteristics of their:
Class (*)

2. A textual storyboard helps the reader understand the actions that will take place during the animation. True or false?
True (*)

3. In Alice, if a procedure is declared for a clownFish class, which classes can use the procedure?
ClownFish class (*)

4. Alice uses built-in math operators. They are:
All of the above (*)

5. In Alice, which of the following programming statements moves the alien backward the distance to the asteroid, minus 2 meters?
this.Alien move backward {this.Alien getDistanceTo this.Asteroid -2} (*)

6. You have a Class representing Cat. Each Cat can meow, purr, catch mice, and so on. When you create a new cat, what is it called?
An instance (*)

7. Which of the following statements about methods is false?
Classes must be defined directly within a method definition. (*)

8. From your Alice lessons, built-in functions provide precise property details for the following areas:
Proximity, size, spatial relation, and point of view. (*)

9. From your Alice lessons, what is the purpose of nesting?
To add visual structure to your program. (*)

10. Debugging is the process of finding bugs in a software program. True or false?
True (*)

11. A loop can be infinite (continue forever) or conditional (stops upon a condition). True or false?
True (*)

12. When you import a class from another file you have to import the entire class. True or false?
False (*)

13. To save a class to the myClasses directory you do so at the ________ level.
Class (*)

14. Which handle style would be used to rotate an object's sub-part about the x, y, and z axes?
Rotation (*)

15. Which is an example of the Boolean variable type?
True or False (*)

16. In Java code the { } brackets are used to represent what statements?
(Choose all correct answers)
Begin(*)
End(*)

17. In Alice, which of the following is not a control statement?
Move (*)

18. In Alice, a computer program requires functions to tell it how to perform the procedure. True or false?
False (*)

19. In Alice, the setVehicle procedure will associate one object to another. True or false?
True (*)

20. In Alice, where are arithmetic operators available?
(Choose all correct answers)
Amount argument (*)
Duration argument (*)
Get Distance functions (*)



22. What is the purpose of a function in Alice?

To compute and answer a question about an object. (*)

23. Which of the following elements of the Alice animation should be tested before the animation is considered complete?
All of the above. (*)

24. The Alice animation should be tested throughout development, not just at the end of the animation's development. True or false?
True (*)

Section 3

25. To execute a method in your Greenfoot game, where is it called from?
The act method (*)

26. Which one of the following can be used to detect when 2 actors collide?
isTouching() (*)

27. The list below displays components of the Greenfoot source code editor except one. Which one
should be removed?
Instance creator (*)

28. From your Greenfoot lessons, where do you review a class's inherited methods?
Documentation (*)

29. In Greenfoot, you must first create an instance before you create a class. True or false?
False (*)

30. Which of the following are examples of default superclasses that are present in a new Greenfoot scenario?
(Choose all correct answers)
World (*)
Actor (*)

31. Using the Greenfoot IDE, when is a constructor automatically executed?
When a new instance of the class is created. (*)

32. In Greenfoot, actor constructors can be used to create images or values and assign them to the variables. True or false?
True (*)

33. In Greenfoot, which method is used to add a new instance to a scenario when the world is initialized?
addObject (*)

34. When a Greenfoot code segment is executed in an if-statement, each line of code is executed in sequential order. True or false?
True (*)

35. From your Greenfoot lessons, which of the following comparison operators represents "greater than"?
>(*)

36. From your Greenfoot lessons, which axes define an object's position in a world?
(Choose all correct answers)
Y(*)
X(*)

37. Which of the following comparison operators represents "greater than or equal"?
>= (*)

38. Which of the following features of Greenfoot will locate syntax errors in your program?
Compilation (*)

39. When designing a game in Greenfoot, it helps to define the actions that will take place in a textual storyboard. True or false?
True (*)

40. In Greenfoot, a local variable is declared at the beginning of a class. True or false?
False (*)

41. Which of the following is an example of string concatenation?
Instead of entering ".png" after each image file name, add + ".png" after the imageName value in the programming statement. (*)

42. In Greenfoot, when is a local variable most often used?
Within loop constructs (*)

43. An array is an object that holds multiple methods. True or false?
False (*)

44. In Greenfoot, you can only interact with the scenario using a keyboard.
False (*)

45. Greenfoot has tools to record sound. True or false?
True (*)

46. In Java what is casting?
When you take an Object of one particular type and turn it into another Object type. (*)

47. Using the Greenfoot IDE, only five instances can be added to a scenario. True or false?
False (*)

48. In Greenfoot, which of the following options are not possible when associating an image file with an instance?
Add a video (*)

49. In Greenfoot, methods can be called in the act method. When the Act button is clicked in the environment, the methods in the method body of the act method are executed. True or false?
True (*)

50. In the Greenfoot IDE, an instance's position is on the x and y coordinates. True or false?
True (*)

Section 2

1. In Alice, when using the getDistanceTo function what menu option would you use to subtract a set value from the distance?
Math (*)

2. From your Alice lessons, if you examined a science process that had many steps, which of the following is a way that you could apply functional decomposition to this process?

1. Identify the high level steps for the science concept.
2. Further refine and define the tasks needed for each high level step.
3. Present the problem as an animation. (*)

3. When presenting your Alice animation, it is not important to give the audience a reason to listen to the presentation. True or false?
False (*)

4. Identify an example of an Alice expression.
12 + 15 = 27 (*)

5. Alice uses built-in math operators; they are:
All of the above (*)

6. From your Alice lessons, what does the Count control statement do?
Executes statements a specific number of times. (*)

7. Which of the following is not a relational operator?
//(*)

8. In Java, which symbol is used to assign one value to another?
==(*)

9. When you import a class from another file you have to import the entire class. True or false?
False(*)

10. An event is any action initiated by the user that is designed to influence the programメs execution during play.
True(*)

11. What do lines 9 and 11 do in the following code
Accept user input and store them in the variables num1 and num2. (*)

12. Main is an example of what in the following code?

public static void main (String[] args) {
System.out.println{"Hello World!");
}
A method (*)

13. A flowchart is a useful way to illustrate how your Alice animation's characters will look. True or false?
False (*)

14. From your Alice lessons, a flowchart could be created in a software program, or documented in a journal. True or false?
True(*)

15. From your Alice lessons, what does inheritance mean?
Each subclass inherits the methods and properties of its superclass. (*)

16. What do moving objects provide to your scene?
The action (*)

17. A conditional loop is a loop that will continue forever. True or false?
False (*)

18. Which of the following actions would require a control statement to control animation timing?
(Choose all correct answers)
A bird flying. (*)
A fish swimming. (*)
 biped object walking. (*)

19. In Alice, which of the following is not a control statement?
Move (*)

20. In Alice, which control statement is used to invoke simultaneous movement?
Do Together (*)

Minggu, 26 November 2017

Java Fundamental Section 7

1. Static classes can't return instances of the parent class when the parent class uses a private constructor. True or false?
False (*)

2. Static methods can't act like "setter" methods. True or false?
False (*)

3. Static methods can read static variables. True or false?
True (*)

4. What is Polymorphism?
The concept that a variable or reference can hold multiple types of objects. (*)

5. Would this code be correct if a Dog is a HousePet? Why or Why not? 
HousePet Scooby = new Dog();
Yes, because polymorphism allows this since Dog is a subclass of HousePet. (*)

6. Why would a programmer use polymorphism rather than sticking to a standard array?
Because arrays only work using the same object type and polymorphism provides a way around this. (*)

7. The constructor of a class has the same name as the class. True or false?
True (*)

8. Which of the following may be part of a class definition?
all of the above (*)

9. What operator do you use to call an object's constructor method and create a new object?
New (*)

10. An access modifier is a keyword that allows subclasses to access methods, data, and constructors from their parent class. True or false?
True (*)

11. Which of the following is the correct way to call an overriden method needOil() of a super class Robot in a subclass SqueakyRobot?
super.needOil(); (*)

12. What is the Java Applet?
(Choose all correct answers)
A web-based Java program that is embedded into a web browser. (*)
A graphic visual included in Java. (*)

13. Which of the following is a possible way to overload constructors?

 

14. Which of the following could be a reason to return an object?
The method makes changes to the object and you wish to continue to use the updated object outside of the method. (*)

15. Consider the following:

There is a method A that calls method B. Method B is a variable argument method. 

With this, which of the following are true?
(Choose all correct answers)
Method A can invoke method B twice, each time with a different number of arguments. (*)
When invoked, method B creates an array to store some or all of the arguments passed to it from method A. (*)

1. It is possible to inherit from an abstract class. True or false?
True (*)

2. If a class is immutable then it must be abstract. True or false?
False (*)

3. Which of the following would be most beneficial for this scenario?

Joe is a college student who has a tendency to lose his books. Replacing them is getting costly. In an attempt to get organized, Joe wants to create a program that will store his textbooks in one group of books, but he wants to make each book type the subject of the book (i.e. MathBook is a book). How could he store these different subject books into a single array?
Using polymorphism. (*)

4. Static classes can exist as stand alone classes. True or false?
False (*)

5. Public static variables can't have their value reset by other classes. True or false?
False (*)

6. A static variable is always publicly available. True or false?
False (*)

7. Which of the following correctly defines overloading?
Having more than one constructor with the same name but different arguments. (*)

8. A team is working on a coding project. They desire that all portions of their code should have access to the classes that they write. What access modifier should be used for each class?
Public (*)

9. It is possible to overload a method that is not a constructor. True or False?
True (*)
 
10. What value will be returned when the setValue method is called?


37(*)

11. A class can only have one constructor. True or false?
False (*)

12. The following statement compiles and executes. What do you know for certain? 

tree.grows(numFeet);
grows must be the name of a method. (*)

13. Why is it not possible to extend more than one class at a time in an inheritance hierarchy chain?
It is not necessary considering all public content is passed from super class to subclass and further to their subclass and that subclass' subclass and so on. (*)

14. Which of the following correctly describes an "is-a" relationship?
A helpful term used to conceptualize the relationships among nodes or leaves in an inheritance hierarchy. (*)

15. It is possible for a subclass to be a superclass. True or false?
True (*)

Senin, 20 November 2017

Java fundamental section 6

1. The following array declaration is valid. True or false?

int[] y = new int[5];
True (*)

2. double array[] = new double[8];

After execution of this statement, which of the following are true?
array.length is 8 (*)

3. The following array declaration is valid:

int[] y = new int[5];
True (*)

4. The following creates a reference in memory named z that can refer to seven different doubles via an index. True or false?

double z[] = new double[7];
True (*)

5. The following segment of code initializes a 2 dimensional array of primitive data types. True or false?

double[][] a=new double[4][5];
True (*)

6. Which of the following statements print every element of the one dimensional array prices to the screen?
for(int i=0; i < prices.length; i++){System.out.println(prices[i]);} (*)

7. The following segment of code initializes a 2 dimensional array of references. True or false?

String[][] array={{"a", "b", "C"},{"a", "b", "c"}};
True (*)

8. Which of the following statements adds 5 to every element of the one dimensional array prices and then prints it to the screen?

for(int i=0;i<prices.length;i++)
System.out.println(prices[i]+5); (*)

9. What is the output of the following segment of code if the command line arguments are "a b c d e f"?


6 (*)

10. The following array declaration is valid. True or false?
int k[] = new int[10];
True (*)

11. If an exception is thrown by a method, where can the catch for the exception be?
The catch can be in the method that threw the exception or in any other method that called the method that threw the exception. (*)

12. Which of the following could be a reason to throw an exception?
To eliminate exceptions from disrupting your program. (*)

13. Choose the best response to this statement: An error can be handled by throwing it and catching it just like an exception.
False. An error is much more severe than an exception and cannot be dealt with adequately in a program. (*)

14. A computer company has one million dollars to give as a bonus to the employees, and they wish to distribute it evenly amongst them.

The company writes a program to calculate the amount each employee receives, given the number of employees.

Unfortunately, the employees all went on strike before they heard about the bonus. This means that the company has zero employees.

What will happen to the program if the company enters 0 into the employment number?
(Choose all correct answers)

An exception will occur because it is not possible to divide by zero. (*)

15.  What are exceptions used for in Java?
Correcting mistakes made in your code and handling extraordinary cases. (*)


1.  Which line of code shows the correct way to throw an exception?
throw new Exception("Array index is out of bounds"); (*)

2. It is possible to throw and catch a second exception inside a catch block of code. True or false?
True (*)

3. What exception message indicates that a variable may have been mispelled somewhere in the program?
variableName cannot be resolved to a variable (*)

4. Choose the best response to this statement: An error can be handled by throwing it and catching it just like an exception.
False. An error is much more severe than an exception and cannot be dealt with adequately in a program. (*)

5. A computer company has one million dollars to give as a bonus to the employees, and they wish to distribute it evenly amongst them.

The company writes a program to calculate the amount each employee receives, given the number of employees.

Unfortunately, the employees all went on strike before they heard about the bonus. This means that the company has zero employees.

What will happen to the program if the company enters 0 into the employment number?
(Choose all correct answers)
An exception will occur because it is not possible to divide by zero. (*)

6. Which of the following declares and initializes a two dimensional array that can hold 6 Object reference types?
Object[][] array=new Object[2][3]; (*)

7. What is the Output of the following segment of code?

666666 (*)

8. The following creates a reference in memory named k that can refer to six different integers via an index. True or false?

int k[]= int[6];
False (*)

9. Which of the following declares a one dimensional array name scores of type int that can hold 14 values?

int[] scores=new int[14]; (*)

10. What is the output of the following segment of code?

int num[]={9,8,7,6,5,4,3,2,1};
for(int i=0;i<9;i=i+3)
System.out.print(num[i]);
963 (*)

11. The following creates a reference in memory named z that can refer to seven different doubles via an index. True or false?

double z[] = new double[7];
True (*)

12. The following array declaration is valid:

int[] y = new int[5];
True (*)

13. Which of the following declares and initializes a one dimensional array that can hold 5 Object reference types?
Object array=new Object[5]; (*)


Java Fundamental Section 5

1.  What will print if the following Java code is executed?

if ((5.1 > 4.3 && 6.2 < 8.4) && !(7.2 < 3.5 || 1.2 == 2.1 || 2.2 != 2.25))
System.out.print("TRUE");
else
System.out.print("FALSE");
False (*)

2.  What is the difference between the symbols = and == ?
The = is use to assign values to variables and the == compares values. (*)

3.  Consider that a Scanner has beeLabel
n initialized such that:

Scanner in = new Scanner(System.in);

Which of the following lines of code reads in the userメs input and sets it equal to a new String called input?
String input = in.next(); (*)

4.  In Java, each case seqment of a switch statement requires the keyword break to avoid "falling through".
True (*)

5.  Which of the following could be a reason to use a switch statement in a Java program?
Because it allows the program to run certain segments of code and neglect to run others based on the input given. (*)

6.  Which of the following correctly matches the switch statement keyword to its function?
(Choose all correct answers)
default: signals what code to execute if the input does not match any of the cases (*)

case: signals what code is executed if the user input matches the specified element (*)
switch: identifies what element will be compared to the element of the case statements to find a possible match (*)

7.  The three logic operators in Java are:

&&, ||, ! (*)

8.  The following code fragment properly implements the switch statement. True or false?

default(input)
switch '+':
answer+=num;
break;
case '-':
answer-=num;
break;
!default
System.out.println("Invalid input");
False (*)

9.  What is a loop?
A set of logic that is repeatedly executed until a certain condition is met. (*)

10.  One advantage to using a while loop over a for loop is that a while loop always has a counter. True or false?
False (*)

11.  The syntax below represents a valid initialization of a for loop counter. True or False?

public class ForLoop {
 public static void main (String args[])
 {
  for (int i=10; i <20; i++)
  {System.out.println("i: "+i); }
 }
}
True (*)

12.  What is one significant difference between a while loop and a do-while loop?
A DO-WHILE loop will always execute the code at least once, even if the conditional statement for the WHILE is never true. A WHILE loop is only executed if the conditional statement is true. (*)

13.  Identify which situation could be an example of a while loop.
All of the above. (*)

14.  Which of the following are types of loops in Java?

(Choose all correct answers)
while (*)
for (*)
do-while (*)

15.  In a for loop, the counter is automatically incremented after each loop iteration. True or False?
False (*)

1.  In an if-else construct, the condition to be evaluated must be contained within parentheses. True or False?
True (*)

2.  Which of the following are relational operators in Java?

(Choose all correct answers)
< (*)
<= (*)
!= (*)

3.  Which of the following correctly initializes an instance of Scanner, called "in", that reads input from the console screen?

Scanner in = new Scanner(System.in); (*)

4.  Which of the following correctly matches the switch statement keyword to its function?
(Choose all correct answers)
default: signals what code to execute if the input does not match any of the cases (*)
switch: identifies what element will be compared to the element of the case statements to find a possible match (*)
case: signals what code is executed if the user input matches the specified element (*)

5.  Which of the two diagrams below illustratethe correct syntax
for variables used in an if-else statement?














Example A(*)

6.  How would you use the ternary operator to rewrite this if statement?

if (gender == "male")
System.out.print("Mr.");
else
System.out.print("Ms.");
System.out.print( (gender == "male") ? "Mr." : "Ms." ); (*)

7.  In an if-else construct the condition to be evaluated must end with a semi-colon. True or false?
False (*)

8.  This keyword is used to instruct specific code when the input for a switch statement that does not match any of the cases.
Default(*)

9.  What is the output of the following code segment?

int num = 7;
while(num >= 0)
{
num -= 3;
}
System.out.println(num);
-2 (*)

10.  What should replace the comment "//your answer here" in the code below if the code is meant to take no action when i % 2 is 0 (in other words when i is even)?

for(int i = 0; i < 10; i++){
if(i%2 == 0)
//your answer here
else
k+=3;
}
Continue (*)

11.  What is one significant difference between a while loop and a do-while loop?
A DO-WHILE loop will always execute the code at least once, even if the conditional statement for the WHILE is never true. A WHILE loop is only executed if the conditional statement is true. (*)

12.  A counter used in a for loop cannot be initialized within the For loop statement. True or False?
False (*)

13.  In a for loop the counter is not automatically incremented after each loop iteration. Code must be written to increment the counter. True or false?
True (*)

14.  One advantage to using a while loop over a for loop is that a while loop always has a counter. True or false?
False (*)

15.  When the for loop condition statement is met the construct is exited. True or false?
False (*)

Java Fundamental Section 4

1.  Which of the following is not correct Java code?
double x=Math.pow; (*)

2.  Which of the following statements correctly assigns "3 times 10 to the 4th power" to the variable number?
double number=3e4; (*)

3.  Select the declaration and initialization statement that will hold the letter J.
char letter='J'; (*)

4.  What two values can a boolean variable have?
True and false (*)

5.  What will the method methodA print to the screen?

1.Public ClassA {
2.Int g=5; // global variable
3.Public void methodA() {
4.Int g=6 // local variable
5.System.out.println (g*3);
6.}
7.}
18 (*)


6.  A workspace can not have more than one stored projects. True or false?
False (*)

7.  A perspective is described as:
None of the above

8.  For every opening curly brace { there does not need to be a closing curly brace} for the program to compile without error. True or False?
False (*)

9.  The following defines a class keyword:
Precedes the name of the class. (*)

10.  Which of the two diagrams below illustrate the general form of a Java program?















Example B (*)

11.  The following defines an import keyword:
Provides the compiler information that identifies outside classes used within the current class. (*)

12.  When importing another package into a class you must import the entire package as well as the package classes that will be called. True or False?
False (*)

13.  Which of the following creates a String named Char?
String Char; (*)

14.  The String methods equals and compareTo perform similar functions and differ in their return type. True or false?
True (*)

15.  Declaring and instantiating a String is much like any other type of variable. However, once instantiated, they are final and cannot be changed. True or false?
True (*)


1.  Which of the following is not correct Java code?
double x=Math.pow; (*)

2.  Which of the following statements correctly assigns "3 times 10 to the 4th power" to the variable number?
double number=3e4; (*)

3.  Select the declaration and initialization statement that will hold the letter J.
char letter='J'; (*)

4.  What two values can a boolean variable have?
True and false (*)

5.  What will the method methodA print to the screen?

1.Public ClassA {
2.Int g=5; // global variable
3.Public void methodA() {
4.Int g=6 // local variable
5.System.out.println (g*3);
6.}
7.}
18 (*)


1.  A combination of views and editors are referred to as _______________.
A perspective (*)

2.  You can return to the Eclipse Welcome Page by choosing Welcome from what menu?
Help (*)

3.  When converting gallons to liters its best to put the calculation result into a variable with a _______________ data type.
Double(*)

4.  Which of the following is the name of a Java primitive data type?
Int(*)

5.  Which of the following declarations are correct?

(Choose all correct answers)
double duty; (*)
float loan; (*)

6.  Select the declaration and initialization statement that will hold the letter J.
char letter='J'; (*)

7.  Which of the following examples of Java code is not correct?
boolean b=1; (*)

8.  Which of the following statements correctly assigns "3 times 10 to the 4th power" to the variable number?
double number=3e4; (*)


9. The following program prints "Not Equal":











True or false?
 True (*)


10.  Consider the following code snippet

String forest = new String("Black");
System.out.println(forest.length());

What is printed?
5 (*)

11.  Suppose that s1 and s2 are two strings. Which of the statements or expressions are valid?
(Choose all correct answers)

int m = s1.length(); (*)
String s3 = s1 + s2; (*)
s1.compareTo(s2); (*)

12.  The following defines a class keyword:
Precedes the name of the class. (*)

13.  When importing another package into a class you must import the entire package as well as the package classes that will be called. True or False?
False (*)

14. Which of the two diagrams below illustrate the general from a
Java program?














Example B (*)

15.  Which of the following defines a driver class?
Contains a main method and other static methods. (*)

Java Fundamental Section 3 L6-L10

1.  In Greenfoot you can interact with the scenario using a mouse.
True (*)
2.  In Greenfoot, which method checks if a key on the keyboard has been pressed?
isKeyDown method (*)
3.  Greenfoot has tools to record sound. True or false?
True (*)
4.  A collision in Greenfoot is when two actors make contact?
True (*)
5.  From your Greenfoot lessons, how do you call a defined method?
Call the method from the act method. (*)
6.  In Greenfoot, defined methods must be used immediately. True or false?
False (*)
7.  Which of the following is an example of string concatenation?
Instead of entering ".png" after each image file name, add + ".png" after the imageName value in the programming statement. (*)
8.  In Greenfoot, what type of symbol is used to connect boolean expressions?
Logic operators (*)
9.  Which of the following is not a component of a while loop?

if statement (*)
10.  Which of the following answers have the correct syntax for declaring a class variable in Greenfoot?
(Choose all correct answers)
public variable-type variable-name; (*)
private variable-type variable-name; (*)
11.  Where can we review the available classes and methods in Greenfoot, including the stop method?
Greenfoot Application Programmers' Interface (API) (*)
12.  From your Greenfoot lessons, what is the parameter of the following constructor that creates a new image, and designates it to the Actor class?

setImage (new GreenfootImage("Bee01.png"));
Bee01.png (*)
13.  Abstraction occurs in many different ways in programming. True or false?
True (*)
14.  From your Greenfoot lessons, which one of the following is an example of when an abstraction technique is used?
Passing a paramater in a constructor to set an initial speed. (*)
15.  In Greenfoot, you can cast an Actor class to a World class?
False (*)

Java Fundamental Section 2 L8-L14

1.  The condition in a WHILE loop is a boolean expression. True or false?
True (*)
2.  What do lines 7, 10 and 13 do in the following code?















Print "A","B", and the value of num3 on the screen (*)

3.  Which of the following IF control structures command the blue tang fish to roll and simultaneously move down if it collides with a shark, or move forward if it does not collide with a shark?

















4.  In Alice, you must place the control structure in the code editor before adding any code that will go within it. True or false?
False (*)
5.  Variable values can be changed as often as you like. True or false?
True (*)
6.  When viewing the Java Code on the side in Alice, you can change the Java code directly instead of the Alice code. True or false?
False (*)
7.  In Alice, which of the following programming statements moves the cat backward, half the distance to the bird?
this.Cat move backward {this.Cat getDistanceTo this.Bird / 2} (*)
8.  An example of an expression is:
3*3=9 (*)
9.  If the value already exists in the variable it is overwritten by the assignment operator (=). True or false?
True (*)
10.  Which of the following does not describe variables?
Arranged in rows and columns. (*)
11.  Alice provides pre-populated worlds through which new menu tab?
Starters (*)
12.  Which one of the following event listener types is not available at the top-level of the addEvent drop down list in Alice?
Collision (*)
13.  In Alice, what are the forms of a scenario?
A task to perform. (*)

A problem to solve. (*)
14.  When presenting your Alice animation, ensure that your presentation is thoroughly tested and complete. True or false?
True (*)
15.  In Alice, as part of the recording process you can demonstrate the events that are programmed within your animation. True or false?
True (*)

Kamis, 16 November 2017

Java Fundamental Section 3 L1-L5

1.  From your Greenfoot lessons, the reset button resets the scenario back to its initial position. True or false?
True (*)
2.  What does an instance of the World class do?
Provide the background scenery for the scenario. (*)
3.  In Greenfoot, after a subclass is created, what has to occur before instances can be added to the scenario?
Compilation (*)
4.  Which of the following Java syntax is used to correctly create a Bee subclass?
public class Bee extends Animal (*)
5.  From your Greenfoot lessons, what can methods belong to?
(Choose all correct answers)
Classes (*)
Objects (*)
6.  Which keyword indicates that Greenfoot needs to create a new object?
new (*)
7.  The first step to executing an if-else statement is to:____________.
Evaluate the condition (*)
8.  In Greenfoot you can use comparison operators to compare a variable to a random number. True or false?
True (*)
9.  In the Greenfoot IDE, an instance's position is on the x and y coordinates. True or false?
True (*)
10.  In Greenfoot, the body of the method is located in between which of the following characters?
Curly brackets { } (*)
11.  An instance variable can be saved and accessed later, even if the instance no longer exists. True or false?
False (*)
12.  In Greenfoot, the instance has a source code editor. True or false?
False (*)
13.  When designing a game in Greenfoot, it helps to define the actions that will take place in a textual storyboard. True or false?
True (*)
14.  The list below provides actions you can perform in the Greenfoot code editor except one. Which one should be removed?
Review the online Java Library documentation. (*)
15.  In a Greenfoot if-statement, the programming statements that the if-statement executes are written in curly brackets. True or false?
True (*)

Java Fundamental Section 2 L1-L7

1.  Which option copies a programming instruction to the clipboard?
Copy to Clipboard (*)
2.  In Alice, what are the forms of a scenario?

(Choose all correct answers)
A problem to solve. (*)

A task to perform. (*)
3.  Breaking down a problem or process into smaller parts makes it easier to manage. True or false?
True (*)
4.  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?
True (*)
5.  In Alice, a walking motion for a bipedal object can be achieved without the Do Together control statement. True or false?
False (*)
6.  Which of the following actions would require a control statement to control animation timing?
(Choose all correct answers)

A bird flying. (*)
A fish swimming. (*)A biped object walking. (*)
7.  What is the first step to entering comments in an Alice program?
Drag and drop the comments tile above a code segment. (*)
8.  The Alice Scene editor contains tools to rotate the camera view. True or false?
True (*)
9.  Which of the following would not be an argument in an Alice programming instruction that commands a person object to move forward 2 meters?
Person's height (*)
10.  Which handle style would be used to rotate an object's sub-part about the x, y, and z axes?
Rotation (*)
11.  From your Alice lessons, what is a one-shot procedural method?
A procedure that is used to make a scene adjustment. (*)
12.  From your Alice lessons, which programming instruction represents the following movement: A cat moves forward double (or twice) the distance to the tree.
this.Cat move Forward this.Cat getDistanceTo this.tree * 2.0 (*)
13.  In Alice, functions are dragged into the control statement, not the procedure. True or false?
False (*)
14.  From your Alice lessons, the Do In Order control statement is also referred to by what other name?
Sequential control (*)
15.  From your Alice lessons, what is the purpose of nesting?
To add visual structure to your program. (*)

Databases Design Final Exam

1.  When all attributes are single-valued, the database model is said to conform to:
1st Normal Form (*)
2.  To convert an entity with a multi valued attribute to 1st Normal Form, we create an additional entity and relate it to the original entity with a 1:1 relationship. True or False?
False (*)
3.  When data is stored in more than one place in a database, the database violates the rules of ___________.
Normalization (*)
4.  An entity ORDER has the attributes Order ID, Order Date, Product id, Customer ID. This entity is in 1st Normal Form. True or False?

False (*)
5.  Which of the following would be suitable UIDs for the entity EMPLOYEE: (Choose Two)
(Choose all correct answers)
Social Security Number (*)
Employee ID (*)
6.  A unique identifier can only be made up of one attribute. True or False?
False (*)
7.  A UID can be made up from the following: (Choose Two)
(Choose all correct answers)
Attributes (*)
Relationships (*)
8.  An entity can only have one Primary UID. True or False?

True (*)
9.  What is the rule of Second Normal Form?

All non-UID attributes must be dependent upon the entire UID. (*)
10.  To resolve a 2nd Normal Form violation, we:

Move the attribute that violates 2nd Normal Form to a new entity with a relationship to the original entity. (*)
11.  Examine the following entity and decide which attribute breaks the 2nd Normal Form rule:
ENTITY: RECEIPT
ATTRIBUTES:
   #CUSTOMER ID
   #STORE ID
   STORE LOCATION
   DATE

STORE LOCATION (*)
12.  Examine the following Entity and decide which rule of Normal Form is being violated:
ENTITY: CLIENT ORDER
ATTRIBUTES:
    # CLIENT ID
    # ORDER ID
    FIRST NAME
    LAST NAME
    ORDER DATE
    CITY
    ZIP CODE
2nd Normal Form. (*)
13.  Examine the following Entity and decide which rule of Normal Form is being violated:
ENTITY: CLIENT
ATTRIBUTES:
    # CLIENT ID
    FIRST NAME
    LAST NAME
    ORDER ID
    STREET
    ZIP CODE
1st Normal Form. (*)
14.  As a database designer, you do not need to worry about where in the datamodel you store a particular attribute; as long as you get it onto the ERD, your job is done. True or False?
False (*)
15.  When any attribute in an entity is dependent on any other non-UID attribute in that entity, this is known as:
Transitive dependency (*)
16.  Cascading UIDs are a feature often found in what type of Relationship?
Heirarchical Relationship (*)
17.  A particular problem may be solved using either a Recursive Relationship or a Hierarchical Relationship, though not at the same time. True or False?
True (*)
18.  A Hierarchical relationship is a series of relationships that reflect entities organized into successive levels. True or False?

True (*)
19.  A relationship between an entity and itself is called a/an:

Recursive Relationship (*)
20.  A Recursive Relationship is represented on an ERD by a/an:
Pig's Ear (*)
21.  Which of the following would best be represented by an arc?
DELIVERY ADDRESS (Home, Office) (*)

22.  Which of the following can be added to a relationship?
An arc can be assigned (*)
23.  To visually represent exclusivity between two or more relationships in an ERD you would most likely use an ________.
Arc (*)
24.  Every business has restrictions on which attribute values and which relationships are allowed. These are known as:
Constraints. (*)

Section 8
25.  When a relationship may or may not be transferable, depending on time, this is know as a/an:
Conditional Non-transferable Relationship. (*)
26.  All systems must have an entity called WEEK with a holiday attribute so that you know when to give employees a holiday. True or False?
False (*)
27.  You must make sure all entities of a proposed system can fit onto one diagram. It is not allowed to break up a data model into more than one diagram. True or False?

False (*)

28.  Which of the following statements are true for ERD's to enhance their readability. (Choose Two)

(Choose all correct answers)
Avoid crossing one relationship line with another. (*)
It is OK to break down a large ERD into subsets of the overall picture. By doing so, you end up with more than one ERD that, taken together, documents the entire system. (*)
29.  You are doing a data model for a computer sales company where the price of postage depends upon the day of the week that goods are shipped. So shipping is more expensive if the customer wants a delivery to take place on a Saturday or Sunday. What would be the best way to model this?
Use a Delivery Day entity, which holds prices against week days, and ensure the we also have an attribute for the Requested Delivery Day in the Order Entity. (*)
30.  What is the function of logging or journaling in conceptual data models?

Allows you to track the history of attribute values, relationships, and/or entire entities (*)
31.  Modeling historical data can produce a unique identifier that includes a date. True or False?
True (*)
32.  Which of the following scenarios should be modeled so that historical data is kept? (Choose two)
(Choose all correct answers)
CUSTOMER and PAYMENTS (*)
CUSTOMER and ORDERS (*)
Section 9
33.  When mapping supertypes, relationships at the supertype level transform as usual. Relationships at the subtype level are implemented as foreign keys, but the foreign key columns all become optional. True or False?
True (*)
34.  Which of the following is a valid reason for considering a Subtype Implementation?

Business functionality, business rules, access paths, and frequency of access are all very different between the subtypes. (*)
35.  In a physical data model, an attribute becomes a _____________.
Column (*)
36.  Attributes become columns in a database table. True or False?
True (*)
37.  In a physical data model, a relationship is represented as a combination of: (Choose Two)
(Choose all correct answers)
Primary Key or Unique Key (*)
Foreign Key (*)
38.  The Physical model is created by transforming which of the following models?
Conceptual (*)
39.  Column integrity refers to
Columns always containing values consistent with the defined data format (*)
40.  The explanation below is an example of which constraint type?
If the value in the balance column of the ACCOUNTS table is below 100, we must send a letter to the account owner which will require extra programming to enforce.
User-defined integrity (*)
41.  The explanation below is an example of which constraint type?
The value in the dept_no column of the EMPLOYEES table must match a value in the dept_no column in the DEPARTMENTS table.
Referential integrity (*)
42.  A foreign key always refers to a primary key in the same table. True or False?

False (*)
43.  The explanation below is an example of which constraint type?
A primary key must be unique, and no part of the primary key can be null.

Entity integrity (*)
44.  An Arc is transformed to the physical model by adding a foeign Key for every relationship in the Arc. True or False?
True (*)
45.  One-to-Many Optional to Mandatory becomes a _______________ on the Master table.
Optional Foreign Key (*)
46.  It is possible to implement non-transferability via a simple Foreign Key Relationship. True or False?

False (*)
47.  One-to-One relationships are transformed into Foreign Keys in the tables created at either end of that relationship. True or False?
False (*)
48.  One-to-One relationships are transformed into Check Constraints in the tables created at either end of that relationship. True or False?
False (*)
Section 10
49.  System Documentation is developed right at the end once the system has gone live and users have been using it for a little while. You are more likely to get it correct that way. True or False?
False (*)
50.  During which phases of the System Development Life Cycle would you test the system before rolling it out to the users?
Transition and Production (*)

Databases Design Section 9

1.  In an Oracle database, why would 1_TABLE not work as a table name?

Object names must not start with a number. They must begin with a letter. (*)
2.  Attributes become columns in a database table. True or False?
True (*)
3.  In a physical data model, an attribute becomes a _____________.
Column (*)
4.  In a physical data model, a relationship is represented as a:

Foreign Key (*)
5.  A foreign key always refers to a primary key in the same table. True or False?

False (*)
6.  Foreign keys must be null. True or False?
False (*)
7.  Column integrity refers to
Columns always containing values consistent with the defined data format (*)
8.  A foreign key cannot refer to a primary key in the same table. True or False?

False (*)
9.  In a physical model, many to many relationships are resolved via a structure called a(n): ________________
Intersection Table (*)
10.  One-to-One relationships are transformed into Check Constraints in the tables created at either end of that relationship. True or False?
False (*)
11.  The Oracle Database can implement a many to many relationship. You simply create two foreign keys between the two tables. True or False?
False (*)
12.  It is possible to implement non-transferability via a simple Foreign Key Relationship. True or False?
False (*)
13.  The "Arc Implementation" is a synonym for what type of implementation?
Supertype and Subtype Implementation (*)
14.  Which of the following is a valid reason for considering a Subtype Implementation?

Business functionality, business rules, access paths, and frequency of access are all very different between the subtypes. (*)
15.  When mapping supertypes, relationships at the supertype level transform as usual. Relationships at the subtype level are implemented as foreign keys, but the foreign key columns all become optional. True or False?
True (*)

Database Design Section 8

1.  No formal rules exist for drawing ERD's. The most important thing is to make sure that all entities, attributes, and relationships are documented on the diagram, and the diagram is clear and readable. True or False?
Mark for Review (1) Point
True(*)
False
2.  You must make sure all entities of a proposed system can fit onto one diagram. It is not allowed to break up a data model into more than one diagram. True or False?
Mark for Review (1) Point
True
False(*)
3.  In an ERD, High Volume Entities usually have very few relationships to other entities. True or False?

Mark for Review (1) Point
True
False(*)
4.  Which of the following statements are true for ERD's to enhance their readability. (Choose Two)

(Choose all correct answers)
Mark for Review (1) Point
It is OK to break down a large ERD into subsets of the overall picture. By doing so, you end up with more than one ERD that, taken together, documents the entire system. (*)
Avoid crossing one relationship line with another. (*)
5.  Modeling historical data is optional. True or False?
Mark for Review (1) Point
True(*)
False
6.  When you add the concept of time to your data model, your model becomes more complex. True or False?
Mark for Review (1) Point
True(*)
False
7.  In a payroll system, it is desirable to have an entity called DAY with a holiday attribute when you want to track special holiday dates. True or False?
Mark for Review (1) Point
True(*)
False
8.  If you have an entity with a DATE attribute, in addition to other attributes that track date characteristics, you should create a DAY entity. True or False?
Mark for Review (1) Point
True(*)
False
9.  All systems must have an entity called WEEK with a holiday attribute so that you know when to give employees a holiday. True or False?
Mark for Review (1) Point
True
False(*)
10.  Modeling historical data can produce a unique identifier that includes a date. True or False?
Mark for Review (1) Point
True(*)
False
11.  Historical data should always be kept. True or False?
Mark for Review (1) Point
True
False(*)
12.  Which of the following scenarios should be modeled so that historical data is kept? (Choose two)

(Choose all correct answers)
Mark for Review (1) Point

CUSTOMER and PAYMENTS (*)

CUSTOMER and ORDERS (*)
13.  Why would you want to model a time component when designing a system that lets people buy bars of gold?
Mark for Review (1) Point
The price of gold fluctuates and, to determine the current price, you need to know the time of purchase. (*)
14.  When a system requires that old values for attributes are kept on record, this is know as Journaling or Logging. True or False?
Mark for Review (1) Point
True(*)
False
15.  All systems must include functionality to provide logging or journaling in conceptual data models. True or False?
Mark for Review (1) Point
True
False(*)

Databases Design Section 7

1.  Cascading UIDs are a feature often found in what type of Relationship?
Mark for Review (1) Point
Heirarchical Relationship (*)
Recursive Relationship
Invalid Relationship
General Relationship
2.  A Hierarchical relationship is a series of relationships that reflect entities organized into successive levels. True or False?
Mark for Review (1) Point
True (*)
False
3.  A relationship between an entity and itself is called a/an:
Mark for Review (1) Point
General Relationship
Invalid Relationship
Recursive Relationship (*)
Heirarchical Relationship
4.  A single relationship can be both Recursive and Hierarchical at the same time. True or False?
Mark for Review (1) Point
True
False(*)
5.  A particular problem may be solved using either a Recursive Relationship or a Hierarchical Relationship, though not at the same time. True or False?
Mark for Review (1) Point
True (*)
False
6.  Business organizational charts are often modeled as a Hierarchical relationship. True or False?
Mark for Review (1) Point
True (*)
False
7.  A recursive relationship must be Mandatory at both ends. True or False?
Mark for Review (1) Point
True
False(*)
8.  Arcs are used to visually represent _________ between two or more relationships in an ERD.
Mark for Review (1) Point
Sameness Differences
Exclusivity (*) Inheritance
9.  Which of the following would best be represented by an arc?
Mark for Review (1) Point
STUDENT (graduating, female)
STUDENT (senior, male)
STUDENT (Grade A student, Average Student)

STUDENT ( University, Technical College) (*)
10.  An arc can often be modeled as Supertype and Subtypes. True or False?
Mark for Review (1) Point
True (*)
False
11.  Which of the following would best be represented by an arc?

Mark for Review (1) Point
TEACHER (Female, Bob) DELIVERY ADDRESS (Home, Office) (*)
STUDENT (Grade A student, Average Student) PARENT (Girl, Bob)
12.  Arcs model an Exclusive OR constraint. True or False?
Mark for Review (1) Point
True (*)
False
13.  Every business has restrictions on which attribute values and which relationships are allowed. These are known as:
Mark for Review (1) Point
Attributes
Entities.
Relationships
Constraints. (*)
14.  All relationships participating in an arc must be mandatory. True or False?
Mark for Review (1) Point
True
False (*)
15.  Arcs are Mandatory in Data modeling. All ERD's must have at least one Arc. True or False?
Mark for Review (1) Point
True
False (*)

1.  A Hierarchical relationship is a series of relationships that reflect entities organized into successive levels. True or False?
Mark for Review (1) Point
True(*)
False
2.  Business organizational charts are often modeled as a Hierarchical relationship. True or False?
Mark for Review (1) Point
True(*)
False
3.  A single relationship can be both Recursive and Hierarchical at the same time. True or False?
Mark for Review (1) Point
True
False(*)
4.  A Recursive Relationship is represented on an ERD by a/an:
 Mark for Review (1) Point
Pig’s Ear(*)
Single Toe
Crow’s Foot
Dog’s Tail
5.  Cascading UIDs are a feature often found in what type of Relationship?
Mark for Review (1) Point

Invalid Relationship
General Relationship
Heirarchical Relationship(*)
Recursive Relationship

6.  A relationship between an entity and itself is called a/an:
Mark for Review (1) Point
Invalid Relationship
General Relationship
Heirarchical Relationship
Recursive Relationship(*)
7.  A particular problem may be solved using either a Recursive Relationship or a Hierarchical Relationship, though not at the same time. True or False?

Mark for Review (1) Point
True
False(*)
8.  Arcs model an Exclusive OR constraint. True or False?
Mark for Review (1) Point
True(*)
False
9.  Every business has restrictions on which attribute values and which relationships are allowed. These are known as:
Mark for Review (1) Point
Constraints. (*)
Relationships
Entities
Attributes
10.  Which of the following would best be represented by an arc?
Mark for Review (1) Point
TEACHER (Female, Bob) PARENT (Girl, Bob)
DELIVERY ADDRESS (Home, Office) (*) STUDENT (Grade A student, Average Student)
11.  Arcs are used to visually represent _________ between two or more relationships in an ERD.
Mark for Review (1) Point
Inheritance
Exclusivity (*)
Differences
Sameness
12.  All relationships participating in an arc must be mandatory. True or False?
Mark for Review (1) Point
True
False(*)
13.  Which of the following would best be represented by an arc?

STUDENT ( University, Technical College) (*)
14.  Which of the following can be added to a relationship?
An arc can be assigned (*)
15.  An arc can often be modeled as Supertype and Subtypes. True or False?

Mark for Review (1) Point
True(*)
False




Database Design Section 6

1.  If an entity has a multi-valued attribute, to conform to the rule of 1st Normal Form we:
Mark for Review (1) Points
Create an additional entity and relate it to the original entity with a M:M relationship.
Do nothing, an entity does not have to be in 1st Normal Form
Make the attribute optional
Create an additional entity and relate it to the original entity with a 1:M relationship. (*)
2.  To convert an entity with a multi valued attribute to 1st Normal Form, we create an additional entity and relate it to the original entity with a 1:1 relationship. True or False?
Mark for Review (1) Points
True
False (*)
3.  When data is only stored in one place in a database, the database conforms to the rules of ___________.
Mark for Review (1) Points

Multiplication
Reduction
Normalization (*)
Normality
4.  When data is stored in more than one place in a database, the database violates the rules of ___________.
Mark for Review (1) Points
Normalcy
Replication
Decency
Normalization (*)
5.  A transitive dependency exists when any attribute in an entity is dependent on any other non-UID attribute in that entity.
Mark for Review (1) Points
True (*)
False
6.  Examine the following Entity and decide which sets of attributes break the 3rd Normal Form rule:
ENTITY: TRAIN
ATTRIBUTES:
    TRAIN ID
    MAKE
    DRIVER ID
    DRIVER NAME
    DATE OF MANUFACTURE
Mark for Review (1) Points
TRAIN ID, MAKE
DRIVER ID, DRIVER NAME (*)
MAKE, DATE OF MANUFACTURE
None of the above, the entity is already in 3rd Normal Form.
7.  The Rule of 3rd Normal Form states that No Non-UID attribute can be dependent on another non-UID attribute. True or False?


Mark for Review (1) Points
True (*)
False
8.  As a database designer, you do not need to worry about where in the datamodel you store a particular attribute; as long as you get it onto the ERD, your job is done. True or False?
Mark for Review (1) Points
True
False(*)
9.  Examine the following entity and decide which attribute breaks the 2nd Normal Form rule:
ENTITY: CLASS
ATTRIBUTES:
   #CLASS ID
   #TEACHER ID
   SUBJECT
   TEACHER NAME
Mark for Review (1) Points
CLASS ID
TEACHER ID
TEACHER NAME (*)
SUBJECT
10.  Any Non-UID attribute must be dependent upon the entire UID. True or False?
Mark for Review (1) Points
True (*)
False
11.  To resolve a 2nd Normal Form violation, we:
Mark for Review (1) Points
Do nothing, an entity does not need to be in 2nd Normal Form.
Move the attribute that violates 2nd Normal Form to a new entity with a relationship to the original entity. (*)
Move the attribute that violates 2nd Normal Form to a new ERD.
Delete the attribute that was causing the violation
12.  An entity could have more than one attribute that would be a suitable Primary UID. True or False?
Mark for Review (1) Points
True (*)
False
13.  There is no limit to how many columns can make up an entity's UID. True or False?
Mark for Review (1) Points
True (*)
False
14.  Which of the following would be suitable UIDs for the entity EMPLOYEE: (Choose Two)

(Choose all correct answers)
Mark for Review (1) Points

Address Social Security Number (*)
Last Name Employee ID (*)
15.  The candidate UID that is chosen to identify an entity is called the Primary UID; other candidate UIDs are called Secondary UIDs.
Mark for Review (1) Points

No, each Entity can only have one UID, the secondary one.
No, it is not possible to have more than one UID for an Entity.
No, after UIDs are first sorted, the first one is called the Primary UID, the second is the Secondary UID, etc.
Yes, this is the way UID's are named. (*)






Senin, 13 November 2017

Email server dan DHCP

Tugas Pertemuan 13
Email server dan DHCP

Aisyah Dian Rahmasari
43A87007150368
S1/SI/4 B







                                             1. Mengisi IP Address di Server


2. Server, lalu klik DHCP, atur settingan



3. Klik DNS, atur settingan



4. Klik Email, lalu atur akun dan password 



5. Klik setiap PC, lalu IP Address, klik DHCP







6. Klik Web Browser, dan tes ketik link sisteminformasi.com


7. Configure akun email, send email dan receive email