0% found this document useful (0 votes)
27 views7 pages

All Evaluation Question

Hhhh

Uploaded by

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

All Evaluation Question

Hhhh

Uploaded by

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

 Consider a scenario where you're developing a messaging application with

classes for sending messages via Email, SMS, and Push Notification. By using ab-
stract class and develop a C++ program to implement details of each message
sender class.
 Suppose you're designing a framework for implementing different types of data
structures: Lists, Stacks, and Queues. How would you use abstract classes and de-
sign contracts to enforce specific behaviors and functionalities that all data struc-
tures must adhere ?
 Consider a scenario where you're developing a framework for different types of
vehicles: Car, Truck, and Motorcycle. Each vehicle type has specific methods for
starting, stopping, accelerating, and braking. How would you design an abstract
class to ensure that each vehicle type implements only the methods relevant to
it?
 Design a class hierarchy to represent the different types of materials in the
library management system. Create a base class called "Material" and derive
classes for specific material types like "Book," "DVD," and "Magazine."
Implement the necessary member functions and data members to support the
functionality described in the scenario. Use appropriate access specifiers and
demonstrate the principles of inheritance, polymorphism, and encapsulation.

 Design a class hierarchy to represent the different types of products in the


online shopping platform. Create a base class called "Product" and derive
classes for specific product types like "Electronics," "Clothing," and "Books."
Implement the necessary member functions and data members to support the
functionality described in the scenario. Use appropriate access specifiers and
demonstrate the principles of inheritance, polymorphism, and encapsulation.

 Design a class hierarchy to represent the different types of tickets in the ticket
booking system. Create a base class called "Ticket" and derive classes for
specific ticket types like "RegularTicket" and "VIPTicket." Implement the
necessary member functions and data members to support the functionality
described in the scenario. Use appropriate access specifiers and demonstrate
the principles of inheritance, polymorphism, and encapsulation.

 Design a class hierarchy to represent the different types of employees in the


restaurant management system. Create a base class called "Employee" and
derive classes for specific employee types like "Waiter," "Chef," and "Manager."
Implement the necessary member functions and data members to support the
functionality described in the scenario. Use appropriate access specifiers and
demonstrate the principles of inheritance, polymorphism, and encapsulation.

 Design a class hierarchy to represent the different types of users in the music
streaming application. Create a base class called "User" and derive classes for
specific user types like "RegularUser" and "PremiumSubscriber." Implement the
necessary member functions and data members to support the functionality
described in the scenario. Use appropriate access specifiers and demonstrate
the principles of inheritance, polymorphism, and encapsulation.
 Create a program for managing real estate property listings using inheritance.
Design a base class "Property" with attributes like address and price. Derive
classes like "House" and "Apartment”. Write a CPP program to ask the user
which property he/she wants to buy and display the rate of property.
 Develop a CPP program for scheduling healthcare appointments using
inheritance. Design a base class "Appointment" with attributes like date, time,
and patient name. Derive classes like "DoctorAppointment" and
"LabAppointment." Display all the Doctor Appointments and Lab Appointments.
 Design a system for booking hotel rooms using inheritance. Create a base class
"Room" with properties like room number and price. Derive classes like
"StandardRoom" and "Suite." Implement features like room availability and
booking confirmation and display appropriate information.
 Create a CPP program to manage airport operations using inheritance. Design a
base class "Flight" with properties like flight number and departure time. Derive
classes like "DomesticFlight" and "InternationalFlight." Handle seat reservation
for passengers and display reserved seats for both type of flights.
 Implement a system for tracking employee training using inheritance. Design a
base class "TrainingProgram" with attributes like title, duration, and trainer.
Derive classes like "TechnicalTraining" and "SoftSkillsTraining." Display
candidates for Technical training and Softskills training.
 You are asked to develop a program for Home-delivery company. The
company delivers items to different types of customers, like Regular
customer, Premier customer and New customers. Company offers
different schemes in delivery charges. Create base class as Customers
and different types of customers as derived ones. Write a CPP program
for the above given scenario and display delivery charges.
 Imagine a situation where you have a base class Vehicle with protected
member variables speed and acceleration. Now, you want to derive a
class Car from Vehicle. Write a CPP program to access these protected
members.
 Imagine a situation where you have a class Person with private member
variables name and age. Now, you want to create a class Employee that
inherits from Person to reuse its properties. And calculate employee’s
salary. Write a C++ program for above given scenario.
 Design a class hierarchy to represent the different types of products in
