COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT

Slides:



Advertisements
Similar presentations
Complete Structure class Date {class Date { private :private : // private data and functions// private data and functions public :public : // public data.
Advertisements

Selection Feature of C: Decision making statements: It allow us to take decisions as to which code is to be executed next. Since these statements control.
Beauty in Recursion, Fractals Gur Saran Adhar Computer Science Department.
For(int i = 1; i
Recursion Prog #include <stdio.h> #include<conio.h> main()
Programming In C++ Spring Semester 2013 Practice 1-3 Lectures Programming In C++, Lecture 3 By Umer Rana.
What is output line of the following C++ code? Please trace int i = 1, QP; DATA: 4, B, 3, A double credit, totCredit=0.0; double num = 0.0; string LG;
Picture It Very Basic Game Picture Pepper. Original Game import java.util.Scanner; public class Game { public static void main() { Scanner scan=new Scanner(System.in);
Dynamic Memory Allocation in C.  What is Memory What is Memory  Memory Allocation in C Memory Allocation in C  Difference b\w static memory allocation.
What is shape function ? shape function is a function that will give the displacements inside an element if its displacement at all the node locations.
Introduction to Assembly language
Hand Trace and Output for: int digit = 0; int number = 1423; do { digit = number % 10; System.out.println(digit); number = number / 10; } while (number.
EC-241 Object-Oriented Programming
More About Recursion - 2 Java. Looking at more recursion in Java A simple math example Fractals.
Sort the given string, without using string handling functions.
Macro & Function. Function consumes more time When a function is called, the copy of the arguments are passed to the parameters in the function. After.
computer
Data structure and c K.S. Prabhu Letterer All Deaf Educational Technology.
 An instruction or group of instructions.  Computer executes program repeatedly for specified number of times. Or until some terminating conditions are.
Session Objectives Define Static data member Static member functions in a class Object as Function Argument Friend Function Friend Class.
FUNCTIONS AND STRUCTURED PROGRAMMING CHAPTER 10. Introduction A c program is composed of at least one function definition, that is the main() function.
Lecture 4: C/C++ Control Structures Computer Programming Control Structures Lecture No. 4.
Protectedly Inherited Base Class  When the access specifier of the base class in the derived class definition is protected, the base class is protectedly.
The Mughal Period and Painting. Mughal Dynasty ( )
Passing Structure to function.  structure to function structure to function  Passing structure to function in C Passing structure to function in C 
Computer Programming Control Structure
Building java programs, chapter 3 Parameters, Methods and Objects.
Strings program. C Program to Check if a given String is Palindrome #include void main() { char string[25], reverse_string[25] = {'\0'}; int i, length.
1 Advanced Programming Examples Output. Show the exact output produced by the following code segment. char[,] pic = new char[6,6]; for (int i = 0; i
Computer Programming A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return.
Review. Problem 1 What is the output of the following piece of code void increment(int x) { x++; } int main() { int y = 10; increment(y); cout
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Computer Programming II Lecture 4. Functions - In C++ we use modules to divide the program into smaller and manageable code. These modules are called.
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
C++ CODES PART#04 1 COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT.
Overloaded Constructors and Multiple Classes
Class and Objects UNIT II.
CONSTRUCTORS & DESTRUCTORS
Decisions Chapter 4.
LESSON 3 IO, Variables and Operators
Imagine a tollbooth at a bridge
Operator Overloading.
CSC113: Computer Programming (Theory = 03, Lab = 01)
CSC113: Computer Programming (Theory = 03, Lab = 01)
The nested repetition control structures & Continue Statements
COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
Tejalal Choudhary “C Programming from Scratch” Pointers
Tejalal Choudhary “C Programming from Scratch” Function & its types
ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
Ambiguity Resolution in Inheritance
Constructor & Destructor
COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
Cs212: DataStructures Computer Science Department Lab 3 : Recursion.
CLEANING UP UNUSED OBJECTS
COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
class PrintOnetoTen { public static void main(String args[]) {
Simulating Reference Parameters in C
PreAP Computer Science Review Quiz 08
In C Programming Language
ENGR.SABA MUGHAL FROM COMPUTER SYSTEM DEPARTMENT
Computer Security Password Policy.
CPP Programming Language
ENGR.SABA MUGHAL FROM COMPUTER SYSTEM DEPARTMENT
COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
Compile and run c files.
OOP objects and Classes Dr. Ahmed Hashim Mohammed A Simple Class
Presentation transcript:

COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT C++ CODES PART#10 COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT

A SIMPLE CLASS WITH OBJECTS // A SIMPLE CLASS #include<constream.h> class smallobj {private: int somedata; public: void setdata(int d) COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT

COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT Continue…. {somedata=d;} void showdata() {cout<<"data is"<<somedata<<endl;} }; void main() {clrscr(); COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT

COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT Continue…. smallobj s1,s2;s2; s1.setdata(1066); s2.setdata(1776); s1.showdata(); s2.showdata(); getch();} COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT

COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT Output…. COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT