Armstrong Number in Java
Program to Check Armstrong Number Armstrong number is a number that is of three integer digits, whose sum of the cubes 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 … Read more
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
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(change) the value of the variable. How to define and … Read more
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?
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 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 the 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 … Read more
Structure of C++ Program
A program is a sequence of logical instructions that can be executed by a compiler in a computer. All programs are written to solve any problem using by programming language. The best way to learn a programming language starts from the root of that language. Therefore, here we will try to write our first program: … Read more
Access Modifiers in Java
ACCESS MODIFIERS IN JAVA……. An access modifier is a reserved keyword, or we can say visibility controls, which is used to restrict access. We can use these access modifiers to determine whether a field or method in a class can be called or used by another class or subclass or not. That means these access … Read more