Computer Project
Computer Project
PROJECT
NAME:THIRUMURUGA
N CLASS: IX C
CODE 1 :
AIM :
To write a program to display the color of the spectrum
(VIBGYOR) according to the user's choice.
CODE:
import java.util.Scanner;
}
}
OUTPUT:
CODE 2 :
AIM:
Write a program in Java to compute the perimeter and area of a
triangle.
CODE:
import java.util.Scanner;
}
}
OUTPUT:
CODE 3 :
AIM:
Write a menu driven program to accept a number and check and display
whether it is a an Automorphic Number or not.
CODE:
import java.util.Scanner;
switch (choice) {
case 1:
// Accept the number from the user to check if it is
Automorphic
System.out.print("Enter a number to check if it is
Automorphic: ");
int number = scanner.nextInt();
case 2:
System.out.println("Exiting the program.");
break;
default:
System.out.println("Invalid choice. Please try again.");
}
} while (choice != 2); // Continue the loop until the user selects
option 2 to exit
// Check if the last digits of the square are the same as the number
return num == lastDigits;
}
}
OUTPUT:
CODE 4 :
AIM:
Write a program to input a number N and print the table of N up to 10.
CODE:
import java.util.Scanner;
}
}
OUTPUT:
CODE 5 :
AIM:
Write a program to input a number and check and print whether it is a
Pronic number or not. (Pronic number is a number which is the product of
two consecutive integers.)
CODE:
}
}
OUTPUT: