BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

Register FAQ Community Calendar New Posts Navbar Right Corner
HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Information Technology > BsIT 3rd Semester > Object Oriented Programming

Object Oriented Programming By Mam Sidra Malik


Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 4.00 average. Display Modes
  #1  
Old 19-09-2008, 05:19 PM
shmsa's Avatar
Grown up punk

 
Join Date: Oct 2007
Location: Muslim Town Multan
Posts: 195
Contact Number: 0322-6196713
Program / Discipline: BSIT
Class Roll Number: 07-22
shmsa is a jewel in the roughshmsa is a jewel in the roughshmsa is a jewel in the roughshmsa is a jewel in the rough
Cool Class's & Objectess at 19 Program By Mam.

Code:
#include<stdio.h>
#include<iostream>
using namespace std;
class time
{
private:
 int hours;
 int minutes;
 int seconds;
 int sum;
 //static int count;
public:
 time()
 {
  hours=10;
  minutes=10;
  seconds=10;
  sum=0;//count=0;
  //count++;
 }
 time(int var1,int var2,int var3)
{
 hours=var1;
 minutes=var2;
 seconds=var3;
}
 void showtime()
 {
 
  cout<<hours<<":"<<minutes<<":"<<seconds<<"    count is "<<endl;
 
 
 }
 void power()
 {
  int pow=1;
  for(int i=0;i<=10;i++)
   pow=pow*2;
  cout<<pow<<endl;
 
 }
 void power(int var1)
 { 
  int pow=1;
  for(int i=0;i<=10;i++)
   pow=pow*var1;
  cout<<pow<<endl;
 
 
 }
/* int power(int var3)
 {
  int pow=1;
  for(int j=0;j<=10;j++)
   pow=pow*var3;
  return pow;
 
 
 }*/
 void power(int var2,float var3)
 {
  int pow=1;
  float val=0.0;
  for(int i=0;i<=10;i++)
   pow=pow*var2;
  val=pow*var3;
 cout<<val<<endl;
  
 
 
 
 }
 
 void power(float var4)
 {
  float pow=1.0;float val2;
  for(int i=0;i<=10;i++)
  pow=pow*var4;
  val2=pow*2.0;
  cout<<"value is"<<val2<<endl;
 }
 void func2();

};
void time::func2()
{
 cout<<"you are in function 2"<<endl;
} 
int main()
{
 time t1;int var1=3,var4;float val3=2.0;
 //t1.showtime();
 time t2;
 time t3,t4;
 //t4.showtime();
 t1.func2();
 //.power();
 //.power(var1);
 //.power(2,3.0);
 //.power(val3);
 return 0;
}

Reply With Quote
  #2  
Old 14-10-2008, 01:53 AM
.BZU.'s Avatar


 
Join Date: Sep 2007
Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute
Default Re: Class's & Objectess at 19 Program By Mam.

This program is also describing the Function Overloading..
i.e: program has same functions but different body, and the main function distinguish these same name functions by comparing the arguments in the function.
Samjhay....
__________________
(¯`v´¯)
`*.¸.*`

¸.*´¸.*´¨) ¸.*´¨)
(¸.*´ (¸.
Bzu Forum

Don't cry because it's over, smile because it happened
Reply With Quote
Reply

Tags
c++, class, lectures, mam, objectess, program


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Commencement of Class Work for BSc Engineering Evening Program 2011 BZU Salman Mushtaq University News and Events 0 20-12-2011 06:46 PM
Proposal of a 3th class boy to 9th class girl. usman_latif_ch Funny Cut Piece 0 02-11-2011 07:13 PM
C-Sharp Program Double Linked List (All Functions In One Program) thecool Visual Programming 0 17-06-2011 08:58 PM
Class Design in C++ bonfire Introduction to Computing 0 26-02-2011 11:10 PM
CCNA Class... Ali Riaz Alumni/Careers/Jobs 7 05-06-2009 08:23 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 05:29 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.