Thursday, September 24, 2009

Discussions bout the Previous Post

text source code
*System.out.println -
tells the program to output or print a text in a new line
dialog box code
instructs the computer to perform an action, namely to print the string of characters contained between the double quotation marks (according to our teacher)

*import javax.JOptionPane -
calls the class
is an import statement.

--------------
the output of my program coming sooon!!!!

Chapter 1 cont. "JAVA"






TOPIC: JAVA
Java Program that will view a text, dialog box and an applet.
The Problem: Print Out your info's about our blog in three lines
First: Making a Flow Chart or Pseudo code =)
Then were gonna start with the source code of TEXT
// Blog.java
// Prints all about my blog in three separated lines
public class Blog
{ //start of the main method
public static void main (string args [] )
{
System.out.println ("debugmylife.blogspot.com");
System.out.println ("blog about what i have learned in school");
System.out.println ("visit my site!!");
} //end method main
} //end class

then save with the name of the class .java ex Blog.java
now let's go to DIALOG BOX
// BlogDialogbox.java
// Display a Dialog Box
import javax.swing.JOptionPane; //import class
public class BlogDialogBox
{ // main method starts
public static void main (string args [] )
{
JOptionPane.showMessageDialog (null, "debugmylife.blogspot.com \n
blog about technology \n visit my site!!");
System.exit(0); //terminate the app
}
}
done with the dialog box, let's now proceed to APPLET

// BlogApplet.java
//Just like the other first 2
import java.awt.*;
import java.applet.*;
public class BlogApplet.java
{
public void paint ( Graphics g )
{
g.drawString (" debugmylife.blogspot.com ", 15, 20);
g.drawString (" blog about technology ", 15, 30);
g.drawString (" visit my site!! ", 15, 40);
}
}
then convert to html the BlogApplet.java

its all done! and now the explanations and discussions
i think let's go on the next post--->




Tuesday, September 15, 2009

JAVA - First lesson in 2nd Tri



Hi! its another blog! YAHOO!
the first Topic is:
JAVA
Its a programming language that we're going to used for us to made programs all over the computer world, it is only one of the many tools that can be used, but this is the most widespread.
according to WIKIPEDIA
The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities.

according to JAVA website
Java powers more than 4.5 billion devices including:
  • 800+ million PCs
  • 2.1 billion mobile phones and other handheld devices (source: Ovum)
  • 3.5 billion smart cards
  • Set-top boxes, printers, Web cams, games, car navigation systems, lottery terminals, medical devices, parking payment stations, and more.
// from PCs to mobile phones, smart cards etc. really java have many importance and we'll learn it as we goon;-)

Then in the class we talked about:
(WELCOME TO PILIPINO ZONE)
for me as what ive understand ito yung format in doing JAVA source code.
begin tayo sa ex: Print out "hello world"
gawa muna tayo ng flow chart(<-?) for us to analyze ung proble

for our problem
this is our FlowChart -->
(hope you can understand, its too small and rush*-*)
Have a look in our FC
  • START/END- have you seen it?, its is shape as rounded rectangle (you can also use circle, oval or oblong), this shape is used when we are going to start or end a program.
  • ARROWS- for us to understand kung saan na ba tayo papunta, tells what is the next step, first, second and so on. this are the arrows.
  • PARALLELOGRAM- Input/ Output, based sa problem given "kailangan nating mag output ng HELLO WORLD". since ang parallelogram represents I/O ito ung gagamitin nating shape..
  • END - the same as start.
//for more questions in Algorithms ask me through comments or read this ***

NOw, naanalyze na ung problem with the used of Flow chart, nlaman natin kung anu ung iaaouput, and now where going with the source code.

Public class HelloWorld //name of the class, starts w/ a CAPS letter, no spaces included, in case of 2 words CAPS the first letter of the second word and so on.
{
public static void main (string []args) //system used
{
system.out.println ("Hello World") //tells to print "hello world in the screen.
}
}

its done!, Hindi ko pa to natatry sa editor ng JAVA and I dont have any clue on how it looks like.
ito muna for now, hindi ko pa to masyadong alam... I need to feed my mind first..

ITECH dictionary
  • userdefine = defined/given/change by the user.
  • PDLC = Program Development Cycle
Save on MINd
  • Saving your program in JAVA should follow the name of your class followed by a .java extension name. EX. Public class Name save as Name.java *_*
"TECHNOLOGY is PROGRESSING every second, dont stop learning "