Computer Project 1
Computer Project 1
Acknowledgement
I would like to express my sincere gratitude to my Computer Science teacher, [Teacher's
Name], for guiding me throughout this project. Their valuable suggestions and
encouragement helped me complete this project successfully. I would also like to thank my
parents and friends for their support and motivation during this work.
Conclusion
This project helped me understand important programming concepts in Java, such as loops,
conditional statements, recursion, and object-oriented programming. It enhanced my
problem-solving skills and taught me the importance of designing algorithms before coding.
I am confident that this experience will benefit me in my future endeavors.
Programs
class NumberType {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter an integer: ");
int num = sc.nextInt();
int sum = 0;
if (sum == num) {
System.out.println(num + " is a Perfect Number.");
} else if (sum > num) {
System.out.println(num + " is an Abundant Number.");
} else {
System.out.println(num + " is a Deficient Number.");
}
}
}
3. Print Pattern
class Pattern {
public static void main(String[] args) {
int n = 4;
4. Sum of Series
class SeriesSum {
public static void main(String[] args) {
int totalSum = 0;
class MenuDriven {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("1. Check BUZZ Number");
System.out.println("2. Find GCD");
System.out.print("Enter choice: ");
int choice = sc.nextInt();
if (choice == 1) {
System.out.print("Enter a number: ");
int num = sc.nextInt();
if (num % 10 == 7 || num % 7 == 0) {
System.out.println(num + " is a BUZZ Number.");
} else {
System.out.println(num + " is not a BUZZ Number.");
}
} else if (choice == 2) {
System.out.print("Enter two numbers: ");
int a = sc.nextInt();
int b = sc.nextInt();
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}