0% found this document useful (0 votes)
35 views3 pages

ATSS's Institute of Industrial & Computer Management & Research, Nigdi. Academic Year - 2019-2020 MCA I - Semester - I LAB Assignment

The document contains 20 programming assignments involving problems related to C++ programming concepts like classes, objects, functions, recursion, etc. Some of the key problems include: 1) Write a class to represent points with methods for addition, distance calculation etc. 2) Write classes to represent time and date with relevant methods. 3) Design classes to represent bank accounts and vectors with required methods. 4) Write programs to implement games like Tic-Tac-Toe, Tower of Hanoi, and solve the 8 Queens problem using concepts like recursion.

Uploaded by

Sarita More
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
35 views3 pages

ATSS's Institute of Industrial & Computer Management & Research, Nigdi. Academic Year - 2019-2020 MCA I - Semester - I LAB Assignment

The document contains 20 programming assignments involving problems related to C++ programming concepts like classes, objects, functions, recursion, etc. Some of the key problems include: 1) Write a class to represent points with methods for addition, distance calculation etc. 2) Write classes to represent time and date with relevant methods. 3) Design classes to represent bank accounts and vectors with required methods. 4) Write programs to implement games like Tic-Tac-Toe, Tower of Hanoi, and solve the 8 Queens problem using concepts like recursion.

Uploaded by

Sarita More
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

ATSS’s

Institute of Industrial & Computer Management & Research, Nigdi.


Academic year – 2019-2020
MCA I – Semester –I
LAB Assignment
Subject : Problem Solving using C++ Programming - LAB ( IT-11 L )

Sr.
Name Of Program
No.
Write a program to check for given number
1 a) Prime
b) Pallindrome.
c) Perfect number.
a) Strong Number (Ex: n=145=> 1! + 4! + 5! = 1 + 24 + 120 = 145)
2 b) Amstrong Number (Ex:33 + 73 + 13 = 371)
c) Read number from user and print its equivalent String (Ex. 145 One Four Five)

a) Write a program to generate N prime Numbers


3 b) Write a program to sum of Series 1!+2!+3!+4!......+N!

c) Find Maximum and number from 4 numbers.


4 d) Find second maximum from given n numbers.
e) Generate Fibonacci series upto N numbers.
Write a program to print Pattern
a) 1 b) 1 c) 1 d) 0
5 12 01 12 101
123 101 12 3 21012
1234 0101 12 34 3210123
Write a program to accepting Marks of Three subject and print percentage and grade
If percentage is > = 80 O
If Percentage is between 70 to 79 Grade is A+
6 If Percentage is between 60 to 69 Grade is A
If Percentage is between 50 to 59 Grade is B
If Percentage is between 40 to 49 Grade is C
If Percentage is between < 40 Grade is F
Five candidates contest an election. The candidates are numbered 1 to 5 and the voting is done by
marking the candidate number on the ballot paper. Write a program to read the ballots and count the
7 votes cast for each candidate using an array variable count. In case, a number read is outside the range 1
to 5, the ballot should be considered as a ‘spoilt ballot’ and the program should also count the number
of spoilt ballots.

1
Define class Point with x,y,z coordinates and having following member functions
a. Constructor (Default argument , parameterized , copy)
8 b. Addition of Two points.
c. Distance between two points
d. Compare two points.
Write a program using function AREA () that is used to calculate area of triangle, rectangle,
9 pentagon, hexagon & circle. (Use function overloading).

Define class Time with Hours and minutes as members. Write a program to
a) Add two time Objects t1 and t2.
b) Modify/Change/Set time.
10 c) Find difference between two Time.
d) Convert time to 12 hrs/24 hrs.
e) Take Minutes and convert it into Time.
f) Convert Time to Minutes/Seconds

Define a class to represent a bank account. Include the following members:


Data Members –
i. Name of the depositor
ii. Account number (Auto Generated)
iii. Type of account
iv. Balance amount in the account
11 Member Functions –
i. To assign initial values
ii. To deposit an amount
iii. To withdraw an amount after checking the balance
iv. To display name and balance
v. To display total account holders.
Write a main program to test the class for handling 10 customers.
Account number must be unique for all account holders.
Write a class to represent a vector with following member functions:
a. To create the vector
12 b. To modify the value of a given element
c. To multiply by scalar value
d. To display the vector in the form (10, 20, 30…)
e. To add two vectors
Create two classes DM and DB, which store the value of distances. DM stores distances in meters
and centimeters and DB in feet and inches. Write a program that can read values for the class
13 objects and add one object of DM with another object of DB. Use a friend function to carry out the
addition operation. The object that stores the results may be a DM object or DB object depending
on the units in which the results are required.

2
Design a class string that will store array of characters provide suitable constructors and over loaded
operator
a. Operator + to concatenate two strings.
b. Length of String.
14 c. Overload unary ++ and -- opreator
d. Particular character is present or not if present return first occurrence position.
e. Operator < and > to compare two strings.
f. Operator [ ] to return ith character.
g. Operator = = to check equality of two strings
h. Insertion and Extraction operators
Define Sequence class that contains three data members length of the sequence , starting element of the
15 sequence and an array containing elements of the sequence. And Create_Seq member function that takes
length and starting element as argument, Display Function and Compare_seq function.
Design a class Employee having following data members
a. EMP_ID ,Name, Department,DateOfBirth
Write a menu driven program to do following task
16 a. Add a Employee record,
b. Display Employee record Department wise
c. Display particular Employee if EMP_Id given
d. Modify record
Use Local nested class to create data member DateOfBirth.

17 Define two classes Celsius and Fahrenheit. Write conversion function to carry out conversion from
one class type to another.

18 Write a program to implement TIC -TAC -TOE Game.

19 Write a program to implement Tower of Hanoi Game using Recursion.

20 Write a program to implement 8 queens problem of Chess.

You might also like