the online shopping platform. You have different products like
"Electronics," "Clothing," and "Books”. Each product should have a
specific billing.

 Design a class hierarchy to represent a hospital employee. Employee can


be a doctor, nurse, receptionist. Only doctor should know the health
problem of patient. Receptionist has to do only billing. Nurses will guide
the patient about taking medicine. Write a CPP program for the given
scenario.
 Consider a scenario where you're developing a messaging application with
classes for sending messages via Email, SMS, and Push Notification. By using
abstract class and develop a C++ program to implement details of each message
sender class.
 Suppose you're designing a framework for implementing different types of data
structures: Lists, Stacks, and Queues. How would you use abstract classes and
design contracts to enforce specific behaviors and functionalities that all data
structures must adhere ?
 Consider a scenario where you're developing a framework for different types of
vehicles: Car, Truck, and Motorcycle. Each vehicle type has specific methods for
starting, stopping, accelerating, and braking. How would you design an abstract
class to ensure that each vehicle type implements only the methods relevant to
it?
You're working on a game engine that supports both 2D and 3D graphics. You have
classes representing objects in the game world, such as GameObject and
GameObject3D. How would you use an abstract class and multiple inheritance to
handle common functionalities while allowing specific behaviors for both 2D and 3D
objects?
1. You're designing a program for a university where there are different types of
courses: Math, Physics, and Literature. Each course has common attributes
like name, code, and credits, but also specific behaviors like calculateGrade().
How would you design a virtual class to handle these different course types?

2. In a banking system, you have a class representing a bank account with private
member variables like balance and account number. You want to implement a
function to transfer funds between two accounts. How would you use a friend
function to accomplish this securely while maintaining encapsulation?
3. Imagine you have a base class called Vehicle and derived classes like Car and
Bike. You want to implement a maintenance system that needs access to the
private members of both the base and derived classes. How would you use a
friend class to achieve this?

4. You're developing a messaging application with classes for users and messages.
To ensure security, you want to restrict access to certain message data only to
authorized users. How would you use a friend class to grant access to sensitive
message information while preventing unauthorized access from other parts of
the application?
5. Create a base class called Employee with virtual functions called calculateSalary() and
displayInfo(). Create two derived classes called Manager and Developer that inherit from
the Employee class. Implement the calculateSalary() function in each derived class to
calculate the salary of a manager and developer respectively. Implement the display-
Info() function in each derived class to display the information of a manager and devel-
oper.
6. Create a class called Point with private data members x and y. Create a friend function
called calculateDistance() that takes two Point objects as parameters and calculates the
distance between them using the distance formula. Display the distance between two
points in the main function.
7. Create a class called Time with private data members hours and minutes. Create a
friend class called Converter that has a function convertToMinutes() which takes a Time
object as a parameter and converts the time into minutes. Display the converted time in
minutes in the main function.

Create a class called Matrix with private data members rows, cols, and elements. Create a
friend class called MatrixOperations that has functions to add two matrices, multiply two
matrices, and display a matrix. Display the result of adding and multiplying two matrices in
the main function.

1. You're designing a payroll system for a company with different types of


employees: Full-time, Part-time, and Contractual. Each employee type has a
different method for calculating salary based on hours worked, hourly rate, and
additional benefits. How would you use virtual functions to ensure that the
correct salary calculation method is called for each employee type?
2. You're building a program to manage a library with various types of items:
Books, DVDs, and Magazines. Each item can be borrowed and returned, but
the due date calculation for each type differs. How would you use virtual
functions to ensure that the correct due date calculation method is invoked
when an item is borrowed?
3. You're developing a messaging application with classes for users and messages.
To ensure security, you want to restrict access to certain message data only to
authorized users. How would you use a friend class to grant access to sensitive
message information while preventing unauthorized access from other parts of
the application?
4. You're developing a framework for building different types of reports: Sales
Report, Financial Report, and Inventory Report. Each report requires gathering
data, processing it, and generating output in a specific format. Use an abstract
class and develop behaviour of all the classes.
5. Write a C++ program that takes two integers from the user and performs division.
Handle the case where the user tries to divide by zero using a built-in exception.
6. Write a C++ program that reads an integer from the user. If the user inputs a non-
integer value, handle the exception using built-in exceptions.
7. Write a C++ program that accesses an array element by index. If the index is out of
bounds, handle the exception using a built-in exception.

