Javascript

Hello, how are you doing? well i am fine indeed.In my last post we talk about an IDE, what is its definition, what is its used for, example for an IDE and more. We also use an IDE to make our MovingBall program, which is very cool and its very helpful for new coders. Now, we’re going to talk about JS or JavaScript, first i apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin.

(The history of Javascript, Javascript was created in 10 days in May 1995 by Brendan Eich, you know… that Javascript wasn’t the first name that is used for this language, first time it was mocha and  in September of 1995 the name was changed to LiveScript, then in December of the same year, upon receiving a trademark license from Sun, the name JavaScript was adopted. This was somekind of a marketing move at the time, and because that Java being very popular programming language around then.) 

Since we talk a lot about Java, Javascript feeling a little bit lonely, but now the time has come for us to know Javascript.First, what is Javascript? for the most simple explanation, javascript is a programming language, just like java. Now for the long explanation, my understanding of javascript is, “a high-level, untyped programming language that is widely used for major web browser“alongside with the HTML and CSS, it is one of the three core programming language that is used for the technologies of world wide web.

Now let me explain this little by little, first javascript is a high-level programming language just like Java so what does this means? a high-level programming language is a programming language that is more closer to human language and further from the machine language so this makes the coder jobs easier because it is using a  language that is more understandable by human brain. Next one is the “untyped“, what does untyped means? of course it doesn’t means that you don’t need to type it to the computer but it means that, not like Java… Javascript does not use typing for its language, perhaps the word typing is familiar to you, well I already told you in my previous post (Java Variables) that Java is a strongly typed language this means that any data needs to be stored in the right variables, like Integer for number, String for words, and double for numbers that contains decimal.Well javascript doesn’t use that kind of thing, it only uses one variable for all kind of data which is “var” variable, it is a    for variables, right? did you catch that before me? so that is what it means to be an untyped programming language.

Javascript is widely used by the web, because it is the only scripting language that is supported by every major web browser approved by  ECMA(Internet Explorer, Firefox, Chrome, Netscape, Safari, Opera, Camino, etc). Moving on to the next thing, why do I say HTML, CSS and Javascript is the three core for world wide web? just see that everything you see in this page in you browser is made by those 3 programming language, can you guess what language do what? if you don’t let me tell you, first… can you see text inside the pages you see (of course right? or maybe the text is readed to you) well the text that you see is made by the HTML language, HTML is used to make any kind of text, second… can you see color or text style in this page? well CSS is the one that made such a thing, CSS is used to style a page, and now…. do you see a scrollbar in your page?(if you didn’t see it in this page try to go to a page that contains a lot of text)can you scroll it up and down?of course, and that thing uses Javascript to make it, Javascript is used to render or animate things.

You see those three programming language to be the structure to make web pages. Without one of those programming language a web page would be boring and not interesting, so if you want to make a web page make sure that you have all those 3 programming language implemented in your web page.

Conclusions

  • Javascript is “a high-level, untyped programming language that is widely used for major web browser”.
  • HTML, CSS and Javascript are the three core of world wide web.
  • A high-level programming language is a programming language that is more closer to human language and further from the machine language.
  • Javascript only uses one variable for all kind of data which is “var” variable so its considered to be an untyped programming language.
  • Javascript is the only scripting language that is supported by every major web browser approved by  ECMA

What is an IDE ?

Hello, how are you doing? well i am fine indeed.In my last post we make our way to create a program which is called a MovingBall, which is a program that makes a ball moves accross the screen and it could bounce off the side of the program and that is very cool and to make that program we use an IDE the IDE is called netbeans. Now, we’re going to talk about IDE, first i apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin.

