Computer Applications Project Work (Class 10)
Instructions followed as per school requirement. Programs written in Java using BlueJ.
Question 1: Courier Charges
Scanner sc = new Scanner([Link]);
[Link]("Enter weight of parcel in gm: ");
int weight = [Link]();
[Link]("Enter type of booking (O for Ordinary / E for Express): ");
char type = [Link]().toUpperCase().charAt(0);
int charges = 0;
if (type == 'O') {
if (weight <= 500) charges = 80;
else if (weight <= 1000) charges = 120;
else if (weight <= 2000) charges = 180;
else charges = 200;
} else if (type == 'E') {
if (weight <= 500) charges = 100;
else if (weight <= 1000) charges = 150;
else if (weight <= 2000) charges = 200;
else charges = 250;
} else {
[Link]("Invalid booking type.");
return;
}
[Link]("Total Charges: Rs " + charges);
Java Program Code:
Method Name(s): q1_courierCharges
Java Program Code:
Code written in Java. Please refer to the BlueJ output pasted below.
[Paste the full code block for this method here.]
Output Screenshot:
[Paste BlueJ output screenshot here.]
Variable Description Table:
Variable Name Data Type Description
ExampleVar int Used to store example value
sc Scanner Used for user input
weight int Weight of the parcel
type char Booking type: O or E
charges int Total courier charges
sc Scanner Used for user input
age int Age of the person
gender String Gender of the person
income double Taxable income
tax double Calculated income tax
sc Scanner Used for user input
ch int User choice
n int Input number
f int Factorial result
Scanner sc = new Scanner([Link]);
[Link]("Enter age: ");
int age = [Link]();
[Link]("Enter gender (male/female): ");
String gender = [Link]().toLowerCase();
if (age > 65 || [Link]("female")) {
[Link]("Wrong category");
return;
}
[Link]("Enter taxable income: ");
double income = [Link]();
double tax = 0;
if (income <= 160000) tax = 0;
else if (income <= 500000) tax = (income - 160000) * 0.10;
else if (income <= 800000) tax = (income - 500000) * 0.20 + 34000;
else tax = (income - 800000) * 0.30 + 94000;
[Link]("Income Tax Payable: Rs " + tax);
Java Program Code:
Question 2: Income Tax Calculator
Method Name(s): q2_incomeTax
Java Program Code:
Code written in Java. Please refer to the BlueJ output pasted below.
[Paste the full code block for this method here.]
Output Screenshot:
Scanner sc = new Scanner([Link]);
[Link]("1. Display factors\n2. Display factorial");
[Link]("Enter choice: ");
int ch = [Link]();
[Link]("Enter number: ");
int n = [Link]();
switch (ch) {
case 1:
[Link]("Factors: ");
for (int i = 1; i < n; i++)
if (n % i == 0) [Link](i + " ");
break;
case 2:
int f = 1;
for (int i = 1; i <= n; i++) f *= i;
[Link]("Factorial = " + f);
break;
default:
[Link]("Invalid choice");
}
Java Program Code:
[Paste BlueJ output screenshot here.]
Variable Description Table:
Variable Name Data Type Description
ExampleVar int Used to store example value
Question 3: Factors and Factorial (Menu Driven)
Method Name(s): q3_menuFactorsFactorial
Java Program Code:
Code written in Java. Please refer to the BlueJ output pasted below.
[Paste the full code block for this method here.]
Output Screenshot:
[Paste BlueJ output screenshot here.]
Variable Description Table:
Variable Name Data Type Description
ExampleVar int Used to store example value
Question 5: Fibonacci Series & Odd Digit Sum (Menu Driven)
Method Name(s): q5_menuFiboOddSum
Java Program Code:
Code written in Java. Please refer to the BlueJ output pasted below.
[Paste the full code block for this method here.]
Output Screenshot:
[Paste BlueJ output screenshot here.]
Variable Description Table:
Variable Name Data Type Description
ExampleVar int Used to store example value
Question 6: Prime Numbers Between a Range
Method Name(s): ShowPrime
Java Program Code:
Code written in Java. Please refer to the BlueJ output pasted below.
[Paste the full code block for this method here.]
Output Screenshot:
[Paste BlueJ output screenshot here.]
Variable Description Table:
Variable Name Data Type Description
ExampleVar int Used to store example value
Question 7: Armstrong Numbers (50 to 300)
Method Name(s): Armstrong
Java Program Code:
Code written in Java. Please refer to the BlueJ output pasted below.
[Paste the full code block for this method here.]
Output Screenshot:
[Paste BlueJ output screenshot here.]
Variable Description Table:
Variable Name Data Type Description
ExampleVar int Used to store example value
Question 8: Finder Class - Largest of Three Numbers
Method Name(s): accept
Java Program Code:
Code written in Java. Please refer to the BlueJ output pasted below.
[Paste the full code block for this method here.]
Output Screenshot:
[Paste BlueJ output screenshot here.]
Variable Description Table:
Variable Name Data Type Description
ExampleVar int Used to store example value
Question 9: Special Number Checker
Method Name(s): print_Numbers
Java Program Code:
Code written in Java. Please refer to the BlueJ output pasted below.
[Paste the full code block for this method here.]
Output Screenshot:
[Paste BlueJ output screenshot here.]
Variable Description Table:
Variable Name Data Type Description
ExampleVar int Used to store example value
Question 10: LCM and HCF using Functions
Method Name(s): LCM_finder / GCD_finder
Java Program Code:
Code written in Java. Please refer to the BlueJ output pasted below.
[Paste the full code block for this method here.]
Output Screenshot:
[Paste BlueJ output screenshot here.]
Variable Description Table:
Variable Name Data Type Description
ExampleVar int Used to store example value