Thursday, May 6, 2021

CPP Slip

Slip 1

 a. Write a cpp Program to check maxium and minium of two integers numbers(Use inline Function and conditional operator ) 

 b. Create a C++ class MyFile with data members file pointer and filename. Write necessary member functions to accept and disp lay File . Overload the following operators

Operator        Example          Purpose

+          F3=F l+F2    Concatenate the contents of file F1 and F2 in F3

             !F3                  Chan ges the case of alternate characte rs of file F3.                                                                                                                                  [Marks 25]

Slip 2

a)  Write a C++ program to find volume of cylinder, cone and sphere. (Use function overloading).                                                                                                  [Marks 15]
 

b)  Write a C++ program to create a class Movie with data members M_Name, Release_Year, Director_Name and Budget. (Use File Handling) Write necessary member functions to:
1.       Accept details for 'n'  Movies from user and store it in a file "Movie. bet" .
11.     Disp lay Movie details from a file
111.    Count the  number of objects stored in file                                                                                                                                                                                     [Marks 25]

Slip 3
a)  Write a C++ program to interchange va lue s of two int eger numbers. (Use call by reference)                                                                                                       [Marks 15]
 
b)    Write a C++ program to accept ' n' numbers  from user through Command Line Argument. Store all Even and Odd numbers in file "Even.txt" and "Odd.txt" respectively.
[Marks 25]

Slip 4

a)Write a C++ program to accept Worker information Worker_Name, No_of_Hours_worked, Pay_ Rate and Salary. Write necessa ry functions to calculate and display the salary of Worker. (Use default value for Pay_Rate)            [Marks 15]

 

b)Write a C++ program to create a base class Employee (Emp-code, name, sa lary). Derive two classes as Fulltime (daily_wages, num ber_of_days) and Parttime (number_of_working_hours, hourly_wages). Write a menu driven program to perform following functions:

1.  Accept the details of ' n ' employees and calculate the sa lary.

2.  Display the details of ' n' employees.

3.  Display the details of employee having maximum salary for both types of employees.

[Marks 25]





a)   Consider the following C++ class

class Point

{            int x,y; public:

void setpoint(int, int); void showpoint();

};

// To set the values ofx and y co-ordinate 

// To display co-ordinate of a point P in format (x, y).                                  [Marks 15]


 b)   Create a C++ base class Shape. Derive three different classes Circle, Sphere and Cylinder from shape class. Write a C++ program to calculate area of Circle, Sphere and Cylinder.  (Use pure virtual function).                                                         [Marks 25]

 

 


No comments:

Post a Comment

Slip 10. Write a jQuery code to make first word of each statement to bold.

  Slip 10. Write a jQuery code to make first word of each statement to bold.  <!DOCTYPE html> <html>   <head>     <scri...