First, we need to know what an IDE is, and why is it created. well in my understanding, an IDE is a software application that provides the computer with facilities for computer programming or software development, it contains a code editor or a compiler that the user acces through a single GUI (graphical user interface). It is created for computer programmers and software developers because it has a compiler or code editor that helps coding syntax, what do I mean by help? well simply it could add a sugestion on what you’re going to type and this is very helpful for a beginner coder because we don’t need to search the internet or read books and do other complicated things, it will automatically add sugestion on what we’re suppose to type or what we want to type, an IDE will serves developing environment on one or multiple coding language.

You might ask, what is the functionality of an IDE? Just like I say before it has a compiler of code editor that helps coding syntax and there are many common features that is created in an IDE, such as debugging code or program and data structure browser etc… this is  very helpful for its user because it can make a user quickly execute an action without needing to go to another application so that help maximize the productivity of coding with the help of its GUI (graphical user interface) and UI (user interface).

what is an example of an IDE? there are 2 IDEs that i know, first one is Netbeans and the second one is Java Eclipse. each of them serves the developing environment with their own way but you’ll find it very similar in some way. if you want to check it out here is the link : Netbeans and Java Eclipse. You may try both of them at first, but as you feel more comfortable with an IDE you should choose one of them to avoid complicated problem when you switch from one to another ID, you should choose the one that you thinks more comfortable and you feel good with it.

here are 2 footages of both Netbeans and Java Eclipse:

Netbeans
Java Eclipse

  

 conclusions

  • an IDE is a software application that provides the computer with facilities for computer programming or software development, it contains a code editor or a compiler that the user acces through a single GUI (graphical user interface).
  • an IDE has a compiler or code editor that helps coding syntax.
  • an IDE will serves developing environment on one or multiple coding language.
  • common features in an IDE : debugging code or program and data structure browser etc…
  • an IDE makes a developer quickly execute an action without needing to go to another application so that help maximize the productivity of coding with the help of its GUI and UI.

Make a MovingBall in Java, Part 2

Hello, how are you doing? well i am fine indeed. Today we’re going to continue our exercise making a ball move in Java, well on the last post we manage to make a frame for the ball to move, today we’re going to make the ball “move”. before we begin, first i apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin!


So, first you need to have netbeans if you don’t you can download it here: Netbeans. and you need to install a minimum of JDK 1.7.0, you can download it here: JDK. If everything is set to go, now you open your netbeans. lets continue from our last post which is this:

Make a method that paints an object in the program
Paint method

now the most important thing on this program is to have a ball moving on the screen righ? because we’re making MovingBall program, so to make a ball moving on the screen we need to make a method, a method is a piece or a chunk of code that will execute when you call upon it, now you put ball.moveBall(); before the “ball.repaint();” the reason that we put ball. before the method because it’s for the ball object. at first it’s going to give you an error, you see that little lightbulb thing with red warning that means it is an error, why?? it’s because you haven’t created the method yet, what you did is you call the method without making it first, understand?? now let’s make the method, you need to write this :
public void moveBall()
{
       

} 

you write it before the paint method, and it should look like this:

now the most importand thing is to draw the ball, we need to draw the ball in a method, can you guess what method we should use to draw the ball? correct, the paint method. Now you might ask “why didn’t we use the moveBall method instead?” well the moveBall method is a method to make the ball “move” and not to draw the ball, instead paint method is a method to draw an object, since logically “paint”, duhh!.

