Subscribe to Get Free Material Updates!
Visit my new blog WebData Scraping - Web Scraping Service provider company in India.

Programming skills-III (OOCP) 1/5


1.Write a program which illustrates the use of scope resolution operator.
Shared By : Master Pankaj Sharma (JVIMS College Jamnagar )
#include<iostream.h>
#include<conio.h>
class example
{
 public :
      static int a;
};
int example::a=10;
void main()
{
     clrscr();
     int a=20;
 {
  cout<<"\nWITHOUT SCOPE RESOLUTION(LOCAL VALUE):"<<a<<endl;
  cout<<"\nUSING SCOPE RESOLUTION:"<<example::a<<endl;
  int a=100;
  cout<<"\n=========================\nAFTER CHANGING LOCAL VALUE\n===========================\n";
  cout<<"\nWITHOUT SCOPE RESOLUTION(LOCAL VALUE)"<<a<<endl;
  cout<<"\nUSING SCOPE RESOLUTION"<<example::a<<endl;
 }
 getch();
}

2.Define a class to represent a bank account. Include the following members :
DATA MEMBERS
        Name of depositor, Account Number, Type of Account
MEMBER FUNCTIONS
        To assign initial values
        To Deposit the amount
        To withdraw an amount after checking the Balance amount in account
        To display name and balance

Shared By : Master Pankaj Sharma (JVIMS College Jamnagar ) Show Program/Hide Program  

3.Demonstrate the use of static variables in a class by using it to count the number of objects created in the program
Shared By : Master Pankaj Sharma (JVIMS College Jamnagar ) Show Program/Hide Program  

4.Write a program that calculates the value of m raised to power n for both int and double
data types. (Use the concept of function overloading).
 Shared By : Master Pankaj Sharma (JVIMS College Jamnagar ) Show Program/Hide Program

5.Write a class to represent a vector. Include member functions to perform the following
              1. To create the vector
              2. To modify the value of a given element
              3. To multiply by a scalar value
              4. To display the vector in the form(10,20,30...)
Shared By : Kothari Keval  (JVIMS College Jamnagar ) Show Program/Hide Program

Programs:  1-5    6-10   11-15    16-20   21-30  31-35  35-38

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes