JAVA

CLASS ROOM

JAVAClass Room

Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that compiled contests Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. As of 2015, Java is one of the most popular programming languages in use, particularly for client-server web applications, with a reported 9 million developers. Java was originally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them. Java can be hard to deal with for some students, so sometimes they turn to assignmentholic.co.uk homework help service for assistance.

The Upside to Contests

Many of the ideas above are contests and naturally, contests should have prizes. These contests provide cash and other type of prizes to the winners. Numerous contests may also be incorporated into your celebration.

The original and reference implementation Java compilers, virtual machines, and class libraries were originally released by Sun under proprietary licences. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java (bytecode compiler), GNU Classpath (standard libraries), and IcedTea-Web (browser plugin for applets).

import java.util.Random;

public class Array {

public static int average(int[] array)

{

int avg=0,sum=0,num=0;

for(int i=0;i<array.length;i++)

{

sum=sum+array[i];

System.out.println(array[i]);

num++;

}

avg=sum/num;

return avg;

}

public static double average(double[] array)

{

int num=0;

double avg=0,sum=0;

for(int i=0;i<array.length;i++)

{

sum=sum+array[i];

String str = String.format("%.02f", array[i]);

System.out.println(str);

num++;

}

avg=sum/num;

return avg;

}

public static void main(String[] args)

{

Random r=new Random();

int[] array=new int[10];

double[] a=new double[10];

for(int i=0;i<array.length;i++)

{

array[i]=r.nextInt(100);

}

for(int i=0;i<a.length;i++)

{

a[i]=r.nextDouble()*51.0;

}

Array arr=new Array();

int avg1=arr.average(array);

System.out.println("Average is: "+avg1);

double avg2=arr.average(a);

String str = String.format("%.02f", avg2);

System.out.println("Average is: "+str);

}

}

package JavaClassRoom.com;

import java.util.Scanner;

public class WorkerSalary {

public static void main(String[] args)

{

int no_of_Workers;

double salary=0,x,total=0,below=0;

Scanner in=new Scanner(System.in);

System.out.println("Please enter nuber of workers?");

no_of_Workers=in.nextInt();

double[] hours=new double[no_of_Workers];

System.out.println("Please enter the salary below 8 hours:");

below=in.nextDouble();

for(int i=0;i<no_of_Workers;i++)

{

System.out.println("Please enter Wroker "+(i+1)+"'s Working hours:");

hours[i]=in.nextDouble();

if(hours[i]<=8)

{

salary=hours[i]*below;

}

else if(hours[i]>8)

{

x=hours[i]-8;

salary=(x*9.0)+(hours[i]-x)*below;

}

total +=salary;

System.out.println("Worker "+(i+1)+"'s salary is:"+salary);

}

System.out.println("The total salary for the "+no_of_Workers+"workers is:"+total);