here is the all the code you need to write to draw a ball : public class MovingBall extends JPanel{
   
    int x = 0;
    int y = 0;
   

    int diameter = 30;   

    public void moveBall()
    {
   
    }
   
    @Override
    public void paint(Graphics g)
    {
        super.paint(g);
       
        g.fillOval(x, y, diameter, diameter);
    }

 and when you run it is should look like this:

congratulations, you just draw a ball in a screen, cool!!.
now let me explain the steps that is needed to draw a ball like that.First we need to make a variable that contains the positions of the ball and the diameter of the ball, second we draw the ball.Now, I already explain what is variable in my other post, chek it out: Variables. Specifically we need to make an integer variable, for what you might ask, well it’s to determine the ball position.
“well why didn’t we determine the position with whole number when we draw the ball in this line  “g.fillOval(x, y, 30, 30);” ” you could use a whole number like 0, 1, or 2 to determine the position, but consider this, what program are you making? does the ball move or it doesn’t? if the ball moves we need to make a variable to store the position of the ball, because!! the position keeps changing automatically, there is no way you could do it without a variable that store the position of the ball. Now that the problem is settled, lets continue, now we need to make the ball move. Just like I say “the position keeps changing automatically”, we need to make the ball move on itself, the way to do is pretty easy its just two line of code which is:     int x = 0;
    int y = 0;
    int diameter = 30;


    public void moveBall()
    {
        x++;//this line
        y++;
//and this line

    }
   
    @Override
    public void paint(Graphics g)
    {
        super.paint(g);
       
        g.fillOval(x, y, diameter, diameter);
    }

can’t do images because the ball wouldn’t move, lol.

then you run it! well done *clap, clap* you just make a ball move! great right? now there is one problem, can you tell? the ball move through the side of the program! Grrahhh. we really really need to fix this problem!. now we need to create a barier, we write this in the code. We somehow need to calculate, when the ball hit a side of the program it should come back with different velocity. we can do it like this:  int x = 0;
    int y = 0;
  
    int diameter = 30;
  
    boolean moveDown = true;
//if we didn’t create this the ball will never bounce back because the
                                                  previous velocity will still be applied
     boolean moveRight = true;//if we didn’t create this the ball will never bounce back because the
                                                   previous velocity will still be applied
  
    public void moveBall()
    {
        if(x == getWidth() – diameter)
        {

              moveRight = false;  //if the x of the ball hit the right side of the program then moveRight
                                                 is false this will make it move to the left
        }
        else if(y == getHeight() – diameter)
        {
              moveDown = false;
//if the y of the ball hit the right side of the program then moveDown
                                                 is false this will make it move Up
        }

        }
      
        if(x == 0)
        {
        
          moveRight = true; 
//it’s just the same with the one above but it’s flipped to it’s original situation

        }
        else if(y == 0)
        {
              moveDown = true; 
//it’s just the same with the one above but it’s flipped to it’s original situation 
        }
      
        if(moveDown)
        {
         y++;
//this situation is if moveDown is true, then, y position will be moved 1 pixels each frame/time;
        }
        else if(!moveDown)
        {
         y–;
//this situation is if moveDown is false, then, y position will be moved1 pixels backwards each
                  frame/time
        }
      
        if(moveRight)
        {
         x++; 
//this situation is if moveRight is true, then, x position will be moved 1 pixels each frame/time; 
        }
        else if(!moveRight)
        {
         x–;
//this situation is if moveRight is false, then, x position will be moved 1 pixels backwards each
                 frame/time
 }

    }

after you write that on you program codes, you run ! BOOM!! you have a fully working moving, bouncing ball program in Java, congrats!.
After this exercise I hope you will get more comfortable and will more understand the Java world of Coding We have finished our exercise, so see you in another post!.

See part 1

Make a MovingBall in Java, Part 1

Hello, how are you doing? well i am fine of course!. Now lets get to the fun part of Coding, making a Program, now we’re going to make a moving ball in java. I know that program like that is small and doesn’t contain anything much spesial but we need to get an exercise at Coding. For this “tutorial” i will tell you step by step on how to make a ball moving in your program, now I will use netbeans for the IDE. Does netbeans and IDE sound familliar for you? maybe some of you are, but for you who don’t netbeans is an IDE, an IDE is a development environment for programming, we talk about it in my last post which is Coding Syntax. first if there is any mistake i apologize and any knowledge or help would be nice. now forget the chit-chat and lets begin!


So, first you need to have netbeans if you don’t you can download it here: Netbeans. and you need to install a minimum of JDK 1.7.0, you can download it here: JDK. If everything is set to go, now you open your netbeans, after you open netbans it should look like this :
and because you don’t have any project yet you will have empty netbeans like this.                              

netbeans without any projects or empty netbeans
The netbeans appearance

after you open it you need to make a new project, which is a java project the way to open it is you click “file->New Project” after that you choose the folder “Java” and choose “Java Application” after that click next and now there will be a box that you need to fill, now you fill it with your project name, I will use “Moving Ball” you can name it whatever you want, the project location and the project folder.
After you fill that box you click finish and it should look like this :

empty project whitout any extra code
Netbeans with project inside it

Now we code! first we need to make the programe frame, it’s called JFrame because it creates the program frame. We type this code in the                                                   public static void main(String[] args)
{

}
you write a code like this:
 JFrame jframe = new JFrame(“moveBall”);
you can name it whatever you want inside the (“”) I’m going to use moveBall. And now you need to import it, if you see a little lightbuld click it and an option should apear and you should choose the “add import for javax.swing.JFrame”

import the JFrame by clicking the Add import for javax.swing.JFrame
Import JFrame

After we create the frame now we set the properties of the frame like, size, visibility and default close operations and we also need to make a ball object from MovingBall but it’s not going to contain anything yet, so it should be like this:
        jframe.setSize(500, 500);
        jframe.setVisible(true);
        jframe.setDefaultCloseOperation(jframe.EXIT_ON_CLOSE);

        MovingBall ball = new MovingBall();
  
after you type those codes you can run the program by clicking “run->run project (MovingBall)” or you could just press “f6”. the program should run and a frame should pop up like this:

An empty program window with 500 by 500 size
Program Window

well it’s empty but now we’ll write the real program codes, now we need to extends the MovingBall class to a JPanel. After we extends the MovingBall class to a JPanel next we need to make a function that draw the objects and a while loop that keeps repainting the object and background no matter what, wel also write a thread and sleep for 10 ms and many other things and we write it like this:
public class MovingBall extends JPanel{
    public void paint(Graphics g)
    {
        super.paint(g);
    } 

    public static void main(String[] args) throws InterruptedException {
    JFrame jframe = new JFrame(“moveBall”);
      
        jframe.setSize(500, 500);
        jframe.setVisible(true);
        jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      
        MovingBall ball = new MovingBall();

        jframe.add(ball);
      
        while(true)
        {
            ball.repaint();

            thread.sleep
        }

    }

Make a method that paints an object in the program
Paint method

 and you need to import the “Graphics” just like you import JFrame the only thing different is you need to choose the option “add import for java.awt.Graphics”.
Now in the next part well create the method to make the ball “Move” and finish our program.

see part 2

Coding Algorithm

Hello, how are you? i’m well fine in this sunday, first i apologize if there is any mistake any help or knowledge would be nice. From our last journey in the world of Coding syntax we take a little peak about syntax and it’s example we learn that variables are also part of the Coding syntax, and we also have IDEs that help us to start coding easily with it’s sytax helper. Now we’re about to talk the #3 thing which is the algorithm of Coding.

Have any of you here has heard about algorithm? if yes, give comment about how you define algorithm yourself. In the real world we do stuff like cycling to home, eating a cheese bread, travelling  etc… do you know or do you realise that what you’re doing does contain algorithm in it? well maybe some of you does realise, but for you that don’t here is my explanation,
algorithm is a set of steps or any problem solving to accomplish somekind of task.

Now let’s get back to one of our life routines, the cycling routines, cycling does contain algorithm in it can you guess how? here is how:

  1. get a bicycle
  2. start cycling
  3. cycle along the road that you know (or if you have a map than this is only optional)
  4. arrive at home

those 4 step for cycling to home is an algorithm, how? algorithm  is a set of steps to accomplish a task well those 4 are the steps to accomplish the task, we could make question to determine whether it is an algorithm or not. 1st what is the task? cycling to home, 2nd what is the steps? those 4 steps above. Now how do you feel, do you get more comfortable at algorithm or more confused? I hope you get more comfortable in this.

Well in Coding, it’s just the same but with a little change, here how it goes: algorithm in Coding or programming is a set of steps or any problem solving for a computer program to accomplish somekind of task. You see, it has the same definition ( without the “computer program” sentence), easy right? algorithm also puts the “Science” in “Computer Science” because it is rather considered science in computer. Now let’s make one of our own algorithm in solving something in Coding, let’s say that we want to make a game, what would be the algorithm, let’s just make it like this :

