Computer Applications - Class 10 ICSE Boards Project
Computer Applications - Class 10 ICSE Boards Project
COMPUTER PROJECT
2024-2025
CLASS: 10 SECTION: C
Output:
Number of digits – 3
Number of letters – 4
Number of Special characters – 2
import java.util.Scanner;
public class Count
{ // class begins
public static void main(String args[])
{ //main method begins
System.out.println("Enter a string:");
String str = ab.nextLine(); // Entering the string
int a= 0;
int sc = 0;
int d = 0;
else if (Character.isDigit(ch))
d++; // adding 1 to the number of digits if the character is a
digit
else
sc++; // adding 1 to the number of special character if the
character is a special character(not a letter or a number)
} // loop ends
import java.util.Scanner;
public class FactorialCalculator
{ // class begins
public static void main(String[] args)
{ // main method begins
Scanner sc = new Scanner(System.in);
import java.util.Scanner;
if (isPronic)
System.out.println(num + " is a pronic number");
else
System.out.println(num + " is not a pronic number");
} // closing main method
} //closing class
import java.util.Scanner;
import java.util.Scanner;
Q7)
Design a class name ShowRoom with the following description:
Instance variables / Data members:
String name — To store the name of the customer
long mobno — To store the mobile number of the customer
double cost — To store the cost of the items purchased
double dis — To store the discount amount
double amount — To store the amount to be paid after discount
Member methods:
ShowRoom() — default constructor to initialize data members
void input() — To input customer name, mobile number, cost
void calculate() — To calculate discount on the cost of purchased
items, based on following criteria
import java.util.Scanner;
public class Bubblesort_descending
{ // class begins
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
String names[] = new String[20];
System.out.println("Enter 20 names:");
for (int i = 0; i < names.length; i++) {
names[i] = sc.nextLine(); // Read each name into the array
}
Q10) Using switch statement, write a menu driven program for the
following:
import java.util.Scanner;
switch (choice) {
case 1:
int sum = 0;
for (int i = 1; i <= 20; i++) {
int x = 2;
int term = (int)Math.pow(x, i); // Calculate the term
if (i % 2 == 0)
sum -= term; // Subtract if index is even
else
sum += term; // Add if index is odd
}
System.out.println("Sum=" + sum); // Display the sum
break;
case 2:
int term = 1;
for (int i = 1; i <= 5; i++) {
System.out.print(term + " "); // Print the series
term = term * 10 + 1; // Update the term (for series like 1, 11,
111, ...)
}
break;
default:
System.out.println("Incorrect Choice"); // Handle incorrect choice
break;
}
}
}
import java.util.Scanner;
int sum = 0;
mks stream
void print() – Display student name, age, mks and stream allocated.
Call all the above methods in main method using an object.
import java.util.Scanner;
Q13) Define a class to accept a string, and print the characters with
the uppercase and lowercase reversed, but all the other characters
should remain the same as before.
EXAMPLE:
INPUT : WelCoMe_2022
OUTPUT : wELcOmE_2022
import java.util.Scanner;
(a) void series (int x, int n) – To display the sum of the series given below:
x1 + x2 + x3 + .......... xn terms
import java.util.*;
{ // class begins
// Method to print the terms where each term is (i^3 - 1) for i from 1
to p
void series(int p) {
for (int i = 1; i <= p; i++) {
int term = (int)(Math.pow(i, 3) - 1); // (i^3 - 1)
System.out.print(term + " "); // Printing each term
}
System.out.println();
}
// Method to calculate the sum of the series 1/2 + 1/3 + ... + 1/10
void series() {
double sum = 0.0;
for (int i = 2; i <= 10; i++) {
sum += 1.0 / i; // Adding 1/i to the sum
}
System.out.println("Sum = " + sum);
}
}