Thread: Please test my calculator prog

  1. #46
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    What you should do for updating your new versions is to put the new version on a new post and then to put the new version on you very first post. For the rest of the versions you should delete them off of your posts to make sure there isn't any confusion.

    Btw, there is an error in your latest version. When I enter 10 at the beginning to do a Cube function it closes the program.

  2. #47
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Originally posted by face_master
    Code:
    	while(b = 0)
    	{
    		cout << "Please enter a number other than 0 please: ";
    		cin >> b;
    	}
    make that:
    while (b==0)

    otherwise it has the opposite effect.

    I've made a calculator, too. It supports complex numbers, strings, vectors and matrices.

    It parses a string like this : "sin (2+4/(4+3i))"
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #48
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    woops, damn i'm retarted ...

  4. #49
    x4000 Ruski's Avatar
    Join Date
    Jun 2002
    Location
    Outer Space!
    Posts
    542
    I did a selection Demo on this forum.. search for it.. it's pretty easy
    what does signature stand for?

  5. #50
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Sang-drax> It is while(b == 0). I'll take a look and try out your calculator.

    Ruski> Ok, thnx. I'll check it out. getch() doesn't work right. Here's the code:
    /* ... various code here */
    Selection code:
    1] Redo
    2] return to main menu
    3] exit {Quit}
    pick.choice = getch();
    if(pick.choice == '1')
    code();
    if(pick.choice == '2')
    begin();
    if(pick.choice == '3')
    quit();

    After the math is done, you have to push any of the numbers before the menu shows, then it still doesn't work right.

    TechWins> I fixed the press 10 and get quit bug you where having. I forgot to change the command for case 10. I am currently working on sin, but can't get the correct output. The source for it is in the attatchment *along with the other fixes*. I was planning on the trig functions yesterday, but I had to get off the comp. Good idea on the thread/new version thing. I'll start doing that for now on.

    NOTE: To get the sin function, you have to enter 13 on the main menu. I haven't added that one in yet becuase it doesn't work.

    P.S.: Thanks for all the advice, help, and whatnot so far.

  6. #51
    sang-drax> your calc is pretty cool. how did you get the colors to work?? and i found a few bugs. PM me if you want me to let you know what they are.
    Compilers:
    GCC on Red Hat 8.1 (Primary)
    GCC on Mac OS X 10.2.4 (Secondary)

    Others:
    MinGW on XP

  7. #52
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Ok, i sent you the P.M. Does anyone know of a different way to make a menu? I tried Ruski's way, and it worked if I didn't change anything *including the stuff on the menu*. But if I changed even the slightest thing, it gave me errors. 102 to be exact all saying "cout is an aboligious *or whatever* statement", or something like that. I took out using namespace std; and changed iostream to iostream.h

  8. #53
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Code:
    Ok, i sent you the P.M
    i think he meant he found bugs in sang-drax's calc, maybe i am mistaken.

  9. #54
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    He was, but he also found some bugs in my code *well, not bugs, but helped me fix my menu(s)*

  10. #55
    x4000 Ruski's Avatar
    Join Date
    Jun 2002
    Location
    Outer Space!
    Posts
    542
    I think I know what could be the problem.. If you used gotoxy(); or SetColor(); you couldn't because those functions aren't in the C++ Functions, it's a user-made function so you'll have to include the header file ("function.h" or whatever it was..")
    Good Luck
    what does signature stand for?

  11. #56
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Good point...heh. But, would you still have to include conio.o *gotoxy is in the conio header(s)*

  12. #57
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    A header must always be included to use a function that is located inside of it.

    Aside from the above mentioned i didn't find much, i would usually be much more helpful but i am ripping out hair with my game haha.

  13. #58
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    If the program is compiling without any errors then the neccesity for a header is non-existent. Meaning that if you're finding errors with the actual program and not the code it doesn't have to deal with your header files.

  14. #59
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Originally posted by TechWins
    If the program is compiling without any errors then the neccesity for a header is non-existent. Meaning that if you're finding errors with the actual program and not the code it doesn't have to deal with your header files.
    RoD> Ok, thnx. That's exactly the same way I feel right now *hehe*.

    TechWins> I'm getting errors with the cout and cin stuff.

    How would I let the user input decimal numbers *like 2.3, and etc...*

  15. #60
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    TechWins> I'm getting errors with the cout and cin stuff.
    How would I let the user input decimal numbers *like 2.3, and etc...*
    First one:

    Its more then likely a need for <iostream.h> //input output

    Second one:

    Declare the input variable as a double.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Integer Emulation
    By Elysia in forum C++ Programming
    Replies: 31
    Last Post: 03-18-2008, 01:03 PM
  2. undefined reference
    By 3saul in forum Linux Programming
    Replies: 12
    Last Post: 08-23-2006, 05:28 PM
  3. C++ Operator Overloading help
    By Bartosz in forum C++ Programming
    Replies: 2
    Last Post: 08-17-2005, 12:55 PM
  4. MSVC Template Constructor/Assignment Errors
    By LuckY in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2005, 02:57 PM
  5. Why is my program freezing?
    By ShadowMetis in forum Windows Programming
    Replies: 8
    Last Post: 08-20-2004, 03:20 PM