  1. create a name for the game = pong
  2. gather the idea for the game
  3. start writing codes
  4. (if there is an error in the codes, bonus algorithym) :
    1. find out what is the error
    2. find out the way to fix the error
    3. fix the error

  5. finish game and start playing or sell it 

Just like the cycling, we have task the steps and the problem solving, so we can say it’s an algorithm

    There are often many other different ways for a computer program algorithm to accomplish a task, each of the algorithm has an advantages and disadvantages to solve a problem. One of the most used algoritm is Sorting, you might wonder what is Sorting? here is a quick definition of Sorting in the wikipedia

    Sorting is any process of arranging items systematically, and has two common, yet distinct meanings:

    1. ordering: arranging items in a sequence ordered by some criterion;
    2. categorizing: grouping items with similar properties. “

    those definition is obtained from wikipedia

      Now i’m going to tell you 4 types of Sorting:

      • Bin sort
      • Merge sort
      • Bubble sort
      • Shell sort
      • Quicksort

      Now just imagine that you have 1.5 million integer between 1 and 15 and you need to sort those integer, well the right sorting algorithm to use is Bin sort, if you would have 2 million book titles for the best algorithms it goes with the Quicksort.

      Conclusion 

      • algorithm is a set of steps or any problem solving to accomplish somekind of task.
      • algorithm in Coding or programming is a set of steps or any problem solving for a computer program to accomplish somekind of task
      • example of algorithm: Sorting
      • 5 example of sorting:

        • Bin sort
        • Merge sort
        • Bubble sort
        • Shell sort
        • Quicksort

      Give comment, help you and me grow our knowledge together. Tips, Help and Knowledge would really be appreciated. Thank you, see you on another Article.

      ­čśÇ

      Coding Syntax

      Hello, how are you? i’m well fine in this saturday, first i apologize if there is any mistake any help or knowledge would be nice. Resuming from my last article, last time we talk about Coding Variables, specifically Java Variables what a discussion we had last time eih?. Now, on this brightful day we will continue our discussion or talk for the #2 thing which is Coding Syntax. On the next article we’ll have a talk about Coding or Programming Algorithm.

      Ok, does any of you recognize the word “Syntax”? well maybe some of you already know Syntax, which is the arrangement of words and phrases to create well-formed sentences in a language. It’s a good answer but we need to more specify it a little bit, in computer science Sytax always refers to the grammar and spelling of a Programming or Coding language, now I have gathered information and make a conclusion that Syntax is:
      Syntax of programming language are the set of rules that define the combination of symbols in an exact form that the computer expects and considered to be correctly structured programs in that language itself . The expected form is called Syntax (in Computer Science, don’t get confused with general syntax).

      In the definition above you’ll see some sentence like “correctly structured” and “symbol“, what does this means? let’s say it that syntax is a certain layout of words and symbols. for example, if you want to acces a certain web page what would you type in the address bar? let’s pretend that you type , www.webhostingallinone.com what would make you so sure that what you type would go to a web page instead to an email address? it’s because of the “www“(that stands for world wide web) and followed by a website domain “webhostingallinone.com” and because it is considered to be correctly structured to the internet and to a web. Well in programming language it’s just the same, there are rules that are set in place when you obey them you will make some kind of functioning program, but beware if you don’t follow the rules and placement, xO error pops up.

