My latest program(featuring most of the functions I know)

This is a discussion on My latest program(featuring most of the functions I know) within the C++ Programming forums, part of the General Programming Boards category; Here it is. I hope you enjoy. You could try to revise the .cpp file and make it advance/better....

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    106

    My latest program(featuring most of the functions I know)

    Here it is. I hope you enjoy. You could try to revise the .cpp file and make it advance/better.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    106
    no response yet?

  3. #3
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    Y'know... You whine about people getting mad at you for thread bumping, and then you pull this...

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    106
    ok..............whatever

  5. #5
    Registered User GuyOnDrugs's Avatar
    Join Date
    Mar 2002
    Posts
    8
    lol seriously man stop bumpin threads big dog... =)

  6. #6
    Registered User
    Join Date
    Jan 2002
    Posts
    106
    How am I gonna learn new stuff if no one replies to my topics?

  7. #7
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    I don't know... Out of a book?

  8. #8
    ...
    ... is offline
    Registered User
    Join Date
    Feb 2002
    Posts
    465
    when you answer your age as less than 10, you get both the messages for <=10 and <=20

    and when looking at your code, i notice a whole section that doesnt get executed. its the section that tells the user to email you, etc etc... right after the stalker sub-program.

    also, you should impliment something that allows you to return to the main menu from the sub-programs.

    otherwise, your program is fine.
    I came up with a cool phrase to put down here, but i forgot it...

  9. #9
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640
    um
    your variable math
    make it a long doube, not an int.
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  10. #10
    Registered User
    Join Date
    Jan 2002
    Posts
    106
    ok.........I'll try that

  11. #11
    Registered User rmullen3's Avatar
    Join Date
    Nov 2001
    Posts
    330
    Mreh...

    #defining over a keyword?
    Really, there's isn't a point...

    "your variable math
    make it a long doube, not an int."

    Why in the hell would he do that?

  12. #12
    Intranasal Heroin User Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,035
    im not a teen!
    anyway i looked at your code and now i know that you read teach yourself C++ in 24 hours

  13. #13
    ...
    ... is offline
    Registered User
    Join Date
    Feb 2002
    Posts
    465
    Originally posted by rmullen3
    "your variable math
    make it a long doube, not an int."

    Why in the hell would he do that?
    try putting in numbers such as 1938749825725 and 29587459875.... while 'math' is only an int, it can only process numbers between like -2 billion and 2 billion i think...
    I came up with a cool phrase to put down here, but i forgot it...

  14. #14
    Registered User
    Join Date
    Mar 2002
    Location
    South Africa
    Posts
    35

    that exhibition...

    how about adding error-checking to the calculator? for instance, if you input any alphabetical character (or string) instead of a number, it quits.
    I code.
    I think.
    Ergo, I think in code.

  15. #15
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    After a quick test and scanning of the code I have three objections.

    1) Redefining the class keyword just obfuscates your code, don't redefine unless there is a real advantage.

    2) You don't check for valid input, such as a division by 0. The program chokes on that and it shouldn't. You should print an error to the user and give them another chance or at least warn them before the program dies.

    3) Your code isn't portable. C was designed to be generic to all systems that support the language. We as programmers should respect that and write portable code whenever possible. Use implementation defined constructs when you absolutely MUST.

    -Prelude
    My best code is written with the delete key.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Functions and Classes - What did I do wrong?
    By redmage in forum C++ Programming
    Replies: 5
    Last Post: 04-11-2005, 12:50 PM
  2. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 03:35 AM
  3. Factory Functions HOWTO
    By GuardianDevil in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2004, 02:41 PM
  4. Shell functions on Win XP
    By geek@02 in forum Windows Programming
    Replies: 6
    Last Post: 04-19-2004, 06:39 AM
  5. functions - please help!!!!
    By linkies in forum C Programming
    Replies: 1
    Last Post: 08-21-2002, 08:53 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21