0% found this document useful (0 votes)
45 views5 pages

Practical Work Class 11th

The document provides instructions and 10 questions for a Computer Science homework assignment involving programming in Java. Students are asked to write algorithms, source code with comments, and output for programs that: 1) analyze exam results data, 2) print patterns, 3) check for happy and Smith numbers, 4) perform math operations on arrays, 5) reverse a sentence, 6) format a name, 7) find the longest word in a string, and 8) convert a number to abbreviated name format. Students are to complete the work on A4 sheets with their details, algorithms, source code, and outputs for each question.

Uploaded by

Azal Azami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views5 pages

Practical Work Class 11th

The document provides instructions and 10 questions for a Computer Science homework assignment involving programming in Java. Students are asked to write algorithms, source code with comments, and output for programs that: 1) analyze exam results data, 2) print patterns, 3) check for happy and Smith numbers, 4) perform math operations on arrays, 5) reverse a sentence, 6) format a name, 7) find the longest word in a string, and 8) convert a number to abbreviated name format. Students are to complete the work on A4 sheets with their details, algorithms, source code, and outputs for each question.

Uploaded by

Azal Azami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

St.

Paul’s Church College


Class XI : Computer Science
Holiday Homework – Practical Work
Session 2023-24

Instructions:

 Cover your file white paper with all your details in a box.
Students need to write sequentially the algorithm of each program,
then printout of the source code(put comments in your
program)and followed by the printout of output screen.

NOTE: Algorithm, printout of source code and printout of output


screen should be done on A4 sheet only
Q1. The annual exam result of 5 students of class XI-B of Christ College I
tabulated as follows:

Roll No. Maths English Sanskrit

WAP in Java to read the data and determine:

i) Total marks obtained by each student.


ii) Highest marks in each subject and the roll number of the student
who obtained it.
iii) Highest total marks and the roll no. of the student who obtains it.

Q2. WAP in Java to print the following pattern:

***********
*********
*******
*****
***
*
Q3. WAP to print the following format:

1010101
010101
10101
0101
101
01
1

Q4. WAP to check and print first 10 Happy Numbers.

Happy number: Starting with any positive integer, replace the number by the
sum of the squares of its digits, and repeat the process until the number equals
1.

Q5. Accept numbers into an integer array A of size 4, create another string
array B of size 3. Accept any three mathematical symbols like (+, -, *, /) in
array B. Then according to mathematical symbol calculate the answer.
For e.g. if A = [8, 6, 4, 2] & B = [+, -, *], then answer will be (((8 + 6) - 4) *
2) = 20.
Q6. WAP in java to enter a number and check whether the number is
Kaprekar number or not.
A Karprekar number for a given base is a non-negative integer, the
representation of whose square in that base can be split into two parts that
add up to the original number again. For e.g. 45 is a Karprekar number,
because 45 * 45= 2025 and 20 + 25 =
45.
Q7. Write a program for converting a sentence in reverse.
For e.g.: Input: JAVA IS PROGRAMMING Output: PROGRAMMING IS JAVA

Q8. Write a program in java to accept a name containing First name,


Middle Name and Surname. Now display the Name in abbreviated form in
the order Surname, First initial of Middle name, and First initial of the First
name.
For e.g. Input : Mike Carron Elingnton
Output : Elingnton C. M.

Q9. Write a program to accept a string/sentence in upper


case and Display the longest word and the length of the
longest word present in the string.
For e.g. Input : “Australia is one of the most sports
playing nation in the world”
Output : Longest word = “Australia”
Length : 9
Q10. A natural number is said to be SMITH NUMBER, if sum
of all the digits of N and sum of all the digits of prime
factors of N are same.

Example : Input : N = 666


Sum of all the digits = 18
Prime factors of 666 = 2,3,3,37
Sum of digits of prime factors
(2+3+3+(3+7)) = 18
So 666 is a SMITH NUMBER.
WAP to input a positive natural number N and print
whether it is a SMITH NUMBER or not.

You might also like