Fun coding

Last week I had come across the ‘An hour coding’ on khan academy  and it helped me get back to coding. I had cread some cool drawings on the plateform and then I continued this using java how to program book and luckyly I had no work load in office since last couple of weeks so every thing was a favopur of coding for me. Today I did this coding and I really enjoy it when I see the output.:-D

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be “Main” only if the class is public. */
class arrayTest {
public static void main(String [] args){
 double[] myList= {12.0,6.5,7.5,5.0,2.5,10.0,20.0};
 for(int i =0; i<myList.length;i++){
  System.out.println(i + “:” + myList[i] );
 }
 double total = 0;
 for(int j= 0;j<myList.length; j++){
  total+=myList[j];
 // System.out.println(“Total is ” + total);
 }
 System.out.println(“Total is ” + total);
}
}

I hope this time it will continue.

Lastly I would like to recomment ideone for all those who want to do coding but don’t like or know how to install the compilors. This is really cool plateform to edit, compile and run your codes in any language.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s