You are on page 1of 1

//By:Ali Mahmood Ali ^_^

//Second Class _Network


//Exam
#include <iostream>
#include <conio.h>
using namespace std ;
class taxi
{
private:
int m ;
int t ;
public:
taxi()
{
m = 1 ;
t = 1 ;
}
void input ()
{
cout << "how many meels : " ;
cin >> m ;
cout << "enter the time : " ;
cin >> t ;
}
float price ()
{
int p = 10 * m ;//‫دوالر‬10 ‫للسعر كل ميل‬
int sum = t/30 ;//‫دقيقة عندي‬30 ‫الزم انتجر حتة يعرف كم‬

return p + (sum*0.2) ;
}
void output ()
{
cout << "\nyour meels that you Across with taxi is "
<<m <<" meels"<<endl ;
cout <<"your time with taxi is " <<t <<" m"<<endl ;
cout << "the price is " << price() <<" dolars";
} };
void main()
{ taxi a ;
a.input() ;
a.price() ;
a.output() ;
getch() ;}

You might also like