• Image 1
  • Image 2
  • Image 3
  • Image 4
  • Image 5
  • Image 6
  • Image 7




Thursday, August 16, 2012

C++ - PARKING PROGRAM


Ok.. still in my page, and program language “C++”…

Now.. I was made a program.. and the program is “parking program”…

OK… you just copy this codingin your aplication….


#include <conio.h>
#include <iostream.h>

main()
{
clrscr;
int a,b,c,d,e,f,j,k,l;
cout << "  Welcome In We Are Knowledge" << endl;
cout << "Have-fun-and-enjoy.blogspot.com" << endl;
cout << " hafe fun of reading myarticle" << endl << endl << endl;

cout << "Hours Entry     : ";
cin >> a;
cout << "Minutes Entry   : ";
cin >> b;
cout << "Second Entry    : ";
cin >> c;
cout << endl;
cout << "Hours Out       : ";
cin >> d;
cout << "Minutes Out     : ";
cin >> e;
cout << "Second Out      : ";
cin >> f;

{
if (d < a)
{
cout << endl << endl << "You Either Enter Data";
goto wak;
}

else if (c > f)
{
  if (b > e)
  {
  l = f + 60 - c;
  k = e - 1 + 60 - b;
  j = d - 1 - a;
  }

  else
  {
  l = f + 60 - c;
  k = e - 1 - b;
  j = d - a;
  }
}

else if (c < f)
{
  if (b > e)
  {
  l = f - c;
  k = e + 60 - b;
  j = d - 1 - a;
  }

  else
  {
  l = f - c;
  k = e - b;
  j = d - a;
  }
}

else if (c == f)

{
  if (b > e)
  {
  l = f + 60 - c;
  k = e - 1 + 60 - b;
  j = d - 1 - a;
  }

  else if (b == e)
  {
  l = f - c;
  k = e - b;
  j = d - a;
  }

  else
  {
  l = f + 60 - c;
  k = e - 1 - b;
  j = d - a;
  }

}
}


if (l == 60)
{
l = 0;
k = k + 1;
}

cout << endl << endl << "Get Your Parking Time        : " << a << ":" << b << ":" << c;
cout << endl << endl << "Time Out Of Your Parking     : " << d << ":" << e << ":" << f;
cout << endl << endl << "Length Of Time Your Parking  : " << j << " Hours " << k << " Minutes " << l << " Seconds";
wak:
getch();
}


NOTE :::

Press “alt  + F9” >> compile
Press “ctrl + F9” >> running program
If you using “Ctrl + paste” and “ctrl + copy”, please change all quotes (“ “) or (‘ ‘)..


Ok.. just it…
I hope you like..
See you later,,,

No comments:

Post a Comment