      So, what about an example of a Syntax, well what about we use our last discussion as the base. In our last talk we make this Variable: 
      int first_number = 10;
      There are 4 parts of Syntax that needs to be explained here. First, the int, this part stands for the Integer type of variable, remember the String, Integer and Double we talk last time? Integer are suppose to contain whole number, nothing else. Second, the first_number, this part stands for the name of the variable, a variable name could use word and numbers but the only special character it could contain is ( _ ) an underscores, usually in the Java world variable name front letter are lowercase letter, well they don’t have to but that is usually the kind of accepted and sugested convention(in Java world). Third, value 10″ (don’t mind the quotes), this part of the sytax is use to place the value of the variable, since the variable is int then you can only use whole number only. Then, the last part of the Syntax the “;” a semicolon this special characters will always be at a Syntax, because it is the thing that mark some particular segment is complete for the computer to process. There are exception for what I said that semicolon will always be at a Syntax, that is controle structures they uses curly brackets to make the beginning and the end of a segment. Just imagine coding semicolon as a normal period writing, if we don’t put any period the writing will not be structured and will not be easy to read.

      When you enter the coding or programming world, you will likely see syntax as one of the biggest battle to master. But, as you see more and more code and introduced to more and more syntax you will get yourself finally comfortable, but this will not be a short journey it will take a step at a time. Well there is a great great good new for the people that see sytax tough, and for so a goe companies (group of enthusiasts, a.k.a nerd or noob (no offense i’m a noob too but slightly improved)). There is hope for us, now companies have made a tools to do sytax thing in coding, those tools are called IDEs or, Integrated Development Environments, which you can download onto your computer most are free like the Java Eclipse and Netbeans I mention in the last post, you can use it to create programs. ┬áThese IDEs have built in syntax checkers (much like the grammar checker in MS Word) that will let you know if your syntax is incorrect or correct, and will even give you hints with what it thinks you meant to put!.

      Conclusion 

        • ┬áSyntax is a structured combination of word or symbols

        • ┬áVariable example are Syntax example

        • ┬áSemicolon ended a segment except control structure

      Give comment, help you and me grow our knowledge together. Tips, Help and Knowledge would really be appreciated. Thank you, see you on another Article.

      ­čśÇ

      Java Variables

      Hello, how are you doing? well i am very fine indeed in this fresh morning, first i want to tell you that i’m not the master of Coding because i’m still learning, excuse me if I made mistakes so any helpful knowledge would help. Now we’re going to talk about the base of Programming or Coding, specifically in Java. Program or Codes are based out of Variables, Syntax, Algorithm, etc.. (well that is more or less).

      Now i’m going to explain the #1 which is Variables.

      Variable

      Variable are a symbolic name that contains or store information that are going to be referenced and used by the programs, The variable name usually represents what the variable contains. In Java there are 3 types of variable, that is: String, Integer and Double variable, These 3 variable uses different name because it contains different types of Data. The simple explanation is, if you wanna store your name in a variable, the type of variable you use is String. Or, maybe you wanna store you age in the variable, in that case you use Integer. Or even you wanna store how much money you make in a month, that type of data is stored as a Double. Don’t get confused here, you might ask, Why the heck does Java uses three variables instead of just one.Well, good question there, Java is a Strongly Typed Languange. Which means that Typing in Java will be absolute certainity that the information you stored in the variables are in a “certain way”.. so it will be very specific, it will give you error if the stored information does not match the type it suppose to be.

      String variable

      Just like I say before, if you wanna store your name in a variable which is a String, the informations that is stored would be like this, “Rafif Santika”, a String would make any data treated like an old plain English languange, a String would represents data as a Words (or specifically a Letter). It may come in your life as a programmer, that you would add two sentences or two Strings together. So, what does it means to add two sentences or two Strings together? You see, if you have 2 Strings variable, one of them contains the data “42” and the other one “3”, if you add them together what would you get? if you say “45” , then Great!!.

      You’re Wrong!. Remember when I say “a String would make any data treated like an old plain English languange”, it happens to any data that is stored whether it’s a word or a letter or even a number, so the right anwer is “423”. Just imagine if the two Strings contains “Hello” and “World!”

