You are on page 1of 1

Computer Programming Lab External Exam Section: A1 Paper 1

1. Define a class serial in C++ with the following specifications:


Private members:
Serialcode integer
Title 25 character
Duration float
Noofepisode integer

Public members:
A constructor to initialize the duration as 30 and Noofepisodes as 10.
Newserial function to accept values of serialcode and title.
Otherenteries function to assign values of duration and noofepisodes with help of corresponding values passed as
parameter to the function.
Displaydata function to display all data members.

2. Write a C program to find the sum of individual digits of a positive integer.

Computer Programming Lab External Exam Section: A1 Paper 2


1. Write a C++ program to compute calculator using classes. Derive a class ARITHMATIC that calculates
addition, subtraction, multiplication and division while another class TRIGO that calculates sin, cos and tan values
and the last class MISC that calculates power and square root of the numbers. User must input the type of operation
to be performed. Hint. USE SWITCH CASE.

2. Write a C program to check whether a string input by user is a palindrome or not.

Computer Programming Lab External Exam Section: A1 Paper 1


1. Define a class serial in C++ with the following specifications:
Private members:
Serialcode integer
Title 25 character
Duration float
Noofepisode integer

Public members:
A constructor to initialize the duration as 30 and Noofepisodes as 10.
Newserial function to accept values of serialcode and title.
Otherenteries function to assign values of duration and noofepisodes with help of corresponding values passed as
parameter to the function.
Displaydata function to display all data members.

2. Write a C program to find the sum of individual digits of a positive integer.

Computer Programming Lab External Exam Section: A1 Paper 2


1. Write a C++ program to compute calculator using classes. Derive a class ARITHMATIC that calculates
addition, subtraction, multiplication and division while another class TRIGO that calculates sin, cos and tan values
and the last class MISC that calculates power and square root of the numbers. User must input the type of operation
to be performed. Hint. USE SWITCH CASE.

2. Write a C program to check whether a string input by user is a palindrome or not.

You might also like