Page 1 of 3 123 LastLast
Results 1 to 12 of 31

Thread: c++ calculator program code

  1. #1
    moon_smile786's Avatar
    moon_smile786 is offline Junior Member
    Last Online
    27th November 2014 @ 03:59 PM
    Join Date
    26 Nov 2010
    Age
    31
    Gender
    Male
    Posts
    27
    Threads
    4
    Credits
    0
    Thanked: 1

    Default c++ calculator program code

    c++ calculator program code
    #include <cstdlib>
    #include <iostream>

    using namespace std;

    int main()
    {
    double num;
    double num2;
    char choice;
    for (;{
    do {
    cout<<"Welcome to thejoshcalculator. V1.5\n";
    cout<<"Please choose an option by entering the number, press q to quit\n";
    cout<<"1 - Addition\n";
    cout<<"2 - Subtraction\n";
    cout<<"3 - Division\n";
    cout<<"4 - Multiplication\n";
    cout<<"5 - Help\n";
    cout<<"6 - About This Program\n";
    cout<<"7 - Updates to this program\n";
    cin>>choice;
    } while ( choice < '1' || choice > '7' && choice != 'q');
    if (choice == 'q') break;
    switch (choice) {
    case '1':
    cout<<"Please enter a number\n";
    cin>>num;
    cout<<"Another number to be added\n";
    cin>>num2;
    cout<<num + num2;
    cout<<"\n";
    break;
    case '2':
    cout<<"Please enter a number\n";
    cin>>num;
    cout<<"Another number to be subtracted\n";
    cin>>num2;
    cout<<num - num2;
    cout<<"\n";
    break;
    case '3':
    cout<<"Please enter a number\n";
    cin>>num;
    cout<<"Another one to be divided\n";
    cin>>num2;
    cout<<num / num2;
    cout<<"\n";
    break;
    case '4':
    cout<<"Please enter a number\n";
    cin>>num;
    cout<<"Another one to be multiplied\n";
    cin>>num2;
    cout<<num * num2;
    cout<<"\n";
    break;
    case '5':
    cout<<"This is a simple calculator made by me - Josh.\n";
    cout<<"To select an option, type the number next to the option and press enter\n";
    cout<<"E.G. for division, you would type 3 and press enter.\n";
    cout<<"\n";
    break;
    case '6':
    cout<<"thejoshcalculator, made by Joshua Griggs - Copyright 2007. \n";
    cout<<"Feedback would be nice - joshieboy06************* also, what programmes\n";
    cout<<"do people need. Please give me ideas for programs. Bye!!\n";
    cout<<"\n";
    break;
    case '7':
    cout<<"Updates include: -double variable instead of int, so that decimals can be used.\n";
    cout<<" -do while loop so that you can exit the program yourself\n";
    cout<<"\n";
    break;
    default:
    cout<<"That is not an option";

    }

    }
    return 0;

    }

  2. #2
    Join Date
    20 Aug 2008
    Location
    KaraChI,Pakista
    Age
    32
    Gender
    Male
    Posts
    747
    Threads
    58
    Credits
    0
    Thanked
    7

    Default

    gud

  3. #3
    Omer27's Avatar
    Omer27 is offline Advance Member
    Last Online
    30th January 2024 @ 04:01 PM
    Join Date
    27 Jan 2009
    Age
    31
    Posts
    1,725
    Threads
    72
    Credits
    1,374
    Thanked
    66

    Default

    aisa program me share kar chuka ho.check this
    behter hota agar aap fuctions use karte.aur ye cout<<"Enter number"; wali command aik hi baar use karte.phr bi good

  4. #4
    bais is offline Senior Member
    Last Online
    31st July 2015 @ 02:07 PM
    Join Date
    23 Aug 2008
    Location
    Izlooo
    Gender
    Male
    Posts
    3,519
    Threads
    96
    Thanked
    263

    Default

    Check this one I have upgraded it with using Object Oriented Programming C++. http://www.itdunya.com/t321754/

  5. #5
    moon_smile786's Avatar
    moon_smile786 is offline Junior Member
    Last Online
    27th November 2014 @ 03:59 PM
    Join Date
    26 Nov 2010
    Age
    31
    Gender
    Male
    Posts
    27
    Threads
    4
    Credits
    0
    Thanked: 1

    Default

    thnks yu dude

  6. #6
    Dawoodkhan2's Avatar
    Dawoodkhan2 is offline Member
    Last Online
    11th February 2013 @ 03:59 PM
    Join Date
    15 Mar 2012
    Location
    Dera ghazi khan
    Age
    32
    Gender
    Male
    Posts
    1,422
    Threads
    85
    Thanked
    69

    Default

    great.....

  7. #7
    Rick starr's Avatar
    Rick starr is offline Senior Member+
    Last Online
    21st May 2013 @ 08:36 PM
    Join Date
    06 Jul 2012
    Location
    karachi
    Gender
    Male
    Posts
    56
    Threads
    0
    Credits
    940
    Thanked: 1

    Default

    good

  8. #8
    Rick starr's Avatar
    Rick starr is offline Senior Member+
    Last Online
    21st May 2013 @ 08:36 PM
    Join Date
    06 Jul 2012
    Location
    karachi
    Gender
    Male
    Posts
    56
    Threads
    0
    Credits
    940
    Thanked: 1

    Default


  9. #9
    Musa_jutt is offline Senior Member+
    Last Online
    1st October 2019 @ 02:23 PM
    Join Date
    13 Apr 2012
    Location
    Lahore
    Age
    35
    Gender
    Male
    Posts
    367
    Threads
    63
    Credits
    1,453
    Thanked
    17

    Default

    lengthy code....

  10. #10
    AlOnEbOy is offline Senior Member+
    Last Online
    5th October 2013 @ 09:03 PM
    Join Date
    09 Aug 2010
    Location
    Peshawar
    Gender
    Male
    Posts
    109
    Threads
    13
    Credits
    940
    Thanked
    2

    Thumbs up

    Nice sharing but the code you have shown is very lengthy
    remember a good programer always use short code...

    phir bhi bohut acha he

  11. #11
    shoaibbbb is offline Junior Member
    Last Online
    22nd June 2013 @ 05:59 PM
    Join Date
    17 Sep 2012
    Age
    32
    Gender
    Male
    Posts
    23
    Threads
    0
    Credits
    0
    Thanked
    0

    Default

    lengthly

  12. #12
    shoaibbbb is offline Junior Member
    Last Online
    22nd June 2013 @ 05:59 PM
    Join Date
    17 Sep 2012
    Age
    32
    Gender
    Male
    Posts
    23
    Threads
    0
    Credits
    0
    Thanked
    0

    Default

    B.CS me be programming hai ?

Page 1 of 3 123 LastLast

Similar Threads

  1. Nokia Secret Codes And Tricks!!!!!!
    By zaibshah in forum General Mobile Discussion
    Replies: 17
    Last Post: 25th June 2012, 09:05 PM
  2. Nokia Mobile Sets Secret Codes
    By majid786 in forum General Mobile Discussion
    Replies: 16
    Last Post: 24th March 2012, 03:48 PM
  3. all format and unlock codes
    By IT_DOCTOR in forum General Mobile Discussion
    Replies: 30
    Last Post: 29th December 2011, 08:19 PM
  4. Nokia 2170 Secret Codes
    By IT_DOCTOR in forum General Mobile Discussion
    Replies: 3
    Last Post: 24th March 2010, 09:32 AM
  5. all gsm secret code
    By tahseenrajput in forum General Mobile Discussion
    Replies: 13
    Last Post: 15th March 2010, 05:59 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
  •