      what would happen to them if we add two of them? hopefully your natural instinct would say “Hello World!”(Haha!). The same thing happen to “42” and “3”.. Java behaves or treats the data differently because the different Type of variable.

      Integer variable

      Moving on to the Integer. Last time we say that if you want to store you age in a variable we use Integer, well that is because, Integer must contains data that is a number that doesn’t contain decimal in it, it would be a whole number like, 4 and 2 and 20 and 3 (that is a secret code about me, can you guess what those number means?) or maybe -4 and -1 and -20 and -3 (that is also a secret code), alll of the number I said up there, it all considered by Java as an Integer. So you need Integer variable to store them, so if you add an Integer to another like this: 42 + 3 it will make a result of 45 (not like how the String works) so if you do this:

      (This will be written in Java languange, you could write this in Java Eclipse or Netbeans)

      public static void main(String[] args) {

      int first_number, second_number, answer; /*first we started with empty Variable*/

      first_number = 10; /*then we fill the Variable*/
      second_number = 15; /*then we fill the Variable*/
      answer = first_number + second_number ; /*last we calculate them*/

      System.out.println(“Addition Total = ” + answer ); /*then we output them to the world*/

      }

      The output result should be

      Addition Total = 25;

      if your output result is like that, Then you have Suceeded.

      Double variable

      Last thing, the Double variable. like we also say upthere, if you want to store how much money you make in a month, you uses the Double variable. Let’s just say you make $35.5 a month (it’s just an example) and you want to put it in your Code or Program, well you must know that you need to put it into somekind of variable right? what would you do? and then you wonder “let’s try and put it into the Integer variable” and you put it into the Integer variable, Great!! it’s Wrong!! you’ll get an error then you say “what is wrong? i put it into a variable, i mean it contains numbers right? and Integer are suppose to deal with number” well you’re right about one thing, Integer contains number data, But!! it has to be a specific whole number like 1,2,3… and it cannot contain another kind of data, well it’s right that there is a number you put that, but it contains another data type which is a $(dollar sign) and it contains decimal with two digits of accuracy. “then what am i suppose to do??” well you put it in a Double variable. for example(you could also write this in Java Eclipse and Netbeans) :

      public static void main(String[] args) {

      double first_number, second_number, answer; /*first we started with empty Variable*/

      first_number = 20.5; /*then we fill the Variable*/
      second_number = 20.8; /*then we fill the Variable*/
      answer = first_number + second_number ; /*last we calculate them*/

      System.out.println(“Addition Total = ” + answer ); /*then we output them to the world*/

      }

      The output result should be

      Addition Total = 41.3;

      if your output result is like that, Then you have Suceeded at double variable.

      Conclusion

      • Java is a Strongly Typed Languange
      • There are 3 types of Java variables
      • Store your name in a String variable (store any word or letter)
      • Store your age in an Integer variable (store any kind of whole number)
      • Store how much money you have in Double variable (store any kind of special number, like decimal, or any symbols like $)

      Give comment, help you and me grow our knowledge together. Tips, Counsel and Knowledge would really be appreciated. Thank you, see you on another Article.

      ­čśÇ

      Experience and Steps to Begin Coding

       Morning!, Afternoon!, Evening! depending on when you read this post. You see, there is plenty ways or place for you to learn about code stuff, when I say plenty I mean A lot! A lot!. Now i’m going to tell you a story about how I  get myself to the world of Coding or Computer Programming.

      It all started in the late 2014, at that time I was at grade 5. It was a suny day, I was playing games at my laptop just like a typical gaming kid, enjoying the one day holiday i had. Then my dad gave me one game that was created by my dad’s friend, it was a simple bug shooting airplane game which was a lot of fun, I even made a review for it on Youtube. Back to the topic, Fortunately my dad and my dad’s friend was a programmer so he (My dad) said to me “Hey, you like playing that game. Well you can make one too!” since that time I got my atention to programming or coding, so I started wondering “How, how can i make games?”. Not long after that my question is answered, my dad gave me a book Called “Javascript for kids” well it was appropriate for a kid of my age.

