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

Class 11 Second Term Project Programs 2023 - 2024

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)
29 views5 pages

Class 11 Second Term Project Programs 2023 - 2024

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

CLASS XI COMPUTER SCIENCE PROJECT WORK, 2023 - 24 DON BOSCO SCHOOL LILUAH

Class XI Computer Science Project Work , 2023 – 24


Program 1
In a directory the names of streets and suburbs are shortened by replacing all vowels (a, e, i, o, u) with its
next vowel (in cyclic sequence) unless the vowel appears at the beginning of a word, in which case it is kept
unchanged. Write a program that will automatically shorten any address in this manner. Punctuation and
numbers must be reproduced as in the input. Example 1:
Input: Woodside Output: Wudsodi
Example 2:
Input: Observatory Output: Obsirvetury
Design a class named “VowelsReplaced” having the following data members and member functions are:
Data Members:
String streets[]; - stores a list of street names within an array
int size - stores the size of the array

Member Functions:
void accept( ) : accept the street names from the user.
void replaceVowels( ) : replace all the vowels in the street names as explained above.
void display( ) : display the list of street names.

Program 2
A number is well-ordered when its digits are in a numerically ascending order. E.g. 147 is well-ordered but
174 is not. In a well-ordered number, each of the digits 1 - 9 may only be used once. Write a program that
will calculate the sum of all the well-ordered numbers that are possible with a fixed number of digits.
Example:
Input: 2 Output: 1440
[Explanation: The program added up all the well-ordered two-digit numbers.
12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 34 + 35 + 36 + 37 + 38 + 39 +
45 + 46 + 47 + 48 + 49 + 56 + 57 + 58 + 59 + 67 + 68 + 69 + 78 + 79 + 89]

Program 3
Write a program that will find given words in the 8 by 8 word square below. You may assume that the words
appear in rows and read forward (L to R) or backwards (R to L). [Hint: As you use the same word square all
the time you can save time by hardcoding it into your program.]
Page 1|5
CLASS XI COMPUTER SCIENCE PROJECT WORK, 2023 - 24 DON BOSCO SCHOOL LILUAH

Your program should print out the word and indicate the row and column where the word begins and in
which direction it proceeds (forwards or backwards).
Example:
Input: COLT
Output: COLT, row 4, column 3, forwards

Program 4
Write a recursive/iterative function which takes a number N as function argument and displays the Hailstone
Sequence of that number. The sequence should stop when the sequence reaches 1.
Definition: The Hailstone Sequence of numbers can be generated from a starting positive integer, N by:
a) If N = 1 then the sequence ends.
b) If N is Even, then the next N of the sequence = n / 2.
c) If N is Odd, then the next N of the sequence = 3 × n + 1.
The (unproven) Collatz conjecture is that the Hailstone Sequence for any starting number always terminates.
The Hailstone Sequence is also known as Hailstone Numbers because the values are usually subject to
multiple descents and ascents like hailstone in a cloud.
This sequence is also known as the Collatz Sequence.
Examples:
INPUT:
N=7
OUTPUT:
Hailstone Numbers: 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1
Number of steps required: 17
INPUT:
N=9
OUTPUT:
Page 2|5
CLASS XI COMPUTER SCIENCE PROJECT WORK, 2023 - 24 DON BOSCO SCHOOL LILUAH

Hailstone Numbers: 9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1
Number of steps required: 20

Program 5
Design a class named “JatakaTales” having the following data members and data members:
Data Members :
String filename : stores the name of the text file(for eg., “jatakatales.txt”) containing the story of fairy
tales.
Member Functions:
void writeStory( ) : writes the stories in the form of paragraphs accepted from the user into the file
whose named is stored in string object “filename”.
void readStory( ) : reads the contents of the file whose named is stored in string object “filename”.
void addNewStory( ) : appends a new story to the file whose named is stored in string object “filename”.
int countWords( ) : returns the count of the number of distinct words stored in the file.
Write a menu driven main( ) to invoke the above functions to perform the above mentioned functions.

Program 6
Design a class named “Product” having the following data members and member functions:
Data Members:
String pID : stores the product ID.
String pName : stores the name of the product
float pPrice : stores the price of the product
String suplr : stores the name of the supplier whose supplied the product
int qty : stores the quantity of the product in store
Member Functions:
void writeDetails( ) : writes the details of a product after accepting them from the user into the binary
file(“product.dat”), the function should have the provision of asking the user “Whether he/she wants to add
another record of a product into the file?” and work accordingly.
void readDetails( ) : reads the details of the products stored in the file.
Product search(String ProdID) : returns the Product details if the file contains any product with the
product ID ‘ProdID’ passed as a parameter to the function.
void updateProduct(String ProdID): updates the details of the Product having the product ID as ‘ProdID’

Page 3|5
CLASS XI COMPUTER SCIENCE PROJECT WORK, 2023 - 24 DON BOSCO SCHOOL LILUAH

int countProd( ) : returns a count of the number of Products stored in the file.
Write a menu driven main( ) to invoke the above functions to perform the above mentioned functions.

Program 7
Write a program to read the contents of text file named “Para.txt” and do the following :
a) count and display the number of sentences,
b) display the sentence having the maximum number of words present in it,
c) count and display the number of words starting with a vowel,
d) display the frequency of longest word within the file.

Program 8
Write a program to write the following details of a student into a binary file(“Student.bin”) and do the
following operations on the different records of students stored in the file:

a) write the details of the student(Stud_ID, S_Name,Eng, Maths, Sc, SSc) – [all subject marks
accepted are out of 100 ]
b) Display the contents of the binary file.
c) Search for a specific student with an ID, accepted from the user.
d) Edit the marks obtained in the subjects for a student whose ID is accepted from the user.
e) Display the list of Students in Descending order of their Percentage marks.
f) Remove the details of a specific student whose ID is accepted from the user.

Program 9
A sentence is terminated by either “ . ” , “ ! ” or “ ? ” followed by a space. Input a piece of text consisting of
sentences. Assume that there will be a maximum of 10 sentences in a block.

Write a program to:

(i) Obtain the length of the sentence (measured in words) and the frequency of vowels in each sentence.

(ii) Generate the output as shown below using the given data

Sample data:

INPUT

HELLO! HOW ARE YOU? HOPE EVERYTHING IS FINE. BEST OF

Page 4|5
CLASS XI COMPUTER SCIENCE PROJECT WORK, 2023 - 24 DON BOSCO SCHOOL LILUAH

LUCK.

OUTPUT

Sentence No. of Vowels No. of words

---------------------------------------------------------- ---------------------------

1 2 1

2 5 3

3 8 4

4 3 3

Program 10
A set is a collection in which there is no duplication of elements. A multi set is- single dimension collection
in which elements can be duplicated. For example s = {1, 2, 3, 4} is a set with integer elements. While ms
={1,2,3,1,3} is a multi set. Following are some member functions of the class Multiset (which defines multi
sets with integer elements)
Class name: Multiset .
Data members/ instance variables:
integers arr[] array integer, integer size is number of elements in array.
Member functions/methods: -
Multiset( ) //constructor,
void readlist( ) //to input integers ,
void displaylist( ) //to display the integers,
int isSet() //which returns 1 if the multiset object is a set otherwise return 0.
void convert()// converts a multi set into set.
Define class with all member function do not write main().

*************** End of Project ***************

Page 5|5

You might also like