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

Thread: petrol pump software in c++

  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 petrol pump software in c++

    use dev c ++ for compile
    #include<iostream.h>
    main()
    {
    //Declaring Constants
    const float SUPER = 106.50;
    const float HIOCTAIN = 110.65;
    const float DIESEL = 103.35;
    int input_data, input_method;
    float input_amount, input_quantity, w, x, y, z;
    double output_amount;
    char go_back;
    y=1;

    start:
    //Showing Welcome Message with Option to Select the Fuel Type;
    cout << "Alsalam o Alikum. Good Day." << "\n" << "Please Select the Fuel Type from options given Below :" << "\n";
    cout << "1) Super";
    cout << "\n" << "2) Hi-Octain";
    cout << "\n" << "3) Diesel" << "\n";
    cin >> input_data;
    cout << "\n";

    //Getting Data from User
    if (input_data == 1){
    cout << "You Selected Super. The Rate is " << SUPER <<"0 Per Liter" << "\n" << "\n";
    }
    else if (input_data == 2){
    cout << "You Selected Hi-Octain. The Rate is " << HIOCTAIN <<" Per Liter" << "\n";
    }
    else if (input_data == 3){
    cout << "You Selected Diesel. The Rate is " << DIESEL <<" Per Liter" << "\n";
    }
    cout << "Please Select from the List the Amount or Quantity" << "\n";
    cout << "1) Amount";
    cout << "\n" << "2) Quantity" << "\n";
    cin >> input_method;
    cout << "\n";
    if (input_method == 1){
    cout << "\n" << "Please Enter the Amount (In Rupees) against which you want to get fuel" << "\n";
    cin >> input_amount;
    cout << "\n";
    }
    else if (input_method == 2){
    cout << "\n" << "Please Enter the Quantity of fuel (In Liters)" << "\n";
    cin >> input_quantity;
    cout << "\n";
    }

    //Processing Data and Giving the Output using "And" and "or" logics
    if (input_data == 1 && input_method == 1){
    x = input_amount/SUPER;
    output_amount = x * SUPER;
    cout << "\n" << "You Refuled " << x << " Liters of Super. Your Amount is " << output_amount << "\n";
    }
    else if (input_data == 1 && input_method == 2){
    output_amount = SUPER * input_quantity;
    cout << "\n" << "You Refuled " << input_quantity << " Liters of Super. Your Amount is " << output_amount << "\n";
    cout << "Thanks for Coming. God Bye" << "\n";
    }
    else if (input_data == 2 && input_method == 1){
    x = input_amount/HIOCTAIN;
    output_amount = x * HIOCTAIN;
    cout << "\n" << "You Refuled " << x << " Liters of Hi-Octain. Your Amount is " << output_amount << "\n";
    cout << "Thanks for Coming. God Bye" << "\n";
    }
    else if (input_data == 2 && input_method == 2){
    output_amount = HIOCTAIN * input_quantity;
    cout << "\n" << "You Refuled " << input_quantity << " Liters of Hi-Octain. Your Amount is " << output_amount << "\n";
    }
    else if (input_data == 3 && input_method == 1){
    x = input_amount/DIESEL;
    output_amount = x * DIESEL;
    cout << "\n" << "You Refuled " << x << " Liters of Diesel. Your Amount is " << output_amount << "\n";
    }
    else if (input_data == 3 && input_method == 2){
    output_amount = DIESEL * input_quantity;
    cout << "\n" << "You Refuled " << input_quantity << " Liters of Disel. Your Amount is " << output_amount << "\n";
    }
    else {
    cout << "Wrong Entry. Try Again!!" << "\n";
    }
    cout << "Please Press 'Y' for another refule or press 'N' to exit" << "\n";
    cin >> go_back;
    if (go_back == 'y' || go_back == 'Y'){
    goto start;
    }
    else {
    cout << "Thanks for Coming. God Bye" << "\n";
    }

    system ("pause");
    //end of the programme

    }

  2. #2
    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 screen shot of petrolpump program

    screen shot of petrolpump program
    Attached Images Attached Images  

  3. #3
    karachi1234 is offline Senior Member+
    Last Online
    27th April 2016 @ 10:13 AM
    Join Date
    07 Jan 2010
    Location
    I live In Lyari Town Karachi City
    Gender
    Male
    Posts
    1,542
    Threads
    232
    Credits
    0
    Thanked
    17

    Default

    aap ka kaam bohat acha se kiyaa hai lekin main yeh walay sawal karna chata hoon kay ager main c++.net 2010 per yeh walay program bana sakta hoon
    main kuch programming mai weak hoon
    i am software enginner and iss waqt main job kay talash mai hoon ager aur bei software c++ per aap nai banaya hai tu yahaan per iss kii coding ko sharing karo aap ka bohat acha se working kiyaa hai

  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 behtar hoga ap isay dev c++ men compile karain bht comfortable hai men kafi arsay se yehe use kar rha hun ap k reply ka bht shukriya men next b programz share karunga .

  5. #5
    mudaserabid is offline Junior Member
    Last Online
    26th October 2013 @ 11:38 PM
    Join Date
    27 Sep 2013
    Age
    33
    Gender
    Male
    Posts
    2
    Threads
    0
    Credits
    0
    Thanked
    0

    Default C

    thnx

  6. #6
    karachi1234 is offline Senior Member+
    Last Online
    27th April 2016 @ 10:13 AM
    Join Date
    07 Jan 2010
    Location
    I live In Lyari Town Karachi City
    Gender
    Male
    Posts
    1,542
    Threads
    232
    Credits
    0
    Thanked
    17

    Default

    Thanks sir for you are send me your advice and reply to me my question put out your answer

  7. #7
    GeoArain's Avatar
    GeoArain is offline Senior Member+
    Last Online
    21st November 2015 @ 09:42 PM
    Join Date
    05 Sep 2013
    Location
    hyd
    Age
    35
    Gender
    Male
    Posts
    346
    Threads
    3
    Credits
    0
    Thanked
    11

    Default

    very nice dear
    thanks

  8. #8
    Xeathprynx is offline Junior Member
    Last Online
    16th April 2015 @ 09:00 PM
    Join Date
    25 Jun 2013
    Location
    Rwp
    Age
    30
    Gender
    Male
    Posts
    28
    Threads
    8
    Credits
    0
    Thanked: 1

    Default

    good job done

  9. #9
    Hashmatnaqvi's Avatar
    Hashmatnaqvi is offline Senior Member+
    Last Online
    18th February 2016 @ 01:27 AM
    Join Date
    16 Jan 2012
    Location
    Islamabad
    Age
    30
    Gender
    Male
    Posts
    639
    Threads
    55
    Credits
    0
    Thanked
    105

    Default

    nice work
    Shadow xXx

  10. #10
    Member84's Avatar
    Member84 is offline Senior Member+
    Last Online
    17th January 2021 @ 05:16 PM
    Join Date
    26 Nov 2010
    Location
    BUREWALA
    Age
    36
    Gender
    Male
    Posts
    195
    Threads
    9
    Credits
    425
    Thanked
    5

    Default

    Bohat Achay...

  11. #11
    bilalajk's Avatar
    bilalajk is offline Senior Member+
    Last Online
    6th June 2017 @ 11:39 PM
    Join Date
    26 Jan 2015
    Location
    bagh azad kashm
    Age
    27
    Gender
    Male
    Posts
    299
    Threads
    12
    Credits
    736
    Thanked
    8

    Default

    boat aAla

  12. #12
    ahmad733 is offline Junior Member
    Last Online
    7th July 2015 @ 09:53 PM
    Join Date
    26 Jun 2015
    Age
    30
    Gender
    Male
    Posts
    4
    Threads
    1
    Credits
    0
    Thanked
    0

    Default i want help

    A.o.A
    mai it dunya ke new member hn
    mujhe btya jay k mai c++ ka first kis tra hasil kro

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 8
    Last Post: 28th February 2010, 06:17 AM
  2. Petrol Price Increases Funny
    By Muhammad Adel in forum Photo Gallery
    Replies: 9
    Last Post: 2nd September 2009, 11:58 AM
  3. Petrol Price ?????
    By SarmadLighari in forum Baat cheet
    Replies: 8
    Last Post: 28th July 2009, 10:25 AM
  4. petrol 51.20
    By SarmadLighari in forum Baat cheet
    Replies: 6
    Last Post: 10th July 2009, 06:00 PM
  5. Petrol Pumps aur Mobile Phones..!!!
    By talhaarfi in forum General Mobile Discussion
    Replies: 33
    Last Post: 22nd November 2007, 09: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
  •