-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStatic Class Example.cpp
55 lines (52 loc) · 1.11 KB
/
Static Class Example.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<ctype.h>
class auditorium
{
char name[30];
int id,seat_no;
static int count;
public:
void input()
{
cout<<"\n \n \t :::: Enter Details of Guest ::::";
cout<<"\n Enter the ID = ";
cin>>id;
cout<<"\n Enter the Name = ";
gets(name);
cout<<"\n Enter the Seat Number = ";
cin>>seat_no;
count++;
}
void output()
{
cout<<"\n \n \t :::::: Details of Guest :::::: ";
cout<<"\n ID : "<<id;
cout<<"\n Name : ";
puts(name);
cout<<" Seat Number : "<<seat_no;
}
static void total()
{
cout<<"\n \n ---------------------------------------------------";
cout<<"\n Total Number of Guests = "<<count;
cout<<"\n ---------------------------------------------------";
}
};
int auditorium::count=0;
void main()
{
auditorium a[100],a1;
clrscr();
int n;
cout<<"\n How Many Guest Details Do You Want to Enter = ";
cin>>n;
for(int i=0;i<n;i++)
{
a[i].input();
a[i].output();
}
a1.total();
getch();
}