-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClasses.cpp
40 lines (35 loc) · 972 Bytes
/
Classes.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
#include<iostream>
#include<string.h>
#include<cctype>
using namespace std;
class car{
private:
string name, model,DL;
float top_speed;
int Price;
public:
void input(){
cout<<"Enter Car Name: "<<endl;
cin>>name;
cout<<"Enter Car Model: "<<endl;
cin>>model;
cout<<"Enter Car DL Number : "<<endl;
cin>>DL;
cout<<"Enter Top Speed of Car: "<<endl;
cin>>top_speed;
cout<<"Enter Car Price: "<<endl;
cin>>Price;
cout<<endl;
}
void display(){
cout<<"Name of car: "<<name<<endl<<"Model of Car: "<<model<<endl;
cout<<"Car DL: "<<DL<<endl;
cout<<"Top Speed: "<<top_speed<<" Mph"<<endl;
cout<<"Car Price: "<<Price<<" Lakh Rupees "<<endl;
}
};
int main(){
car c1;
c1.input();
c1.display();
}