Results 1 to 6 of 6

Thread: Calculators in C++

  1. #1
    Join Date
    May 2008
    Posts
    32

    Calculators in C++

    I placed the sources of 2 calculators made by me in C++
    with each iteration while, or preconditioned, the other will continue to do (hence the postconditioned) and for.
    For simplicity the first one written is better, but for quality of the code, the second is more reliable. Even if it is still Spartan, I made in 10 minutes.

    This is the second calculator
    Code:
    # include   void main () (float difference, division, product, the sum, i, a, b, n, choice, cont; do (/ / parenthesis do court << "Choose an action to make \ n"; court << "1-Addition 2-Stealing 3-Multiplication 4-Division 5-Exit \ n"; cin>> choice; court << "\ nChoose the number of operandi"; cin>> n; if (choice == 1) ( for (cont = sum = 0; cont   >; sum + = a;) court << "The sum and '" <   >; difference-= a;) court << "The difference and '" <   >; product *= a;) court << "The product and '" <   >; court <   > b; product *= b;) = a division / product; court << "The product and '" <

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852
    It is only recently that I did java and C++. I have not ever seen (although very similar, given that the java is a derivative), but it seems to me that in the second calculator, there is lacking some line of code .. or mistake?

    However with a little patience, the first you can easily transform from "Spartan" to "finished".

  3. #3
    Join Date
    May 2008
    Posts
    32
    Quote Originally Posted by MindSpace View Post
    It is only recently that I did java and C++. I have not ever seen (although very similar, given that the java is a derivative), but it seems to me that in the second calculator, there is lacking some line of code .. or mistake?
    Mmmm......is not incomplete

    Quote Originally Posted by MindSpace View Post
    However with a little patience, the first you can easily transform from "Spartan" to "finished".
    Will not happen ever. Spartan mean that lack the type operations breast, cosine, tangent, root, powers etc.... I just made to test the cycle do while associated with.

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948
    Eh, i have never tried this programming in C++. Certain aspects of CMQ x resembles the Pascal.

    congratulations

  5. #5
    Join Date
    May 2008
    Posts
    32
    Yeah, most of them are all equal. I also know the pascal. But to be more than nice is more complicated and has lot more features. But it is very easy to learn knowing C++.

  6. #6
    kelly123 Guest
    I don't know for sure what kind of calculator you are using but if it is a TI version this will work in your program it should ask for your inputed numbers then save them...

    Example:

    1. Prompt x, y
    2. x+y→e
    3. disp e

    disp e makes it display e to the screen. the → makes it store the answer to the variable e...it should be the same for most calculators most of these functions are under the catalog section.
    Last edited by Yogesh; 24-09-2008 at 01:53 PM. Reason: External links removed.

Similar Threads

  1. How to add calculators for the Linux desktop
    By Edwards in forum Operating Systems
    Replies: 5
    Last Post: 20-01-2010, 06:47 AM

Tags for this Thread

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
  •  
Page generated in 1,714,027,381.38998 seconds with 16 queries