Suppose in an exam a teacher needs to assign topics to the “n” students in two sets according to their roll numbers. For this, he has to divide the students in two groups, one containing the even roll
number, other group having odd roll number. Out of 60 students, help the teacher to identify which set (A or B) the particular student will get. Write a program for the same.
For odd roll numbers- Set A
For even roll numbers– Set B
Example: n=2
enter 2 rollnos
1st Rollno: 7
Output: Set A
2nd Rollno: 16
Output: Set B
FACTORIAL OF 5
a unique and unusual data value that is placed after all actual data is ......?
Examine what Big-O notation is and explain its role in evaluating efficiencies of algorithms. Write the Python program code for the above two algorithms and critically evaluate their efficiencies using Big-O notation.
Write a program to add two sparse matrices and the resulting matrix should be converted to a representation matrix.
Develop an algorithm to implement Stack using Queue data structure.
Develop an algorithm to implement Queue using Stack data structure.
Create a base class called Shape with two data members of double type
which could be used to compute the area of figures. Derive two specific
classes called Triangle and Rectangle from the base class Shape. Add to the
base class, a member function called Get Data to initialize base class data
members and another member function display Area to compute and display
the area of figures. Make display Area a virtual function and redefine this
function in the derived classes to suit their requirements. Using these three
classes design a program which will accept dimensions of a triangle or
rectangle interactively and display the area.
Write a program to create a class called STUDENT with data members Roll
Number, Name and Age. Using inheritance, create the classes
UGSTUDENT and PGSTUDENT having fields a semester, fees and
stipend. Enter the data for at least 5 students. Find the average age for all
UG and PG students separately.