You are on page 1of 6

1

Class resort { Private Double charge ,roon,days ; Char cstname[20] Double compute() { Days If (days*changes > 11000) { Return days * charges*1.02 ; { Else { Return days * charges ; {{ Public : Void getinfo() ; Void dispinfo (); }; Viod resort :: getinfo () { Cout << enter name ; Gets (cst name) ; Cout<<room ;

Cin>>roono; Cout>>charges; Cout<<enter days; Cin>> days ;

Compute() ; } Void resort;; dispinfo() { cout cout << cst name ; cout << rooom2 no cout << compute () ; { Void main () Resort r ; R getinfo(); R dispinfo(); Getch(); }

Class student { Int admn; char name[20] int total ; char grade; public; int getadmno() { Return admno; Void calculate grade () { If (total > 90 & total <=100) Grade=e; Else if (total >80 && total <=90) Grade =9 Else grade=B Void enter (); VOID display (); }; Void student :: enter () { Cout << enter admno; Cin>> admno; Cout enter name Gets(name) Cout<< enter total marks; Cin>> total ; Calculate_grade ();

} Void student:: display() { Cout << admno; Puts(name); Cout <<grade; } Void main () {int x; student + s; S enter(); Cin >> x; Cout>>x; If (x==s getadmno()) S display ()/ Else Cout<<invalid admno ; Getch :}

3 W.A.P
#include<f stream.h> #include <conio.h> Void main() {

Clsr(); If stream b; b.poen (test.doc); char ch; while (! B.cof ()) { Ch=b.get (); Cout << ch ; } b.close(); getch();

4 WAP To2 displaythe same


Void main () { Clsr(); Ont cnt=0 If stream .b; b.open(test.doc); char ch; gotoxy(20,10) while (;b.cof.()) { Ch = b.get ();

b.close (); cout << the no. of vowels is :<<cnt; getch(); }

5
#include <fstream.h> #include<coinio.h> #include <stdio.h> #include<ctype.h> Class flight {Intr fno char

You might also like