Write a C++ program that reads a file. If the file does not exist, handle the exception using a
built-in exception.

1. You are working on a program that uses dynamic memory allocation, and you want to handle the case
where the memory allocation fails. How would you use exception handling to handle the memory al-
location errors in your program?
2. You are writing a program that processes user input, and you want to handle the case where the user
enters invalid input. How would you implement exception handling to handle the invalid input in
your program?
3. You are working on a program that calls several functions, and you want to handle exceptions that
may be thrown by these functions at different levels of the call hierarchy. How would you design your
exception handling strategy to propagate and handle exceptions across multiple levels of function
calls?
4. You are writing a program that performs a division operation, and you want to handle the case where
the divisor is zero. How would you implement exception handling to catch the division-by-zero error
in your program?
5. You're writing a function to read data from a file. The function needs to open the file,
read the data. Write a CPP program to handle the exception in case you are not able to
open the file.
6. Your program asks the user to enter a mobile number. You need to ensure that the in-
put is valid. Write a CPP program to handle the exception for invalid mobile number.

7. You're working with dynamically allocated memory using new. Write a CPP program to
handle the exception for memory allocation.

Imagine you are storing data in a stack. Write a CPP program to handle the exception during
the stack is empty.

1. You are asked read password from user. The password should be 10 characters and
first two characters should be numbers. Write a CPP program to handle exception if the
password is not according to pattern.
2. Write a CPP program to open a file in write mode. If you are not able to open the file
then handle the exception using built-in exception.
3. Write a CPP program to perform stack operations. Handle the exception for stack empty
by creating your own exception class.

Write a CPP program to show out_of_range built-in exception.

1. You are working on a program that needs to store and manage a collection of multimedia files, includ-
ing images, videos, and audio files. Write a CPP program to design a class hierarchy in C++ to repres-
ent different types of multimedia files and implement methods for playing these files.
2. You are asked to generate daily sales report according to the item purchased. Items can be Gold, Sil-
ver and Diamods. Each item has specific rate and different tax rates. Write a CPP program by creating
an abstract class of items, which has generate report method.

3. You are managing a movie database, which has information like moviename, rating(1-
5), type of movie. Write a CPP program to create an array of movie objects and print the
highest rate movie.
A reputed bank wants a program to be designed for handling loans section. People will be
applying for different types of loans, such as Education, House Construction, and Vehicle.
Depending on the bank balance and income of the applicant bank has to decide whether a loan
can be given or not. Write a CPP program for the given task. Mention which OOP concept is
used in your code with justification.

1. A medical clinic has a different 'HealthCareProvider' that represents general healthcare professionals,
such as doctors, nurses, and lab technicians. All 'HealthCareProvider' have common attributes and
methods, such as name, license number, and the ability to perform medical procedures. You are asked
to write a CPP program to represent the specific responsibilities of each healthcare professional.
2. Suppose you are working on a banking application where you need to create different types of ac-
counts, such as savings, checking, and investment. How would you use an abstract class called Ac-
count with common methods like deposit() and withdraw() that each type of account can override to
implement their specific functionalities?
3. You are developing a social networking application where users can create profiles, send
friend requests, and view their friends list. Userprofile class has private members like
useName, email, friends. Socialnetwork class has users as private member.

Implement the UserProfile class with methods to add a friend and display the profile.
Implement the SocialNetwork class with methods to add users and manage friend requests.
Ensure that the SocialNetwork class can access the private members of UserProfile to add
friends.
Include a main function to demonstrate the functionality by creating several user profiles and
managing friendships between them.

You are developing a data processing application that can handle different types of data, such as
integers, floating-point numbers, and strings. You are supposed to make the application versatile and
reusable, by using template functions in C++. Write functions to find the max , to find the average and
print the values.

1. You are working on a program that needs to store and manipulate data for different levels(Primary
school, high school, Degree) of student records. Write a CPP program to handle students, including
their name, student ID, and grades for multiple subjects? Use Inheritance and abstract class/method.

2. Write a CPP program to calculate the salary of full-time and part-time employees using inheritance.
Handle exception if user enters his/her basic in 5digit number.

3. Write a CPP program to book different types of appointments like doctor, officials,
business, lawyer using the template function.

You are handling the police station complaint section. There will be different levels of officers.
Only Inspector and SubInspector should be able to see all the details of complaint, where as
normal police can access only the person name not the detail of complaint. Use friend class to
develop this program.

You might also like