Skip to main content

Posts

Showing posts from 2014

Drasperry logo

Drasperry logo

I wonder at US!

It's real! I'll always get wonder at United States, on checking my blog viewers status. The guys from there alone make up 30% of total views on my all blogs. I think this is an effect. People from US explore the Internet tremendously. Due to the same reason most of the developers are concentrated to the same region. Cheap access to internet is one of the necessary conditions for building developers. Collages should be WiFi enabled. On the other side, one should be alive of the bad sections and effects of internet. And should keep away from it.

Java Program using constructors

Simple Java Program using constructors. Here the constructor is “Cars”. //constructors public class Cars                 {                 public Cars(String name)                                 {                                 System.out.println("super "+name);                                 }                 public static void main(String []args)                                 {                                 Cars bmw=new Cars("cars");                                 }                 } Click  here  for  instructions for executing  the program.

Java: Another Simple Example of Displaying a Text

This is a simple Java program to display a text: This program enable you to understand: How to declare variable. Structure. Output statement. public class BeingAwesome                 {                 public static void main(String []args)                                 {                                 System.out.println("*****#####*****===+++@@@@&^%$#@!+_)(*&{}|");                                 }                 } Click  here  for  instructions for executing  the program.

The Simplest Java Program! - Displaying a Text

This is a simple Java program to display a text: 'i=100'. This program enable you to understand: How to declare variable. Structure. Output statement. class Awesome {                 static int i;                 public static void main(String[] args)                 {                                 i=100;                                 System.out.println("i="+i);                 } } Click  here  for instructions for executing the program.

Instructions for Executing the Java Program.

If you don't have JDK in your system, then first you need to download and install Java Development Kit. Instructions to DOWNLOAD and INSTALL JDK. Instructions for Executing the Java Program. Locate the class in which the main() function is present. Save the program in the name of the class with an extension (* .java ). In this example the progm should be saved as ‘ Test.java ’. Open the cmd [Command Prompt] and set the address of the saved progm. Type ‘javac < file_name >’ –enter. [e.g.: javac Test.java] If any errors are there, that will be displayed here. After correcting all the errors, Save the progm again and compile. Now type ‘java <file_name_without_extention>’ [e.g.: java Test ]. Your program is now executed.

Simple Java Program That Display a Text

This is a simple java program that display a text (“I’m Vajahath” here). class Test {                 public static void main(String []args)                 {                                 System.out.println(“wow! It’s working..!”);                 } } Click here for instructions for executing the program.

Procedure for testing your JDK Installation

Test Your JDK Open Command Prompt, type ‘ java ’ – enter. à If it is working, do the following tip. Try this program: Open Notepad and type the following codes: class Awe {                 public static void main(String []args)                 {                                 System.out.println(“wow! It’s working..!”);                 } } Save the file as “ Awe.java ”. Open Command Prompt and set the corresponding file address. Type ‘ javac Awe.java ’ –enter. (Now the code is compiled) Type ‘ java Awe ’ –enter. (Now the program is executed) If you are getting an output as “ wow! It’s working..! ”, then the installation is perfect. Click here for simple demonstration of java progs.

Procedure to install the Java Development Kit (JDK)

Simple Easy Steps for Installation of JDK Download JDK (latest version recommended) from  http://www.oracle.com/technetwork/java/javase/downloads/index.html  . Install it. Go to control panel . Then move to “ Control Panel\System and Security\System ”. Click “ Advanced System Settings ” in the margin. In the “ Advanced ” tab, click “ Environment variables ” button. Then in “ system variables ” area, select “ path ” and click “ edit ”. (Use with care)  (Windows 10 has a different interface, but similar). Separate the current content with a “ ; ” and include just right after that, the file address of the ‘ bin ’ file in java folder. See the example:  [Example: ….; C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\Windows Live\Shared; C:\Program Files\Java\jdk1.7.0_45\bin; ] Then ‘OK’.

Cpp Simple Program For Finding Average

F inding average is one of the simplest programs. Here we input 5 variables, then added together for ‘sum’ and the ‘sum’ is divided by the 5 to produce the average. The Program //program to find average. #include<iostream.h> #include<conio.h> void main() { int i,x,sum=0,avg; clrscr(); cout<<"Enter the 5 elements\n"; for(i=0;i<5;i++)                 {                 cin>>x;                 sum=sum+x;                 } avg=sum/5; cout<<"sum="<<sum; cout<<"avg="<<avg; getch(); } Run the program after compilation. If any problems: post at here...