c++ programs for class 12

Share Embed Donate


Short Description

c++ programs for class 12 cbse for scool projects. includes of all topics like classes and objects,SQL,etc....

Description

COM P U TER SC IE NCE PROGR A MS IN C+ + 2012-2013

NAME: ALOK KUMAR ROLL NO: 1603879

INDEX

S.No.

Contents

1.

Classes and objects

2.

Polymorphism

3.

Constructor destructor

4.

Inheritance

5.

Stacks and queue

6.

Data file management

7.

Array

8.

SQL queries

CLASSES AND OBJECTS 1. Program to Define a Class Student and accessing member function using its object. Define a class student with the following specification: Private members: Admno

integer

Sname

20 character

Eng,Math,Science,

float

total

float

ctotal()

a function to calculate eng + math + science with float return type.

Public member: Takedata()

Function to accept values for admnosnameeng science and invoke ctotal() to calculate total.

Showdata()

Function to display all the data members onthe screen.

#include #include #include class student { private: intAdmno; charSname[20];

floatEngMathScience; float total; floatctotal() { returnEng+Math+Science; } public: voidTakedata() { coutAdmno; coutMath>>Science; total=ctotal(); } voidShowdata() { cout
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF