Sunday 24 June 2012

Drawing Circles On Eclipse Task

Drawing Circles On Eclipse Task
Start Class (Note on the image it says Start2 because I made a minor error in the beginning): 



Special Panel Class: 







Special Frame Class: 




Result (Note the circles appear like that because I was trying to move them to wear my teacher requested but I couldnt make it that far sadly so excuse the circles but they just want to be different :p): 



Character Player Task Eclipse Work

An Example Of Setting Up A Player With Inventory In Eclipse. An Assessment At Tafe.

Class Start:


           Class  Player:


 

 

Class Inventory And Result: 



Eclipse Work 1 Array Example Shopping List

An Example Of An Array On Eclipse I Was Shown In Class.



Homework

1. What keyword implements inheritance?
extends is the keyword for inheritance. 

 2. What is the name of the Component library we have used this week?
Swing

3. Provide the following links:
  1. java specification 7 :http://docs.oracle.com/javase/7/docs/api/
  2. java specification 7 - javax.swing: http://docs.oracle.com/javase/7/docs/api/javax/swing/colorchooser/package-summary.html
  3. java specification 7 - JPanel: http://docs.oracle.com/javase/7/docs/api/javax/swing/JPanel.html
  4. java specification 7 - JFrame: http://docs.oracle.com/javase/7/docs/api/javax/swing/JFrame.html
  5. java specification 7 - JOptionPane: http://docs.oracle.com/javase/7/docs/api/javax/swing/JOptionPane.html

 
4. Describe/show a for loop that has been primed to start at 0 and continue 10 times.
starting condition | continuation condition | increment/decrement
for (int i =0; i < 10; i ++) {
}


5. What is a constructor?      
to create an instance or object  


6. What is the difference between a class and an object? http://javapants.blogspot.com.au/2012/03/what-is-class.html  

A class is the definition of something and object is a 

7. What keyword do we use to instantiate an object from a class?
new 

8. Describe the parameters required by the drawOval method. - 4 required.
  1. x screen coord
  2. y screen coord
  3. height to draw
  4. width to draw 







9. What do X & Y screen coordinates mean/refer to? 
X = Width 
Y = Hight

10. What is the top left coordinate of the screen? 
 0,0

 

Algorithm2 & Java

  1. What is the value of X & Y if
    1. R = 400, T = 10 : X = 1400 and Y = 910
    2. R = 4000, T = 20: X = 5000 and Y = 920
               c.  R = 4010, T = 50: X = 0 and Y = 0   


2. How many packages may a Java project contain? 
          Many 

 3. How many classes may a Java package contain? 
          Many  

 4. What are the two types of methods? 

          The 2 types of methods are :
            Procedures and Functions

5. Explain the differences and similarities between the two types of methods. 

Both Process one returns something the other doesnt. 


6. Of the two types of methods, which one is the Main method?   
  Procedure

7.What does the keyword void mean & where is it generally seen?
 Void means nothing meaning nothing is there. Empty is an example of Void it is seen in the main method.  
 
8. What is the special purpose of the Main method?


 It is the starting point of the Java project.  

9. Explain the purpose of a method parameter?

 is a value that supports the main methods function. 

 10.How is the semi-colon used in the Java syntax?
the semi clolon is used to end a piece of code  line so you can start a new one


11. How are the curly braces used in the Java syntax?
Curly Braces are used to end a certin amount of code example you adding a  pice of code thats all related and you wanted to start something new ater it you would have to use curly braces to mange everything.  

12.What data type stores whole numbers?  

 Primitive Data TYPE

13.What data type stores a collection of keyboard characters?

String

14.What data type stores a single character
Char 

15 .What data type stores a True/False value? 
Boolean

16. What is a variable used for?
To hold Values together. 

  1. What is the syntax for a literal string?

 Double Quotation Marks

18. What is the syntax for a literal character?

Single Quote Characters 
  
19. What is the syntax for a literal whole number?
  Whole Number Are Followed By The "L" 

20.  What is the increment operator?  
     +

21. What is the decrement operator? 
 +
 
22. What is the concatenation operator? 
 +

23. What keyword is used between each case in a Switch, to stop execution of the Switch? 
 "Else"
 
24. What should always be the last case of a Switch?
"End Else"
 
 25. How is an object defined? 
 By Its State And Behavior


26. What is the difference between an object and a class? Use a real world object on your example if you like.

A Class Is A Full Definition Of All State And Behavior