Page 1 of 2 12 LastLast
Results 1 to 12 of 22

Thread: c++ challan calculator for traffic violations program

  1. #1
    Arslan-vu's Avatar
    Arslan-vu is offline Senior Member+
    Last Online
    2nd March 2018 @ 09:50 PM
    Join Date
    22 Mar 2013
    Gender
    Male
    Posts
    326
    Threads
    115
    Credits
    447
    Thanked
    88

    Default c++ challan calculator for traffic violations program

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

    main()

    {
    char i;
    int a, b;

    do
    {
    system("cls");
    cout<<"******Challan Calculator for Traffic Violations******";
    cout<<endl;
    cout<<endl;
    cout<<"Enter '1' for Breaking Signal:";
    cout<<endl;
    cout<<"Enter '2' for Over Speed:";
    cout<<endl;
    cout<<"Enter '3' for Wearing not Seat Belt:";
    cout<<endl;
    cout<<endl;
    cout<<"Enter the type of traffic violation 1, 2 or 3:";
    cin>>a;
    cout<<endl;
    switch(a)
    {
    case 1:
    cout<<"Enter the numbers of days passed till challan date:";
    cin>>b;
    cout<<endl;

    if(b<=10)cout<<"The total fine is Rs: "<<500;
    else if (b<=30)cout<<"The total fine is Rs: "<<500*2;
    else if (b>30)cout<<"The total fine is Rs: "<<(500*2)+(500/2);
    break;
    case 2:
    cout<<"Enter the numbers of days passed till challan date:";
    cin>>b;
    cout<<endl;

    if(b<=10)cout<<"The total fine is Rs: "<<300;
    else if (b<=30)cout<<"The total fine is Rs: "<<300*2;
    else if (b>30)cout<<"The total fine is Rs: "<<(300*2)+(300/2);

    break;
    case 3:
    cout<<"Enter the numbers of days passed till challan date:";
    cin>>b;
    cout<<endl;

    if(b<=10)cout<<"The total fine is Rs: "<<200;
    else if (b<=30)cout<<"The total fine is Rs: "<<200*2;
    else if (b>30)cout<<"The total fine is Rs: "<<(200*2)+(200/2);
    break;
    default:
    cout<<endl;
    cout<<endl;
    cout<<"Please Enter a Valid Type of Traffic Violation:";
    cout<<endl;
    cout<<endl;
    getch();
    cout<<endl;
    cout<<endl;
    system("cls");
    main();
    break;

    }

    cout<<endl;
    cout<<endl;
    cout<<"Do you want another challan calculation? (y/n):";
    cin>>i;
    }
    while(i != 'N' && i != 'n' );

    }
    Attached Images Attached Images  

  2. #2
    wolverine's Avatar
    wolverine is offline Senior Member+
    Last Online
    6th March 2014 @ 08:47 AM
    Join Date
    15 Aug 2013
    Location
    Islamabad
    Gender
    Male
    Posts
    86
    Threads
    1
    Credits
    0
    Thanked
    6

    Default

    yaar brother ye aap konsay compiler mai use kar rahay ho, kyu k ye dev mai to nai chal raha :S

  3. #3
    Arslan-vu's Avatar
    Arslan-vu is offline Senior Member+
    Last Online
    2nd March 2018 @ 09:50 PM
    Join Date
    22 Mar 2013
    Gender
    Male
    Posts
    326
    Threads
    115
    Credits
    447
    Thanked
    88

    Default

    Quote wolverine said: View Post
    yaar brother ye aap konsay compiler mai use kar rahay ho, kyu k ye dev mai to nai chal raha :S
    dev c++ me compile kar rha hun

  4. #4
    Arslan-vu's Avatar
    Arslan-vu is offline Senior Member+
    Last Online
    2nd March 2018 @ 09:50 PM
    Join Date
    22 Mar 2013
    Gender
    Male
    Posts
    326
    Threads
    115
    Credits
    447
    Thanked
    88

    Default

    dear dev c++ compiler men compile hoga

  5. #5
    noumanmugel's Avatar
    noumanmugel is offline Senior Member+
    Last Online
    16th October 2018 @ 01:14 AM
    Join Date
    21 Aug 2009
    Location
    Lahore
    Posts
    65
    Threads
    6
    Credits
    980
    Thanked: 1

    Default

    wolverine :Brother aghar dev main use karna chahty ho tou main() say phaly "using namespace std;" likoo compile ho jaey ga .........

  6. #6
    noumanmugel's Avatar
    noumanmugel is offline Senior Member+
    Last Online
    16th October 2018 @ 01:14 AM
    Join Date
    21 Aug 2009
    Location
    Lahore
    Posts
    65
    Threads
    6
    Credits
    980
    Thanked: 1

    Default

    Thanks For Sharing .....

  7. #7
    Join Date
    27 Aug 2013
    Location
    sargodha
    Age
    33
    Gender
    Male
    Posts
    432
    Threads
    109
    Credits
    59
    Thanked
    17

    Default

    system("cls");
    me error aa ra ha

  8. #8
    bhatti sahab is offline Junior Member
    Last Online
    8th December 2013 @ 04:06 PM
    Join Date
    03 Dec 2013
    Age
    29
    Gender
    Male
    Posts
    4
    Threads
    0
    Credits
    920
    Thanked
    0

    Default

    yar printf scanf wali statment me another challan wala kasy use kry gy plzzz reply

  9. #9
    tasaddaqrana's Avatar
    tasaddaqrana is offline Senior Member+
    Last Online
    5th May 2022 @ 04:51 PM
    Join Date
    20 Dec 2010
    Location
    sialkot
    Age
    33
    Gender
    Male
    Posts
    483
    Threads
    84
    Credits
    40
    Thanked
    53

    Default

    ye tu cs201 ki assignment thi...

  10. #10
    abbasikpk's Avatar
    abbasikpk is offline Advance Member
    Last Online
    6th April 2020 @ 01:08 PM
    Join Date
    24 Jun 2013
    Location
    ISLAMABAD
    Age
    29
    Gender
    Male
    Posts
    817
    Threads
    74
    Credits
    747
    Thanked
    16

    Default

    Nice
    No NEEDS To THANKS ME

  11. #11
    shammads's Avatar
    shammads is offline Senior Member+
    Last Online
    1st January 2015 @ 02:16 PM
    Join Date
    14 Feb 2011
    Gender
    Male
    Posts
    1,023
    Threads
    102
    Credits
    0
    Thanked
    120

    Default

    thanks acha hay.

  12. #12
    Rais shafeeq is offline Junior Member
    Last Online
    14th December 2013 @ 07:16 PM
    Join Date
    12 Dec 2013
    Gender
    Male
    Posts
    2
    Threads
    0
    Credits
    0
    Thanked
    0

    Default

    amaizing help

Page 1 of 2 12 LastLast

Similar Threads

  1. program plz 4
    By PREMkhan in forum Ask an Expert
    Replies: 1
    Last Post: 25th May 2010, 11:53 PM
  2. Solved plz help me in the following c++ program
    By raza89 in forum Solved Problems (IT)
    Replies: 4
    Last Post: 19th October 2009, 08:29 AM
  3. Share ur Eid Program
    By ussmaan in forum Baat cheet
    Replies: 3
    Last Post: 21st September 2009, 12:46 AM
  4. Replies: 8
    Last Post: 19th May 2009, 05:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •