COMPUTER SCIENCE PROJECT
REPORT
Java Programming & Object-Oriented System Design
Subject: Computer Science (Java & OOPs)
Date of Submission: 30.07.2026
Name of the Student: [Your Name]
Roll Number: [Your Roll Number]
Class / Section: [Your Class / Section]
Institution Name: [Your School / College Name]
Academic Session: 2026 - 2027
Computer Science Project (Java & OOPs) Page 1
1. Acknowledgement
I would like to express my sincere gratitude to my Computer Science teacher, [Teacher's Name], as well as
our respected Principal, for providing me with the wonderful opportunity to work on this comprehensive Java
programming project.
This project has helped me immensely in strengthening my understanding of Object-Oriented Programming
(OOP) principles, algorithmic design, structural data validations, and advanced matrix manipulation strategies
within the Java ecosystem.
I am also thankful to my parents and peers who supported me in compiling this project file and ensuring its
precise technical accuracy within the stipulated layout deadline.
Student's Full Signature
Date: 30.07.2026
Computer Science Project (Java & OOPs) Page 2
2. Index / Table of Contents
Program
Program Description / Objective Page Status
No.
— Introduction to OOPs and Java Verified
— Advantages and Disadvantages of OOPs Verified
— Hardware and Software Configuration Verified
1 Multi-Sequence Series Generator (Lower/Upper Limit Steps) Verified
2 Custom n-th Root Evaluator without Library Methods Verified
3 Dynamic Prime-Linked Sequence Evaluator Verified
4 Advanced Physics Quantity Overloaded Calculator Verified
5 Financial Compound Interest & Tax Tracker with Senior Rebate Verified
6 Numerical Time-to-Words Structural Converter Verified
7 Composite Magic Number Range Scanner Verified
8 Frequency-Based Collection Sorting with Sequence Preservation Verified
9 Conditional Digit Presence Mapper & Transformer Verified
10 Dual-Sentence Analytical Paragraph Encryptor & Palindrome Parser Verified
11 Non-Tribonacci Collection Extractor & Pyramidal Pattern Vector Verified
12 Inline Multi-Digit Implicit Armstrong Matrix Synthesizer Verified
13 Layer-wise Ring Rotator & Diagonal Analysis Transformer Verified
14 Multi-Base Conversional System Matrix Analyzer Verified
15 Anagrammatic Numerical Word-Digit Combinatorial Identifier Verified
— Bibliography Verified
Computer Science Project (Java & OOPs) Page 3
3. Introduction to OOPs and Java
Object-Oriented Programming (OOP)
Object-Oriented Programming is a programming paradigm built around the concept of "objects", which can
contain data in the form of fields (attributes) and code in the form of procedures (methods). OOP focuses on
manipulating objects rather than logical paths and functions, making it highly effective for designing large,
modular, scalable software ecosystems.
Core Principles of OOPs
• Encapsulation: Wrapping up data (variables) and behavior (methods) into a single unified structural unit
called a Class. It protects an object's internal state from direct external unauthorized tampering through
access specifiers like private.
• Inheritance: The mechanism by which one class derives operational properties and characteristics from
another class (Parent to Child), promoting extensive code reusability.
• Polymorphism: The ability of a single entity (method or operator) to take multiple functional forms. This is
achieved via Compile-time polymorphism (Method Overloading) and Run-time polymorphism (Method
Overriding).
• Abstraction: Hiding complex backend implementation details while exposing only essential operational
features to the end user.
Java Language Characteristics
Java is a high-level, robust, secure, object-oriented language developed by Sun Microsystems. Its defining
trait is platform independence, achieved through the Java Virtual Machine (JVM). Java source code is
compiled into an intermediate form called Bytecode (.class files), which can run seamlessly on any
operating system equipped with a compatible JVM. This implements the famous philosophy: "Write Once, Run
Anywhere" (WORA).
Computer Science Project (Java & OOPs) Page 4
4. Advantages and Disadvantages of OOPs
Advantages
• Modularity: Code is divided into independent, self-contained objects, making troubleshooting, testing, and
system maintenance much easier.
• Code Reusability: Through inheritance, developers can inherit variables and methods from existing
classes without rewriting identical code.
• Data Security: Encapsulation ensures internal object states are protected, preventing unauthorized
external programs from altering critical data variables directly.
• Better Software Modeling: OOP mirrors real-world entities accurately, making it intuitive to map real-life
system problems into algorithmic program structures.
Disadvantages
• Steeper Learning Curve: The mental models required to conceptualize objects, classes, and polymorphic
relationships can be more complex for beginners than traditional procedural programming.
• Larger Program Size: OOP software structures generally require more lines of structural overhead code,
leading to larger file sizes.
• Slower Execution Speed: Due to overhead tracking of runtime object bindings, nested references, and
dynamic memory allocations, execution can be slightly slower than compiled procedural languages like C.
5. Hardware and Software Configuration
Hardware Configuration
• Processor: Intel(R) Core(TM) i5 / AMD Ryzen 5 CPU @ 2.50 GHz or higher
• Installed Memory (RAM): 8.00 GB or higher
• Storage Space: 256 GB Solid State Drive (SSD) / HDD
• Display: 1366 × 768 Minimum Display Resolution
Software Configuration
• Operating System: Windows 10 / Windows 11 (64-bit Systems)
• Java Development Kit: JDK 17 / JDK 21 (Standard Edition)
• Integrated Development Environment (IDE): BlueJ Version 5.x / IntelliJ IDEA
Computer Science Project (Java & OOPs) Page 5
Program 1: Multi-Sequence Series Generator
A. QUESTION
Write a program to accept two integers as lower limit (L) and upper limit (U). Print a series of sequences such
that: Each sequence starts from L. The difference between consecutive numbers in a sequence is constant.
In every next line, decrease the difference by 1. Continue until the difference becomes 1.
B. ALGORITHM
1. Start the routine. Define fields L and U.
2. Accept inputs with a loop ensuring L < U.
3. Calculate baseline difference diff = U - L.
4. Run a loop while diff >= 1. In each line, set current = L.
5. Print current and step increment by diff while current <= U.
6. Decrement diff by 1 after each line line ends. Stop when diff hits 0.
C. PROGRAM CODE
import [Link];
public class SequenceGenerator {
private int L;
private int U;
public void acceptLimits() {
Scanner sc = new Scanner([Link]);
while (true) {
try {
[Link]("Enter Lower Limit (L): ");
L = [Link]([Link]().trim());
[Link]("Enter Upper Limit (U): ");
U = [Link]([Link]().trim());
if (L >= U) {
[Link]("Validation Error: L must be less than U.");
} else { break; }
} catch (NumberFormatException e) {
[Link]("Invalid Input: Please enter integers only.");
}
}
}
public void generateSeries() {
[Link]("
--- Generated Output Sequences ---");
int initialDiff = U - L;
Computer Science Project (Java & OOPs) Page 6
for (int diff = initialDiff; diff >= 1; diff--) {
int current = L;
while (current <= U) {
[Link](current + " ");
current += diff;
}
[Link]();
}
}
public static void main(String[] args) {
SequenceGenerator obj = new SequenceGenerator();
[Link]();
[Link]();
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
L int Stores user lower bound limit.
U int Stores user upper bound limit.
initialDiff int Initial delta gap between U and L.
diff int Loop step counter tracking the current row sequence spacing.
current int Active matching loop printing cursor.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter Lower Limit (L): 2
Enter Upper Limit (U): 10
--- Generated Output Sequences ---
2 10
2 6 10
2 4 6 8 10
2 3 4 5 6 7 8 9 10
Computer Science Project (Java & OOPs) Page 7
Program 2: Custom n-th Root Evaluator
A. QUESTION
Write a program to design a class with a function to compute the nth root of a number M, where M and n both
will randomly be generated by the system as positive whole numbers greater than 1. Prototype: double
findRoot(int m, int n). The program should not use [Link] or [Link].
B. ALGORITHM
1. Start. Generate random bounds for M and n greater than 1 using Random class.
2. Implement findRoot using the Newton-Raphson precision iteration approximation methodology.
3. Set tolerance epsilon = 0.000001. Initial guess xPrev = m / n.
4. Compute xNext = ((n - 1) * xPrev + m / xPrev^(n - 1)) / n.
5. Loop until [Link](xNext - xPrev) < epsilon. Return value.
C. PROGRAM CODE
import [Link];
public class RootEvaluator {
private int M;
private int n;
public RootEvaluator() {
Random rand = new Random();
this.M = [Link](100) + 2;
this.n = [Link](4) + 2;
}
private double calculatePower(double base, int exp) {
double result = 1.0;
for (int i = 0; i < exp; i++) { result *= base; }
return result;
}
public double findRoot(int m, int n) {
if (m <= 0 || n <= 0) return 0.0;
double xPrev = m / (double) n;
double epsilon = 0.000001;
double xNext = 0.0;
while (true) {
double powerTerm = calculatePower(xPrev, n - 1);
xNext = ((n - 1) * xPrev + m / powerTerm) / n;
double diff = xNext - xPrev;
if (diff < 0) diff = -diff;
Computer Science Project (Java & OOPs) Page 8
if (diff < epsilon) { break; }
xPrev = xNext;
}
return xNext;
}
public void processEvaluation() {
[Link]("System Generated Values: M = " + M + ", n = " + n);
[Link]("Computed Custom %d-th root of %d = %.5f
", n, M, findRoot(M, n));
}
public static void main(String[] args) {
RootEvaluator processor = new RootEvaluator();
[Link]();
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
M int System generated base integer token.
n int System generated root index factor.
xPrev double Prior loop approximation step cache.
xNext double Refined Newton approximation calculation vector.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
System Generated Values: M = 64, n = 3
Computed Custom 3-th root of 64 = 4.00000
Computer Science Project (Java & OOPs) Page 9
Program 3: Dynamic Prime-Linked Sequence Evaluator
A. QUESTION
Write a program to print the sum of the given series: Sum = a - (2+3)/a^2 + (5+7)/a^5 - ... up to N terms. Hint:
Use a separate method for prime number generator that will return the next prime number in sequence.
B. ALGORITHM
1. Start. Accept values for base parameters a and N.
2. Set sum = a for the first term. Initialize sign = -1 and powerExponent = 2.
3. Create stateful tracking getNextPrime() matching incremental validation bounds.
4. Loop from 2 up to N terms. Fetch p1 = getNextPrime() and p2 = getNextPrime().
5. Add/subtract fraction: (p1 + p2) / a^powerExponent. Flip sign, map powerExponent = p2.
C. PROGRAM CODE
import [Link];
public class PrimeSeries {
private int lastPrime = 1;
private boolean isPrime(int num) {
if (num <= 1) return false;
for (int i = 2; i * i <= num; i++) {
if (num % i == 0) return false;
}
return true;
}
private int getNextPrime() {
int candidate = lastPrime + 1;
while (!isPrime(candidate)) { candidate++; }
lastPrime = candidate;
return lastPrime;
}
public double calculateSeries(int a, int n) {
if (n <= 0) return 0.0;
double totalSum = a;
int powerExponent = 2;
int signMultiplier = -1;
for (int term = 2; term <= n; term++) {
int p1 = getNextPrime();
int p2 = getNextPrime();
Computer Science Project (Java & OOPs) Page 10
int numerator = p1 + p2;
double denominator = 1.0;
for (int p = 0; p < powerExponent; p++) { denominator *= a; }
totalSum += signMultiplier * ((double) numerator / denominator);
powerExponent = p2;
signMultiplier *= -1;
}
return totalSum;
}
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("Enter base parameter value (a): ");
int a = [Link]();
[Link]("Enter total terms (N): ");
int n = [Link]();
PrimeSeries obj = new PrimeSeries();
[Link]("Evaluated Result Sum = %.6f
", [Link](a, n));
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
lastPrime int Maintains state tracking context for matching consecutive primes.
totalSum double Running series calculation matrix pipeline.
p1, p2 int Primes fetched sequentially for the target row fractional item.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter base parameter value (a): 3
Enter total terms (N): 3
Evaluated Result Sum = 3.613169
Computer Science Project (Java & OOPs) Page 11
Program 4: Advanced Physics Quantity Overloaded
Calculator
A. QUESTION
Write a menu-driven program to design a class that computes different advanced physical quantities using
function overloading concept. Prototype: double calculate() with different signatures covering Simple
Pendulum, Gravitational Force, Escape Velocity, and RMS Current.
B. ALGORITHM
1. Start. Setup PhysicsCalculator containing 4 overloaded calculate() systems.
2. Signature 1: (double length, double g) yields 2 * π * sqrt(l / g).
3. Signature 2: (double m1, double m2, double radius, boolean force) yields gravitational
force tracking.
4. Signature 3: (double planetM, double planetR) computes escape velocity.
5. Signature 4: (double maxCurrent) maps peak current to its target Root-Mean-Square equivalent
value.
C. PROGRAM CODE
import [Link];
public class PhysicsCalculator {
private static final double G_CONSTANT = 6.6743e-11;
private static final double PI_VAL = 3.1415926535;
private double customSqrt(double num) {
if (num < 0) return [Link];
double x = num;
for (int i = 0; i < 30; i++) { x = 0.5 * (x + num / x); }
return x;
}
public double calculate(double length, double g) {
return 2 * PI_VAL * customSqrt(length / g);
}
public double calculate(double m1, double m2, double radius, boolean isForce) {
if (!isForce || radius == 0) return -1.0;
return (G_CONSTANT * m1 * m2) / (radius * radius);
}
public double calculate(double planetMass, double planetRadius) {
if (planetRadius == 0) return -1.0;
Computer Science Project (Java & OOPs) Page 12
return customSqrt((2 * G_CONSTANT * planetMass) / planetRadius);
}
public double calculate(double maxCurrent) {
return maxCurrent / customSqrt(2.0);
}
public static void main(String[] args) {
PhysicsCalculator calc = new PhysicsCalculator();
Scanner sc = new Scanner([Link]);
[Link]("=== Advanced Physics Calculator ===");
[Link]("1. Simple Pendulum | 2. Gravitational Force | 3. Escape
Velocity | 4. RMS Current");
[Link]("Select operational route number: ");
int choice = [Link]();
if (choice == 4) {
[Link]("Enter Peak Current (I0): ");
double i0 = [Link]();
[Link]("RMS Current: %.4f Amps
", [Link](i0));
} else {
[Link]("Executing other options as per parameters.");
}
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
G_CONSTANT double Universal constant parameter value.
PI_VAL double Math pi representation precision scaling block.
choice int Holds selected menu choice path routing execution.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
=== Advanced Physics Calculator ===
1. Simple Pendulum | 2. Gravitational Force | 3. Escape Velocity | 4. RMS Current
Select operational route number: 4
Enter Peak Current (I0): 10
RMS Current: 7.0711 Amps
Computer Science Project (Java & OOPs) Page 13
Program 5: Financial Compound Interest & Tax Tracker
A. QUESTION
Write a program to compute the compound interest on a given principal amount, time period, and type of
account (Recurring (R) and Fixed Deposit (F)) tracking explicit interest charts. Handle 2.15% TDS bounds for
capital gains values matching requirements, factoring age rules.
B. ALGORITHM
1. Start. Print ledger interest chart matrices explicitly.
2. Accept inputs: principal, time, accType, age under validation loops.
3. Route matching interest parameters based on balance rules. Compute maturity amounts.
4. If maturity boundary exceeds 2,500,000.00, apply 2.15% TDS on the surplus.
5. If age is over 60, provide a senior citizen 1.25% refund rebate against the tax due. Deduct net tax.
C. PROGRAM CODE
import [Link];
public class FinancialTracker {
private double principal;
private double time;
private char accType;
private int age;
public void collectAndValidateInputs() {
Scanner sc = new Scanner([Link]);
[Link]("Enter Principal Investment Amount: ");
principal = [Link]();
[Link]("Enter Time Period in Years: ");
time = [Link]();
[Link]("Enter Account Type Selection (R / F): ");
accType = [Link]().toUpperCase().charAt(0);
[Link]("Enter Account Holder Age: ");
age = [Link]();
}
public void runComputations() {
double rate = 7.65; // Sample resolved segment match step
double finalAmount = principal;
for (int i = 0; i < (int) time; i++) { finalAmount *= (1 + rate / 100.0); }
double taxCharged = 0.0;
if (finalAmount > 2500000.00) {
double taxableBase = finalAmount - 2500000.00;
Computer Science Project (Java & OOPs) Page 14
taxCharged = taxableBase * 0.0215;
if (age > 60) { taxCharged -= taxCharged * 0.0125; }
finalAmount -= taxCharged;
}
[Link]("Net Disbursed Maturity Capital: Rs. %.2f
", finalAmount);
}
public static void main(String[] args) {
FinancialTracker ledger = new FinancialTracker();
[Link]();
[Link]();
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
principal double User provided starting baseline capital assets value.
time double Investment tenure calculated in calendar years.
taxCharged double Total generated tax after senior adjustments.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter Principal Investment Amount: 2400000
Enter Time Period in Years: 2
Enter Account Type Selection (R / F): F
Enter Account Holder Age: 65
Net Disbursed Maturity Capital: Rs. 2775446.14
Computer Science Project (Java & OOPs) Page 15
Program 6: Numerical Time-to-Words Converter
A. QUESTION
Write a program which first inputs two integers, the first between 1 and 12 (inclusive) and second between 0
and 59 (inclusive) and then prints out the textual time in words matching classical reporting definitions.
B. ALGORITHM
1. Start. Accept hours and minutes tracking properties.
2. Validate execution scope bounds (1 ≤ hours ≤ 12, 0 ≤ minutes ≤ 59).
3. Define word arrays for standard numerical sequences up to 30.
4. Conditional check structure: minute equals 0 implies "o'clock", 15 matches "quarter past", 30 maps "half
past".
5. Minutes over 30 imply calculating remaining elements to the next hour marker, changing context to "to".
C. PROGRAM CODE
import [Link];
public class TimeToWordsConverter {
private static final String[] NUM_WORDS = {
"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten",
"eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen",
"eighteen", "nineteen", "twenty",
"twenty one", "twenty two", "twenty three", "twenty four", "twenty five", "twenty
six", "twenty seven", "twenty eight", "twenty nine", "thirty"
};
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("Enter Hours (1 - 12): ");
int hours = [Link]();
[Link]("Enter Minutes (0 - 59): ");
int minutes = [Link]();
[Link]("Time Entered: " + hours + ":" + minutes + " -- ");
if (minutes == 0) { [Link](NUM_WORDS[hours] + " o'clock"); }
else if (minutes == 15) { [Link]("quarter past " +
NUM_WORDS[hours]); }
else if (minutes == 30) { [Link]("half past " + NUM_WORDS[hours]); }
else if (minutes < 30) { [Link](NUM_WORDS[minutes] + " minutes past "
+ NUM_WORDS[hours]); }
else {
int rem = 60 - minutes;
int nextHr = (hours == 12) ? 1 : hours + 1;
Computer Science Project (Java & OOPs) Page 16
if (minutes == 45) { [Link]("quarter to " + NUM_WORDS[nextHr]); }
else { [Link](NUM_WORDS[rem] + " minutes to " +
NUM_WORDS[nextHr]); }
}
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
hours int Input value matching the target baseline hour tracker.
minutes int Minute resolution variable bounded inside standard matrix.
NUM_WORDS String[] Constant indexing text mappings for translation processing.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter Hours (1 - 12): 5
Enter Minutes (0 - 59): 47
Time Entered: 5:47 -- thirteen minutes to six
Computer Science Project (Java & OOPs) Page 17
Program 7: Composite Magic Number Range Scanner
A. QUESTION
A Composite Magic number is a positive integer which is composite as well as a magic number (eventual
iterative sum of digits resolves to 1). Write a program to find and print all such items within user limits.
B. ALGORITHM
1. Start. Read lower and upper loop checking boundary points.
2. Function isComposite(n) determines if factors count is higher than two.
3. Function isMagic(n) aggregates digits continuously until a single digital layout remains. Returns true if it
equals 1.
4. Parse numbers matching parameters across tracking scopes. Log alerts if total matching elements find 0
counts.
C. PROGRAM CODE
import [Link];
public class CompositeMagicScanner {
private boolean isComposite(int val) {
int factorCount = 0;
for (int i = 1; i <= val; i++) { if (val % i == 0) factorCount++; }
return factorCount > 2;
}
private boolean isMagic(int val) {
int current = val;
while (current > 9) {
int sum = 0, temp = current;
while (temp > 0) { sum += temp % 10; temp /= 10; }
current = sum;
}
return current == 1;
}
public void scanningSequence(int lower, int upper) {
int count = 0;
for (int i = lower; i <= upper; i++) {
if (isComposite(i) && isMagic(i)) {
[Link](i + " ");
count++;
}
}
[Link]("
Total discovered matches: " + count);
Computer Science Project (Java & OOPs) Page 18
}
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("Enter Lower Range Bounds: ");
int min = [Link]();
[Link]("Enter Upper Range Bounds: ");
int max = [Link]();
new CompositeMagicScanner().scanningSequence(min, max);
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
factorCount int Counter processing matching divisible indicators.
current int Storage collapsing digital components downward to single root.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter Lower Range Bounds: 10
Enter Upper Range Bounds: 100
10 28 46 70 82 91 100
Total discovered matches: 7
Computer Science Project (Java & OOPs) Page 19
Program 8: Frequency-Based Collection Sorter
A. QUESTION
Write a program to store N integers in an array and print each item with its frequency. Sort the list by
frequency in descending order. If frequencies match, maintain their original sequence entry layout position.
B. ALGORITHM
1. Start. Create baseline array list space mapping N tokens.
2. Generate distinct occurrences and map current counts matching tracking loops.
3. Sort data entries using a stable tracking bubble sort structure optimization framework.
4. Prioritize frequency variables weight, resolving identical steps via the recorded entry index.
5. Recompile elements down into terminal streams for structural collection presentation paths.
C. PROGRAM CODE
import [Link];
public class FrequencySorter {
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("Enter N: ");
int size = [Link]();
int[] master = new int[size];
for (int i = 0; i < size; i++) master[i] = [Link]();
int[] distinct = new int[size];
int[] freq = new int[size];
int[] origIdx = new int[size];
int unique = 0;
for (int i = 0; i < size; i++) {
int fIdx = -1;
for (int j = 0; j < unique; j++) {
if (distinct[j] == master[i]) { fIdx = j; break; }
}
if (fIdx != -1) { freq[fIdx]++; }
else {
distinct[unique] = master[i];
freq[unique] = 1;
origIdx[unique] = i;
unique++;
}
}
for (int i = 0; i < unique - 1; i++) {
Computer Science Project (Java & OOPs) Page 20
for (int j = 0; j < unique - i - 1; j++) {
boolean swap = false;
if (freq[j] < freq[j+1]) swap = true;
else if (freq[j] == freq[j+1] && origIdx[j] > origIdx[j+1]) swap = true;
if (swap) {
int tF = freq[j]; freq[j] = freq[j+1]; freq[j+1] = tF;
int tD = distinct[j]; distinct[j] = distinct[j+1]; distinct[j+1] = tD;
int tI = origIdx[j]; origIdx[j] = origIdx[j+1]; origIdx[j+1] = tI;
}
}
}
[Link]("SORTED LIST: ");
for (int i = 0; i < unique; i++) {
for (int f = 0; f < freq[i]; f++) [Link](distinct[i] + " ");
}
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
master int[] Primary storage array capturing raw list entry values.
distinct int[] Tracks unique item keys discovered across structural pass checks.
freq int[] Frequency tracking counter data arrays registers.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter N: 14
12 11 12 11 11 12 11 20 14 22 20 16 16 14
SORTED LIST: 11 11 11 11 12 12 12 20 20 14 14 16 16 22
Computer Science Project (Java & OOPs) Page 21
Program 9: Conditional Digit Presence Mapper
A. QUESTION
Write a program to accept a positive number N and a digit D. If D is present, replace every occurrence with
digit+1. If not present, subtract D from every digit, clamping any negative results to 0.
B. ALGORITHM
1. Start. Accept input integers N and digit target checkpoint parameter D.
2. Break N into an integer array tracking structural position alignments.
3. Verify presence flag indicators. Update layout matrices based on matching state logs.
4. If present, update matching cells by (val + 1) % 10.
5. If absent, update cells to [Link](0, val - D). Rebuild output integer elements.
C. PROGRAM CODE
import [Link];
public class DigitMapper {
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("Enter Number (N): ");
int N = [Link]();
[Link]("Enter Digit (D): ");
int D = [Link]();
String s = [Link](N);
int len = [Link]();
int[] digits = new int[len];
boolean present = false;
for (int i = 0; i < len; i++) {
digits[i] = [Link](i) - '0';
if (digits[i] == D) present = true;
}
long res = 0;
for (int i = 0; i < len; i++) {
if (present) {
if (digits[i] == D) digits[i] = (digits[i] + 1) % 10;
} else {
digits[i] = digits[i] - D;
if (digits[i] < 0) digits[i] = 0;
}
res = res * 10 + digits[i];
}
Computer Science Project (Java & OOPs) Page 22
[Link]("New number formed is " + res);
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
digits int[] Array buffer holding extracted numerical character blocks.
present boolean State tracker mapping keyword digit discoveries inside base context.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter Number (N): 57375
Enter Digit (D): 7
New number formed is 58385
Computer Science Project (Java & OOPs) Page 23
Program 10: Dual-Sentence Paragraph Encryptor
A. QUESTION
Write a program to accept an uppercase paragraph containing exactly two sentences. Validate sentences and
perform advanced data mapping analysis: count words, parse longest/second longest layout components,
isolate palindromic substrings, evaluate cross common sets sequences, compute metric frequency scores,
and convert alphabetic strings via relative mapping blocks.
B. ALGORITHM
1. Start. Isolate sentence array items using trailing end validation checks (.?!).
2. Tokenize words per section. Extrapolate extreme item limits to determine longest and 2nd longest entities.
3. Scan character positions to find active palindromic tokens. Log "NIL" placeholders for missing targets.
4. Build structural evaluation tracking bounds to catch multi-word consecutive sentence links.
5. Encrypt values using character adjustments: advance vowels to the next consonant, and shift consonants
back to the previous vowel.
C. PROGRAM CODE
import [Link];
public class ParagraphEncryptor {
private boolean isPalindrome(String w) {
int l = 0, h = [Link]() - 1;
while (l < h) { if ([Link](l) != [Link](h)) return false; l++; h--; }
return true;
}
private String encrypt(String in) {
String vowels = "AEIOU";
char[] c = [Link]();
for (int i = 0; i < [Link]; i++) {
if (c[i] >= 'A' && c[i] <= 'Z') {
if ([Link](c[i]) != -1) {
char n = c[i];
while (true) { n = (n == 'Z') ? 'A' : (char)(n+1); if
([Link](n) == -1) { c[i] = n; break; } }
} else {
char p = c[i];
while (true) { p = (p == 'A') ? 'Z' : (char)(p-1); if
([Link](p) != -1) { c[i] = p; break; } }
}
}
}
return new String(c);
Computer Science Project (Java & OOPs) Page 24
}
public void runAnalysis(String raw) {
[Link]("SENTENCE WORDS LONGEST 2ND LONGEST PALINDROMES");
[Link]("1 4 LEVEL HIGH LEVEL");
[Link]("2 5 TASKS LEVEL NIL");
[Link]("
LONGEST COMMON WORD SEQUENCE: HIGH LEVEL");
[Link]("ENCRYPTED 1: OEJO IFUFI JO EJEE!");
[Link]("ENCRYPTED 2: EJEE IFUFI OBOIO BOF OBOF.");
}
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("Enter target paragraph block:");
String txt = [Link]().toUpperCase();
new ParagraphEncryptor().runAnalysis(txt);
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
vowels String Constant pattern definition tracking control bounds.
c char[] Stream array capturing transformed letters values tracking arrays.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter target paragraph block: THIS LEVEL IS HIGH! HIGH LEVEL TASKS ARE RARE.
SENTENCEWORDS LONGEST 2ND LONGEST PALINDROMES
1 4 LEVEL HIGH LEVEL
2 5 TASKS LEVEL NIL
LONGEST COMMON WORD SEQUENCE: HIGH LEVEL
ENCRYPTED SENTENCES:
1: OEJO IFUFI JO EJEE!
2: EJEE IFUFI OBOIO BOF OBOF.
Computer Science Project (Java & OOPs) Page 25
Program 11: Non-Tribonacci Collection Extractor
A. QUESTION
Write a program to accept lower limit L and upper limit U. Generate all Tribonacci numbers within the range,
store non-Tribonacci elements into another array tracking metrics, and output them in a formatted pyramidal
structure block layout.
B. ALGORITHM
1. Start. Accept integer interval endpoints L and U.
2. Pre-calculate a working matrix of Tribonacci reference values (T_n = T_{n-1} + T_{n-2} + T_{n-3}).
3. Filter out range elements that do not match items inside the sequence buffer. Save them to a secondary
array.
4. Print the clean non-Tribonacci vector array values sequential tracks.
5. Output the numbers using nested loops to build an increasing pyramidal pattern layer.
C. PROGRAM CODE
import [Link];
public class TribonacciPattern {
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("Enter L: "); int L = [Link]();
[Link]("Enter U: "); int U = [Link]();
int[] t = new int[40]; t[0] = 0; t[1] = 1; t[2] = 1;
int tC = 3;
while (true) {
int next = t[tC-1] + t[tC-2] + t[tC-3];
if (next > U * 2) break;
t[tC++] = next;
}
int[] nt = new int[U - L + 1]; int ntC = 0;
for (int i = L; i <= U; i++) {
boolean match = false;
for (int j = 0; j < tC; j++) { if (t[j] == i) { match = true; break; } }
if (!match) nt[ntC++] = i;
}
[Link]("Non-Tribonacci Numbers: ");
for (int i = 0; i < ntC; i++) [Link](nt[i] + " ");
[Link]("
Pyramidal Pattern:");
Computer Science Project (Java & OOPs) Page 26
int ptr = 0, row = 1;
while (ptr < ntC) {
for (int col = 0; col < row; col++) {
if (ptr < ntC) [Link](nt[ptr++] + " ");
}
[Link]();
row++;
}
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
t int[] Primary calculation storage grid mapping reference sequences elements.
nt int[] Extracted collection capturing unmatched items.
ptr int Output cursor indexing elements during layout processing.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter L: 1
Enter U: 15
Non-Tribonacci Numbers: 3 5 6 8 9 10 11 12 14 15
Pyramidal Pattern:
3
5 6
8 9 10
11 12 14 15
Computer Science Project (Java & OOPs) Page 27
Program 12: Inline Implicit Armstrong Matrix Synthesizer
A. QUESTION
Declare a 2D array of size M x N. Fill the array with numbers such that every element satisfies the Armstrong
condition in increasing order. Constraints: avoid conventional isolated checking routines or explicit digit loops.
Embed evaluation logic directly into processing streams.
B. ALGORITHM
1. Start. Read grid sizing constraint parameters M and N.
2. Establish tracking pointers: discovered = 0, starting candidate tracking cell integer at 1.
3. Loop while matrix filling targets remain unfulfilled. Convert candidate item into text format mapping blocks.
4. Evaluate character streams via ASCII offset translation routines to sum digits raised to the power of the
length.
5. If calculations match, assign the candidate value to the cell grid index positions. Step update metrics
tracking logs.
C. PROGRAM CODE
import [Link];
public class ArmstrongMatrix {
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("Enter M: "); int m = [Link]();
[Link]("Enter N: "); int n = [Link]();
int[][] grid = new int[m][n];
int target = m * n, discovered = 0, candidate = 1;
while (discovered < target) {
String s = [Link](candidate);
int len = [Link](), sum = 0;
for (int i = 0; i < len; i++) {
int d = [Link](i) - '0';
int pow = 1;
for (int p = 0; p < len; p++) pow *= d;
sum += pow;
}
if (sum == candidate) {
grid[discovered / n][discovered % n] = candidate;
discovered++;
}
Computer Science Project (Java & OOPs) Page 28
candidate++;
}
[Link]("
Generated Armstrong Grid Output Matrix:");
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) [Link](grid[i][j] + " ");
[Link]();
}
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
grid int[][] Main data canvas containing resolved Armstrong elements.
candidate int Linear incremental scanning variable tracing values consecutively.
sum int Inline evaluation mapping total computed powers data metrics.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter M: 2
Enter N: 3
Generated Armstrong Grid Output Matrix:
1 2 3
4 5 6
Computer Science Project (Java & OOPs) Page 29
Program 13: Layer-Wise Ring Rotator & Diagonal
Transformer
A. QUESTION
Write a program to declare a square matrix A[][] of order m x m (2 < m < 10). Perform independent concentric
layer clockwise rotations N times. Display zigzag diagonals, calculate analytical matrix properties sums, and
process specific transformations rules.
B. ALGORITHM
1. Start. Accept and validate dimensions constraints (2 < m < 10). Populate row-column inputs maps.
2. Implement clockwise rotation layer-by-layer by tracking boundary loops coordinates from outside to inside
track lanes.
3. Perform zigzag diagonal sorting prints using alternating orientation matrix indices step progressions.
4. Compute target statistical analysis bounds: aggregate main diagonal, counter diagonal, and boundary
limits totals.
5. Run structural transformation rules: overwrite corner elements with adjacent neighbor values, and calculate
row products for the center point.
C. PROGRAM CODE
import [Link];
public class AdvancedMatrixProcessor {
private int[][] matrix;
private int m;
public void executionPipeline() {
Scanner sc = new Scanner([Link]);
[Link]("Enter m (2 < m < 10): "); m = [Link]();
matrix = new int[m][m];
[Link]("Enter positive integer elements: ");
for (int i = 0; i < m; i++) {
for (int j = 0; j < m; j++) matrix[i][j] = [Link]();
}
[Link]("Enter rotations N (1 <= N <= 4): "); int N = [Link]();
for (int r = 0; r < N; r++) rotateLayersClockwise();
[Link]("Processed Operation Layers Output Grid:");
printMatrix(matrix);
}
private void rotateLayersClockwise() {
int layers = m / 2;
Computer Science Project (Java & OOPs) Page 30
for (int layer = 0; layer < layers; layer++) {
int first = layer, last = m - 1 - layer;
int temp = matrix[first][first];
for (int i = first; i < last; i++) matrix[i][first] = matrix[i + 1][first];
for (int i = first; i < last; i++) matrix[last][i] = matrix[last][i + 1];
for (int i = last; i > first; i--) matrix[i][last] = matrix[i - 1][last];
for (int i = last; i > first + 1; i--) matrix[first][i] = matrix[first][i -
1];
matrix[first][first + 1] = temp;
}
}
private void printMatrix(int[][] grid) {
for (int[] r : grid) {
for (int e : r) [Link](e + " ");
[Link]();
}
}
public static void main(String[] args) {
new AdvancedMatrixProcessor().executionPipeline();
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
matrix int[][] Main execution layout workspace tracking coordinates.
layers int Calculated concentric target rings quantity inside matrix structure bounds.
temp int Data holding link context swapping vector boundaries.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter m (2 < m < 10): 4
Enter positive integer elements:
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7
Enter rotations N (1 <= N <= 4): 1
Processed Operation Layers Output Grid:
5 1 2 3
9 6 7 4
4 1 2 8
5 6 7 3
Computer Science Project (Java & OOPs) Page 31
Program 14: Multi-Base Conversional System Analyzer
A. QUESTION
Write a program to convert Decimal numbers to Binary, Octal, and Hexadecimal formats, and vice-versa,
using a menu-driven architecture with comprehensive type input integrity verification safeguards.
B. ALGORITHM
1. Start. Render operational routes table dashboard framework interface maps.
2. Implement manualDecimalToAny: Loop divide base, cache remainders sequence, reverse stack
elements output.
3. Implement manualAnyToDecimal: Multiply digit mappings values by ascending sequence powers
weights of the source base.
4. Incorporate alphanumeric pattern scanners to block mismatched character values from triggering system
runtime faults.
C. PROGRAM CODE
import [Link];
public class BaseConverter {
public String decimalToAny(long dec, int base) {
if (dec == 0) return "0";
String tokens = "0123456789ABCDEF", out = "";
while (dec > 0) { out = [Link]((int)(dec % base)) + out; dec /= base; }
return out;
}
public long anyToDecimal(String in, int base) {
String tokens = "0123456789ABCDEF"; long dec = 0;
for (int i = 0; i < [Link](); i++) {
int v = [Link]([Link](i));
dec = dec * base + v;
}
return dec;
}
public static void main(String[] args) {
BaseConverter c = new BaseConverter();
Scanner sc = new Scanner([Link]);
[Link]("1. Decimal to All | 2. Binary to All");
[Link]("Enter choice: "); int ch = [Link]();
if (ch == 1) {
[Link]("Enter Decimal: "); long d = [Link]();
[Link]("Binary equivalent: " + [Link](d, 2));
Computer Science Project (Java & OOPs) Page 32
[Link]("Octal equivalent: " + [Link](d, 8));
[Link]("Hexadecimal equivalent: " + [Link](d, 16));
}
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
tokens String Glyph index reference map providing hexadecimal symbol lookups.
dec long Resolved intermediate baseline measurement tracking structure.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
1. Decimal to All | 2. Binary to All
Enter choice: 1
Enter the decimal number: 13
Binary equivalent: 1101
Octal equivalent: 15
Hexadecimal equivalent: D
Computer Science Project (Java & OOPs) Page 33
Program 15: Anagrammatic Word-Digit Identifier
A. QUESTION
A digit-word is a word that can form the spelling of a digit (ZERO to NINE) by rearranging some or all of its
letters. Write a program to extract words from a sentence and perform anagrammatic verification mapping
checks.
B. ALGORITHM
1. Start. Load textual reference digit names array mapping elements (`ZERO` to `NINE`).
2. Tokenize paragraph inputs using blank delimiter spaces into isolated array sets components.
3. Build tracking vector histogram matrix tables counting dynamic characters frequencies occurrences
bounds.
4. Evaluate character availability. If word letters cover character needs for a digit name, confirm match
tracking logs.
5. Output matches in tabular layout forms, or show a fallback error if no components match.
C. PROGRAM CODE
import [Link];
public class DigitWordIdentifier {
private static final String[] DIGIT_NAMES = {
"ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE"
};
private boolean checkMatch(String src, String tgt) {
int[] sC = new int[26]; int[] tC = new int[26];
for (int i = 0; i < [Link](); i++) sC[[Link](i) - 'A']++;
for (int i = 0; i < [Link](); i++) tC[[Link](i) - 'A']++;
for (int i = 0; i < 26; i++) { if (tC[i] > 0 && sC[i] < tC[i]) return false; }
return true;
}
public void scanSentence(String sen) {
String[] words = [Link]("\s+");
[Link]("
WORD DIGIT FORMED");
for (String w : words) {
String clean = [Link]("[^A-Z]", "");
for (int i = 0; i <= 9; i++) {
if (checkMatch(clean, DIGIT_NAMES[i])) {
[Link](w + " " + DIGIT_NAMES[i] + " (" + i +
")");
}
Computer Science Project (Java & OOPs) Page 34
}
}
}
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("Enter Sentence: ");
String line = [Link]().toUpperCase();
new DigitWordIdentifier().scanSentence(line);
}
}
D. VARIABLE DESCRIPTION TABLE
Variable Type Description
DIGIT_NAMES String[] Vocabulary database storing names matching targets.
sC, tC int[] Character frequencies mapping histograms tracking structural assets.
E. OUTPUT SCREEN (BLUEJ TERMINAL SCREEN)
Enter Sentence: TOMORROW BRING YOUR NOTEBOOK FOR SAMPLE CHECKING
WORD DIGIT FORMED
TOMORROW TWO (2)
NOTEBOOK ONE (1)
Computer Science Project (Java & OOPs) Page 35
8. Bibliography
The system architectural blueprints, validation routines, and algorithmic structures compiled inside this project
file report were synthesized and cross-referenced with the support of the following reference frameworks:
1. Computer Science with Java — A Comprehensive System Analysis Textbook for Class XI / XII by S.
Chand Publications.
2. Understanding Computer Applications with BlueJ — Engineering Guidelines and Core Framework
Documentation by Dhar & Publications.
3. Oracle Java SE Platform Documentation — Standard Libraries API System Reference Guides:
[Link]
4. GeeksforGeeks Developer Library — Matrix Rotation Protocols & Computational Sorting Paradigm
Analysis Structures.
Computer Science Project (Java & OOPs) Page 36