Report File
Report File
Teacher Principal
Table of contents
1. Introduction to Java
2. Applications of Java
3. Some simple programs
4. Programs based on mathematics
5. Input based programs
6. Real life application type programs
7. Conclusion
8. Bibliography
9. Source Code
Introduction to Java
Java is a high-level, class-based, object-
oriented programming language that is
designed to have as few implementation
dependencies as possible. It is a general-
purpose programming language intended to
let programmers write once, run anywhere
(WORA), meaning that compiled Java code
can run on all platforms that support Java
without the need to recompile.
Applications of Java
Java is used everywhere. In phones, IoT
Applications, Operating Systems, etc.
Some of the examples are given below:
Android Operating System
Minecraft
Samsung Key Pad Phones
Websites Using Java
There are several games which are also
made using java.
Star_Pattern_1.java
public class Star_Pattern_1 {
public static void main(String args[]) {
//i for rows and j for columns
//row denotes the number of rows you want to print
int i, j, row = 6;
//outer loop for rows
for (i = 0; i < row; i++) {
//inner loop for columns
for (j = 0; j <= i; j++) {
//prints stars
System.out.print("* ");
}
//throws the cursor in a new line after printing each line
System.out.println();
}
}
}
Star_Pattern_2.java
public class Star_Pattern_2 {
public static void main(String args[]) {
//i for rows and j for columns
//row denotes the number of rows you want to print
int i, j, row = 6;
//Outer loop work for rows
for (i = 0; i < row; i++) {
//inner loop work for space
for (j = 2 * (row - i); j >= 0; j--) {
//prints space between two stars
System.out.print(" ");
}
//inner loop for columns
for (j = 0; j <= i; j++) {
//prints star
System.out.print("* ");
}
//throws the cursor in a new line after printing each line
System.out.println();
}
}
}
Pyramid.java
public class Pyramid {
public static void main(String args[]) {
//i for rows and j for columns
//row denotes the number of rows you want to print
int i, j, row = 6;
//Outer loop work for rows
for (i = 0; i < row; i++) {
//inner loop work for space
for (j = row - i; j > 1; j--) {
//prints space between two stars
System.out.print(" ");
}
//inner loop for columns
for (j = 0; j <= i; j++) {
//prints star
System.out.print("* ");
}
//throws the cursor in a new line after printing each line
System.out.println();
}
}
}
Quiz_App.java
import java.util.Scanner;
Area_cube_cuboid.java
public class Area_cube_cuboid {
public static void main(String[] args) {
int h = 3;
int l = 2;
int b = 4;
int cube = l * b * h;
System.out.println(cube);
int cuboid = (2*(l + b)) + (2*(l + h)) + (2*(b + h));
System.out.println(cuboid);
}
}
Currency_Convert.java
public class Currency_Convert {
public static void main(String[] args) {
// Amount in Indian Rupees
double inr = 2;
// Conversion rate from INR to USD (assuming 1 INR = 0.012 USD for example)
double conversionRate = 0.012;