1. What keyword implements inheritance?
Extends is the keyword used to implement 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/SwingConstants.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.
for( int j = 0; j > 10; j++)
(j = 0) Starting condition, makes the loop start at 0
(j > 10) Continuation condition, Will loop as long as j is less then 10.
(j++) Increment/Decrement, Will increase the value of j as long as the continuation condition is met.
5. What is a constructor?
6. What is the difference between a class and an object?
Class: Defines all states and behaviors of an entity
Object: Is created from the class
7. What keyword do we use to instantiate an object from a class?
We use the keyword new.
8. Describe the parameters required by the drawOval method.
There are 4 parameters needed;
1. The X screen coordinate
2. The Y screen coordinate
3. Height to draw
4. Width to draw
9. What do X & Y screen coordinates mean/refer to?
The locations of were the your drawing too.
10. What is the top left coordinate of the screen?
0,0
COD
Thursday, 21 June 2012
Monday, 20 February 2012
Algorithm Development 1 Validation
Step 1
Get price to send parcel.
Step 2
Weight of package, Price per kilo.
Step 3
validate Weight of package, Price per kilo
Step 4
Multiply weight of package by price per kilo
Step 5
Display Price of Parcel
Step 6
Calculate Price
- Prompt user for weight of parcel, price per kilo
- Get weight of package, price per kilo
- Cost of package = Weight of parcel * Price per kilo
- Display cost of sending parcel
End
Algorithm Development 2 Validation
Step 1
Estimate time to complete new game
Step 2
Hours to complete previous games, Amount of games
Step 3
Validate Hours to complete, Amount of games.
Step 4
Estimated hours to complete new game
Step 5
Add hours of games / amount of games
Step 6
Calculate Estimated Time
- Prompt user for hours to complete previous games, Amount of games.
- Get Hours to complete previous games, Amount of games.
- If T Continue, If F return to start.
- Validate Hours to complete previous games, Amount of games.
- Estimated hours = Hours to complete previous games / Amount of games.
- Show estimated hours to complete new game.
End
Monday, 13 February 2012
Algorithm Development 2
Step 1
Estimate time to complete new game
Step 2
Hours to complete previous games, Amount of games
Step 3
Estimated hours to complete new game
Step 4
Add hours of games / amount of games
Step 5
Calculate Estimated Time
- Prompt user for hours to complete previous games, Amount of games
- Get Hours to complete previous games, Amount of games
- Estimated hours = Hours to complete previous games / Amount of games
- Show estimated hours to complete new game
End
Estimate time to complete new game
Step 2
Hours to complete previous games, Amount of games
Step 3
Estimated hours to complete new game
Step 4
Add hours of games / amount of games
Step 5
Calculate Estimated Time
- Prompt user for hours to complete previous games, Amount of games
- Get Hours to complete previous games, Amount of games
- Estimated hours = Hours to complete previous games / Amount of games
- Show estimated hours to complete new game
End
Algorithm Development 1
Step 1
Get price to send parcel.
Step 2
Weight of package, Price per kilo.
Step 3
Price of package
Step 4
Multiply weight of package by price per kilo
Step 5
Calculate Price
- Prompt user for weight of parcel, price per kilo
- Get weight of package, price per kilo
- Cost of package = Weight of parcel * Price per kilo
- Display cost of sending parcel
End
Get price to send parcel.
Step 2
Weight of package, Price per kilo.
Step 3
Price of package
Step 4
Multiply weight of package by price per kilo
Step 5
Calculate Price
- Prompt user for weight of parcel, price per kilo
- Get weight of package, price per kilo
- Cost of package = Weight of parcel * Price per kilo
- Display cost of sending parcel
End
What is an Algorithm
An algorithm is a procedure which are used for calculations, data processing and automated reasoning, which when started from there initial state will proceed through well-defined states, eventually producing output and then terminate when finished.
http://en.wikipedia.org/wiki/Algorithm
http://en.wikipedia.org/wiki/Algorithm
Sunday, 12 February 2012
Programming
Subscribe to:
Posts (Atom)