برنامج حساب تكلفة سيارة في كراج و مدخول كل يوم بلغة ++C

هذا البرنامج يقوم بطلب وقت دخول وخروج السيارة ويقوم بطباعة تكلفة الوقت الذي بقت فيه السيارة داخلة الكراج ومن ثم يطلب ادخال عدد السيارات اثناء اليوم الواحد حتة يقوم بحساب التكلفة الكلية للسيارات في اليوم اي المدخول اليومي …وذلك بلغة الـC++



#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    float cost1 = 2.00 ,cost2 = 0.50 ,cost ,cost3=0 ,costtotal=0  ;
    int  timein ,timeout ,time ,i=0 , carnum=0 ;
    cout <<".

please enter the timein of the  car : 

";
    cin >> timein ;
    cout <<".

please enter the timeout of the car : 

";
    cin >> timeout;
    time = timeout - timein ;
    if (time < 24 && time > 0)
    {
             cout <<".

the time of the car is :"<<time<<".

";
             if ( time <= 3 )
             {
             cost = cost1 ;
             cout <<".

the cost is : "<<cost<<".

" ;
             }
             else
             {
             cost2 = (time - 3) * cost2;
             cost = cost1 + cost2 ;
             cout <<".

the cost is : "<<cost<<".

" ;
             }
     cout <<".

please enter the car number on day : .

" ;
     cin >> carnum ;        
     for ( i = 1 ; i <= carnum ; i++)
     {
    cout <<".

* car number : "<<i<<".
" ;
    cout <<".

*************************" ;
    cout <<".

please enter the timein of the  car : 

";
    cin >> timein ;
    cout <<".

please enter the timeout of the car : 

";
    cin >> timeout;
    time = timeout - timein ;
             cout <<".

the time of the car is :"<<time<<".

";
             if ( time <= 3 )
             {
             cost = cost1 ;
             cout <<".

the cost is : "<<cost<<".

" ;
             costtotal = costtotal + cost ;
             }
             else
             {
             cost3 = (time - 3) * cost2;
             cost = cost1 + cost3 ;
             cout <<".

the cost is : "<<cost<<".

" ;
             costtotal = costtotal + cost ;
             }
    }
    cout <<".

**********************************************.

" ;
    cout <<".

the total cost of the day is : "<<costtotal<<".

" ;
    }
    else
    cout <<".

you cant keep your car for 24h .. Take it out please !.

";

    
    system("PAUSE");
    return EXIT_SUCCESS;
}

تحياتي اصدقائي

إعجابَين (2)