      That book was a book teaching basic to adept Javascript for kids or even average adults, it has 3 parts and 17 chapters, it begins with simple coding like 2 + 2 = 4 and something like that, as you move through the book chapters it gets more and more complex coding. So, I started learning every single thing that was written in the book, at the first I had some trouble with the algorithym and the syntax but as the Chapters move I also began to Level Up I could say, my syntax, my algorithym and my knowledge grows more and more. I learn how to make basic simple games of treasure map until I finally get to make Snake game, remember that game ohh what a classic game. I finally finish making the game and as I finish making it, I also finish my Learning on that book. It took me about 6 months to finish that book and as I finish my book I also get to the next grade which is grade 6.

      After that, I started my research on Coding. I watch videos about it, I read programmers biography and one of the biography I read is Bill Gates, the founder of  Microsoft.
      Here is one of the video i watch on Youtube that was made by Code.org

       
      Video on Youtube by Code.org

       That video make my spirit even higher. You see, in that video they say “You don’t need to be a genius to write codes!” So there is an equal chance for everyone to learn code and SUCEED, it just depends on your passion and your desire. After that I started to take learning on Code.org (By the way it’s free for everyone) taking my skill to a higher level, in Code.org I start learning on the Hour of code it’s very unique type of  learning that i never see before, it even had courses for 3rd grade, wait it might be 2nd grade. In Code.org I learn so much, much more at that time. My knowledge improve, my syntax improve and my algorithym is improved.

      But, I learn at Code.org for not too long it’s about 3 month and I didn’t finish the learnings (Don’t you do that OK!) So, yea I quit it but not because any unreasonable things, it’s because I found another place to learn Coding or Programming, I found Khanacademy.org, Khanacademy doesn’t just contains coding but it contains everything else from math to history. I prefer Khanacademy more because, it has Coding Interface that makes you really are writing it yourself, at Khanacademy I learn Javascript, HTML and CSS Well mostly I learn Javascript, but the other 2 code are just to make my knowledge grow plus its a basic need in the world of Coding, like to make web page and stuff like that. And just like before I Level Up once more, it makes me get used to write code. I have made a couple of game at Khanacademy, wait, no it’s actually about 1. Now let me tell you, if  you’re ever stuck about anything in there, you have plenty of nice people you can ask about the problem solving.

       It takes me about a year now, to learn at KA and yet I still need to learn more because I need to master it. So, until now at grade 7 I still learn at KA, but!! besides learning at KA now I learn much more complicated coding at JAVA, i’m using Java EE Eclipse to write my code. Because I want to focus on making game, so I watch videos on Youtube on how to make games in java, now i am writing PONG games which is halfly done, and I will finished it and makes improvements soon.

      So, that’s my story about how I get to the world of Coding. Well maybe our experience and our story is different, but we have one similarity, we LEARN. Everything that I metioned up there is about how I learn, learn and learn!. Well learning on how to code will not be just a moment or two, it takes a lot of hour until you mastered it, so I am very grateful that i learn coding since I was just a boy so I can have a lot of times to Learn. That’s all of the story that I can tell you, hope you get something from our talk, and I recommend that you check the book and those 2 places. But in the end you need to pick one.Bye and see you next time!

      Do you have any other experiences? Give comment and share it with other people!

      Introduction

      Helloo, This is my first article for this blog, in this blog i will discuss about Coding, especially Java and Javascript. Inside this blog, I will write about Coding in the technic nor theory. The purpose of this blog is to improve yours and my Coding skills, we learn together.

      I hope this first article could tell you how I plan for the future of this blog and improve my coding skills because i’m still learning too. I hope throughout this blog I could give people knowledge and I hope through every single post I could be better and better.