Академический Документы
Профессиональный Документы
Культура Документы
Question 1 .Write a program to declare a matrix A [][] of order (MXN) where ‘M’ is the
number of rows and ‘N’ is the number of columns such that both M and N must be greater
than 2 and less than 20. Allow the user to input integers into this matrix. Perform the
following tasks on the matrix:
Display the input matrix
Find the maximum and minimum value in the matrix and display them along with their
position.
Sort the elements of the matrix in ascending order using any standard sorting technique and
rearrange them in the matrix.
Output the rearranged matrix.
Sample input Output
INPUT:
M=3
N=4
Entered values: 8,7,9,3,-2,0,4,5,1,3,6,-4
Original matrix:
8 7 9 3
-2 0 4 5
1 3 6 -4
Largest Number: 9
Row: 0
Column: 2
Smallest Number: -4
Row=2
Column=3
Rearranged matrix:
-4 -2 0 1
3 3 4 5
6 7 8 9
Question 2:
Class matrix1 and matrix2 are declared to manage matrix operations. The details of both the
classes are as follows:
Class name : matrix1[base class]
Data members/instance variables:
a[][] : double subscripted array .
b[][] : double subscripted array.
m, n : (integers)-as number of rows & columns of a [ ] [ ]
r, c : (integers)-as number of rows & columns of b [ ] [ ]
Member functions/methods:
matrix() : a constructor data members.
void readLimit( ) : to input values of m, n, r, c as number of rows&columns of a[][],b[ ] [ ]
(1)
Last date of submission :30/09/2018
ISC COMPUTER PROJECT (2018-19)
Question 3:
A String is Decoded by converting each first letter of each word in Uppercase and other in
lower case and reversing and printing column wise in following format .WAP to input any
string in mix case separated by single blank space and Decode in above format.
Sample input:
Output :
d x n k e
e o w c h
p F o i T
m r u
u B Q
J
Question 4
Input any WORD in upper case only and if user input any String with spaces then print an
error message else print the word in following format such that last character should be in
lower case
Sample input
(2)
Last date of submission :30/09/2018
ISC COMPUTER PROJECT (2018-19)
Output :
AAAAAAA
A BBBBBA
A BCCCBA
A BCd CBA
A BCCCBA
A BBBBBA
AAAAAAA
Output :
GGGGG
GOOOG
GO dOG
GOOOG
GGGGG
Question 5. A Smith number is a composite number, the sum of whose digits is the sum of
the digits of its prime factors obtained as a result of prime factorization (excluding 1). The
first few such numbers are 4, 22, 27, 58, 85, 94, 121
Example
1. 666
Prime factors are 2, 3, 3 and 37
Sum of the digits are (6+6+6)=18
Sum of the digit of the factors (2+3+3+(3+7)=18
2. 4937775
Prime factors are 3, 5, 5 and 65837
Sum of the digits are (4+9+3+7+7+5)=42
Sum of the digit of the factors (3+5+5+(6+5+8+3+7))=42
Write a program to input a number and display whether the number is a smith
number or not.
Sample data
Input 94 output SMITH Number
Input 102 Output NOT SMITH Number
Input 666 Output SMITH Number
Input 999 Output NOT SMITH Number
(3)
Last date of submission :30/09/2018
ISC COMPUTER PROJECT (2018-19)
Specify the class format and also write the main( ) function.
Question 6 WAP to store ‘N’ different numbers in SDA where ‘N’ is always odd. Arrange
them in such a way that the highest element should be in the middle position, second
highest element to the left side of it, third highest to the right hand side and so on...
Input : 71, 40, 69, 56, 19, 31, 85, 99, 23, 91, 59
Output: 23, 40, 59, 71, 91, 99, 85, 69, 56, 31, 19
Class members are specified below:
Class name: arrange
Data member
arr[] : integer type
brr[] : integer type
size : integer type variable to store size of array
Member Function
Arrange(int n) : parameterized constructor to initialize n to size
void input() : function to input an array of specified size.
void arrange() : to arrange them in such a way that the highest element should be in the
middle position, second highest element to the left side of it, third highest to the right hand
side and so on... and store in brr[ ].
void display() : function to display the array before and after arrangement.
Specify the class arrange and also write the main( ) function.
Question 7. A principal of a school needs to find the highest and lowest marks scored by
the student and also merit list on marks from highest to lowest in a class of 50 students. The
classes student and meritlist are declared for above activities with following details where
student is base class and meritlist is derived class
Class name : student
Data members/instance variables:
tot[ ] : (DOUBLE) an array to store total marks of 10 students out of
500 each
stud[] : string array to store name of 10 students of a class
Member functions/methods:
void readdetails( ) : to input names and marks of 10 students. Marks
are given
out of 500 each if user has inputted greater than
500 then
your program should re enter marks.
void printresult ( ) : to print students scoring highest and lowest marks
in the
(4)
Last date of submission :30/09/2018
ISC COMPUTER PROJECT (2018-19)
Question 9. A class Date has been defined to handle Date related function i.e. finding the
future date n days after the current date i.e. Date 32 days after 01-01 will be 02-02. Finding
the number of days between the current date and date on which a project ends.
Example: if a project started 01-01 and finished on 02-02, the number of days would be
32.you may assume that that all the dates are in the year 2018 only and are valid dates. To
make calculation easy each date can be converter to its equivalent date number. date
number is the number of days between 1st January (01-01) and the given date(dd-mm).
example: date (dd-mm) date number
01-01 1
20-01 20
02-02 33
03-03 62
…
…
31-12 366
Some of the functions/methods in Date are shown below:
Class name: Date
(5)
Last date of submission :30/09/2018
ISC COMPUTER PROJECT (2018-19)
Question 11 Class ascending contains integers. Some of the member function of ascending
are given below:
Class name: ascending
Data member
int a[]: an array to store integer
int size: size of array
Member function
ascending (int n) :constructor to create an array of size n
void input() :to input array
void sort() :to sort the list
void displaylist() :to display list of integers
ascending merge(ascending obj):to merge the ascending list obj with the current ascending
list which is sorted in ascending order.
(6)
Last date of submission :30/09/2018
ISC COMPUTER PROJECT (2018-19)
Note: while generating the final ascending list both the original ascending list must be
scanned only once. Element common to the two list should appear only once in third
ascending list.
Specify the class Ascending giving the details of the function . Write main() function also.
void addLast():adds the new printing jobs to the end of last jobs ,if possible, otherwise display
the message “job
is full ,cannot add any more”
void removeLast():removes the job from the last if the job is not empty, otherwise display the
message “job is empty”
void addFirst():adds the printing jobs to the first index if possible ,otherwise display the
message “job is full ,cannot add any more”
void removeFirst():remove the printing job from the front if the job is not empty , otherwise
display the message “job is empty”
Also write main() for above class.
Question 13. Define a class Duplicate to pack an array of 10 integer which are sorted(to pack
means to remove all duplicates from the array). For example, if the given array has the
following sorted number:
INPUT:1 2 3 3 4 4 4 5 6 6 the resultant array should contain each elements ones.
OUTPUT:1 2 3 4 5 6
Some of the members of the class are given below:-
Class name: Duplicate
Data members
num[]:integer array with 10 integer sorted order
size:to store the size of array.
(7)
Last date of submission :30/09/2018
ISC COMPUTER PROJECT (2018-19)
Functions/methods:
void readList() :to enter elements of the array in sorted order.
void packList():to remove the duplicates from the array.
void dispList() :to display the array of integer without the duplicates.
Specify the class duplicates giving the details of the function void readList) , void packList()
and void dispList().The main function need to be written.
Student
Name
Address
Rollno
CommerceStudent
MarksAcc,MarksEco
ScienceStudent
MarksPhy,MarksMaths
Above classes are showing datamembers.Student class has all its data members as
protected
But CommerceStudent and ScienceStudent has its data members as private
Write constructors for passing various attributes for all the three classes and Average( ) for
the class CommerceStudent and ScienceStudent which returns average marks Also write
display( ) for all the three classes to display the data members and average too.
Write main( ) for above class.
(8)
Last date of submission :30/09/2018
ISC COMPUTER PROJECT (2018-19)
Question 15. Design a program which accepts your date of birth in dd mm yyyy format.
Check whether the date entered is a valid date or not. If it is valid, display “VALID
DATE”. Also compute and display the daYnumber of the year for the date of birth. If it is
invalid, display “INVALID DATE” and then terminate the program.
Test your program with the sample data and some random data:
EXAMPLE 1:
INPUT Enter your date of birth in dd mm yyyy format
05
01
2010
OUTPUT : VALID DATE
5
EXAMPLE 2:
INPUT Enter your date of birth in dd mm yyyy format
03
04
2010
OUTPUT : VALID DATE
93
EXAMPLE31:
INPUT Enter your date of birth in dd mm yyyy format
34
06
2010
OUTPUT : INVALID DATE
(9)
Last date of submission :30/09/2018