Exam Details

Subject lab ii — (c++ programming)
Paper
Exam / Course b.sc. (cs)/b.sc. (cs) (lateral)
Department
Organization Alagappa University Distance Education
Position
Exam Date May, 2018
City, State tamil nadu, karaikudi


Question Paper

DISTANCE EDUCATION
B.Sc. Computer Science/B.Sc. Computer Science (Lateral)
DEGREE EXAMINATION, MAY 2018.
LAB II — PROGRAMMING)
(2007 onwards)
Time Three hours Maximum 100 marks
Examiner has to select ONE question and give it to the
student by LOT system.
Each sub division carries 50 marks.
1. Using dynamic constructors, write a program
to concatenate two given strings.
Create a class for a stock item abstract data
type. It should have the attributes of stock levels
(an integer) and unit price float). Define the
methods to return the values of these two attributes
and to set them using parameters. Add two more
methods to allow stock receipts and issues updating
the stock level as appropriate Write a menu driven
program to solve the problem.
Sub. Code
26
DE-7016
2
wk10
2. Using operator overloading, write a program to
find the different and total length of given two
various tubes specified in meters and centimeters.
Write a function called reversit( that reverse a
string (an array of char). Use a for loop that swaps
the first and last characters, then the second and
next-to-last characters and so on. The string should
be passed to reversit( as an argument. Write a
program to exercise reversit( The program should
get a string from the user, call reversit( and print
out the result. Use an input method that allows
embedded blanks. Test the program with
Napolean's famous phrase "Able was I ere I saw
Elba".
3. Write a temperature conversion program that gives
the option to the user for selecting either conversion
of Fahrenheit to Celcius or Celcius to Fahrenheit
Then, get the input and carry out the conversion.
Use floating point numbers.
Create a class called employee that contains a name
and an employee number. Include a member
function called getdata( to get data from the user,
another function called putdata( to display the
data. Write a main() program to exercise this class.
It should create an array of type employee and then
invite the user to input data for n employees.
DE-7016
3
wk10
4. Write a program to reverse the sentence and
check whether find the given sentence is
palindrome or not.
Create a class that imitates part of the functionality
of the basic data type int. Call the class Int. The
only data in this class is an integer variable. Include
member functions to initialize an Int to zero, to
initialize it to an integer value, to display it, and to
add two Int values. Write a program that exercise
this class by creating two initialized and one
uninitialized Int values, adding these two initialized
values and placing the sum in the uninitialized
value, and then displaying the result.
5. Assume you want to generate a table of multiples of
any given number. Write a program that allows the
user to enter the number, and then generates the
table, formatting it into ten columns and 20 lines.
Imagine a publishing company that markets both
books and audio-cassette versions of its works.
Create a class PUBLICATION that stores the title
string) and price (type float) of a publication.
From this class derive two classes: BOOK, which
adds a page count (type int). and TAPE, which adds
a length count (type Each of these three classes
should have a getdata() function to get its data from
the user at the keyboard, and a putdata() function
to display its data. Write a main( program to test
the book and tape classes by creating instances of
them, asking the user to fill in their data with
getdata( and then displaying the data with
putdata(
DE-7016
4
wk10
6. Using Pointers, create a class and write a program
to get n names and display them in sorted order.
Create a class DONOR that contains donor number,
donor name, age, address, sex, and blood group.
Write a Menu driven program to display the
number, name and address of the donors for the
following categories:
Blood donors having the blood group
Blood donors in the age group between 16 to
25
Female donors having blood group A in the
age between 19 and 24.
7. Write a program using friend function frifunc(
which can act on the classes alpha and beta. Using
constructors fix the values for alpha and beta.
Write a program which will accept a string of
10 characters in length from the key board and
count the occurrences of each of the five vowels in
the string. The output p should be in a (tapped)
format similar to this example.
A E I O U
0 1 0 0 1
8. Write a temperature conversion program that gives
the option to the user for selecting either conversion
of Fahrenheit to Celcius or Celcius to Fahrenheit.
Then, get the input and 5 carry out the conversion.
Use floating point numbers.
Write a function called reversit( that reverse a
string (an array of char). Use a for loop that swaps
the first and last characters, then the second and
next-to-last characters and so on. The string should
be passed to reversit() as an argument. Write a
program to exercise reversit( The program should
get a string from the user, call reversit( and print
out the result. Use an input method that allows
embedded blanks. Test the program with
Napolean's famous phrase "Able was I ere I saw
Elba".
————————


Subjects

  • application programs
  • computer graphics
  • internet programming
  • lab ii — (c++ programming)
  • lab iii — application programs
  • lab iv (visual basic and oracle)
  • lab v — java programming
  • object oriented programming and c++
  • operating systems
  • rdbms
  • visual programming