Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: ATM Machine c++ programming issue  (Read 4577 times)

0 Members and 1 Guest are viewing this topic.

anita84

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Windows 7
    ATM Machine c++ programming issue
    « on: January 15, 2016, 10:36:10 AM »
    Can anyone teach me what is thie mean?

    [attachment deleted by admin to conserve space]

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: ATM Machine c++ programming issue
    « Reply #1 on: January 15, 2016, 10:59:47 AM »
    You made a mistake. Not all paths return a value.
    Make sure you have correctly identified things.


    camerongray



      Expert
    • Thanked: 306
      • Yes
      • Cameron Gray - The Random Rambings of a Computer Geek
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Mac OS
    Re: ATM Machine c++ programming issue
    « Reply #3 on: January 15, 2016, 02:02:31 PM »
    You have a method that is meant to return something, this message means there is a way to flow through that method without calling the return function.  Check all loops and if statements, this could for example be caused by having an if statement without an else in it.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: ATM Machine c++ programming issue
    « Reply #4 on: January 15, 2016, 05:47:53 PM »
    A general rule is that your code should have only one way to return. But general rules are often broken.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: ATM Machine c++ programming issue
    « Reply #5 on: January 15, 2016, 11:20:59 PM »
    A general rule is that your code should have only one way to return. But general rules are often broken.

    "Single Entry, Single Exit" is a rule described by Dijkstra in his writings on Structured Programming. I don't think it really applies quite so strongly today, not because it isn't relevant or good advice, but because programming languages typically used today don't have the features that he was warning against using.

    Single Entry meant that functions should not have multiple entry points. This was a feature provided by FORTRAN and COBOL allowing a function to pepper alternate entry points within a single routine. Single Exit meant that a function should only return to a single place, the statement immediately following the call; the behaviour Dijsktra was warning against was the at the time common practice that a FORTRAN program would actually return to an alternate location other than the statement after the one that the function was called to indicate an error condition.

    These were not bad language designs, but at the time of their conception they were necessary for software to be performant on the hardware of the day, and, particularly for FORTRAN, competitive performance-wise with Assembly programming.
    I was trying to dereference Null Pointers before it was cool.

    Salmon Trout

    • Guest
    Re: ATM Machine c++ programming issue
    « Reply #6 on: January 16, 2016, 01:52:04 AM »
    I wish the person who is using Computer Hope to help them program for ATMs would kindly let us know which bank's ATMs their code is used on, so I can make sure never to use them? Not that I have anything against the quality of Computer Hope's help, but you know what I mean.