Java Applet Program to Add Two Numbers

Java Applet Program to Add Two Numbers

To build an applet, first of all, we need to create an applet code(program_name.java file). After successful compilation, its corresponding( program_name.class) file is created. Then a web page also known as an HTML document(  ) is to be developed. Once the HTML document(.html) is created, the applet is to be inserted into it. Finally, the … Read more

Call by Value and Call by Reference in C

Call by Value and Call by Reference in C

Argument passing (change(a,b), change(x,y))is a technique for transferring data and information between the calling and called function. There are two ways to pass arguments to the called function: a)Call by Value b)Call by reference. Call by Value: The call by value method is the default technique for passing arguments. In this method only the copies … Read more

Armstrong Number in Java

Armstrong Number in Java

Program to Check Armstrong Number Armstrong number is that number which is of three  integer digits, which sum of the cube of its individual digits is equal to that number which we enter like 153, the cube of 1 and the cube of 5, and the cube of 3 and the sum of both (1*1*1)+(5*5*5)+(3*3*3)=153 … Read more

Draw a Chessboard in Java Applet

Draw a Chessboard in Java Applet

Java Program for Chess Game Each square(rectangle) in the chessboard is 20 pixels by 20 pixels. The squares are grey and black. If the row and column are either even or odd, then the color is Grey. Otherwise, change the color to Black. import java.awt.*; import java.applet.*; public class Checkerboarrd extends Applet {    public … Read more

Accessing Interface in Java

Accessing Interface in Java

The variables(int blue, int yellow, int pink) of an interface are always declared as final. Final variables are those variables, whose values are constants and can’t be modified(changed). The class that implements the interface will use the variables as declared within the interface and can’t modify( changed) the value of the variable. How to define … Read more

2D Array in Java

2D Array in Java

In Java, multidimensional arrays are also applied as arrays of arrays. 2D(two-dimension i.e tabular form) array is the generally used and simplest multi-dimensional array(like excel sheet(grids)). 2D arrays are represented in a row-columns([3][4]) form, and the terms “rows”[3]  and  “columns”[4] are used in computing. Syntax…. Declaration – Syntax:                Data_Type[][] Array_Name = new int[Row_Size][Cols_Size];       … Read more

What is DOS?

What is DOS

Disk Operating System (DOS command user interface) – it is a collection of special programs that supervise and control the operation of the personal computer.Functions of DOS: (a.) interprets and executes commands. (b.) manages the disks, files and directories. (c.) oversees and communicates with peripheral devices.Parts of DOS: A) DOS System Files – it consists … Read more

Calculator in C++

Calculator in C++

Calculator that performing as calculator which allows all Arithmetic Operators with operands as input #include<iostream.h> #include<stdlib.h> #include<conio.h> int calculator(int a,char c,int b) {     int h,w,x,z;     float y,m=0.0;     z=(a+b);     x=(a*b);     w=(a-b);     h=(a%b);     y=(a/b);     m=y;     switch(c)     {     case ‘+’:         cout<<a<<“+”<<b<<“=”<<z<<endl;         break;     case ‘-‘: … Read more

Count of Odd and even,sum of odd and even,average array program in C++

Count of Odd and even,sum of odd and even,average array program in C++

/* Fill up an array,print the array,count number of values,count the number of odd,count the number of even,sum  of odd ,sum of even,average,find largest value,find smallest */ #include<iostream.h> int fill_up(int array[],int size); void main() {     int array[10],size;     cout<<“Enter the size of an array:”<<endl;     cin>>size;     fill_up(array,size); } int fill_up(int array[],int size) {     … Read more