lol, programming

Discussion in 'Off Topic' started by dumpster_fox, Jul 17, 2006.

  1. dumpster_fox

    dumpster_fox Member

    Messages:
    1,716
    Likes Received:
    0
    Trophy Points:
    0
    For my CISP300 class, we have to churn out pseudocode for a flowchart that we churned out earlier. I've done the churning, but I'd like a second opinion on my work. It would be great of any of you code-literate people out there (and I know that forum-goers other than Krenzo know this stuff) could take a second to look over my work and point out any glaring errors. Both the flowchart and the pseudocode are in Word format, zipped up and attached to this post. Don't worry about errors in the flowchart, my crazy-ass professor hasn't actually graded it yet, and he has said that any errors in our pseudocode that mirror errors in out flowchart won't be knocked for points. Don't try to hard to comprehend the program, either; it's some convoluted and confusing transaction update system. (The professor is a COBOL guy. Euugh.)

    Thanks, guys (and Dee)! :D
     

    Attached Files:

  2. MOOtant

    MOOtant Member

    Messages:
    4,047
    Likes Received:
    0
    Trophy Points:
    0
    FFS. If you're making flowchart don't save them in a .doc file. I don't want to reinstall this fucking word just to see some images. BTW flowcharts suck. If you really need it please convert to bitmap image. :P
     
  3. Darg

    Darg Member

    Messages:
    623
    Likes Received:
    0
    Trophy Points:
    0
    I'd help but I don't know the language that you're using so I wouldn't be any better at it then you.

    What language is it actually and what is the program supposed to do?
     
  4. dumpster_fox

    dumpster_fox Member

    Messages:
    1,716
    Likes Received:
    0
    Trophy Points:
    0
    It's just pseudocode. It's not an actual language, it isn't supposed to compile or run or anything. It's just supposed to be an easily readable representation of the program.

    The program is just supposed to read data, check the different transactions, print/write reports... Shit, I don't know, I just wrote the damn thing. Seriously, it has the worst instructions ever. I just want another pair of eyes to look over it and see if I made a stupid mistake somewhere.

    MOOtant, I'll try to get some image versions of the flowcharts when I have the time. It doesn't matter whether flowcharts suck or not, by the way, that was the assignment that I wrote the pseudocode for.

    Seriously, people, if it's going to be a huge hassle for you to check it, don't bother. I just wanted someone to take a second and peek at it to see where I made mistakes.
     
  5. Darg

    Darg Member

    Messages:
    623
    Likes Received:
    0
    Trophy Points:
    0
    From what I can see it's mostly fine. However when EOF is false and it runs through the bad case scenarios it seems that because you are using If/Else methods the TEC value will never be equal to 000. For example if the customer name is blank then you set it to 200 else 201. Either way TEC will not be 000.

    I may be mistaken by some of the code but you might want to look over that.

    Other then that it looks good.
     
  6. theBlind

    theBlind Member

    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    CASEENTRY TRANSACTION-TYPE
    	CASE ‘A’
    		Move “ADD” to print line
    	CASE ‘U’
    		Move “UPDATE” to print line
    	CASE ‘D’
    		Move “DELETE” to print line
    	CASE other
    		Move TRANSACTION-TYPE to print line
    ENDCASE
    Move CUSTOMER-NUMBER to print line
    So, Move VALUE to Register does append or overwrite?
    If overwrite, you'll have to make something that appends here, if append, you'll usually have to delete your registers before moving stuff into them for output, say:
    Code:
    Move transaction record to output buffer
    Write output buffer
    If move appends, this will not only print the transaction record, but also anything else in the output buffer.
    Or does write empty the buffer after writing?

    Is there a difference between (write/print) output-buffer?


    Code:
    			CASEENTRY STATE
    				CASE ‘CA’
    				CASE ‘WA’
    				CASE ‘NV’
    				CASE other
    					Set TEC = ‘201’
    					Add 1 to INVALID-A
    			ENDCASE
    
    Is that supposed to do something in the CASE not-other states? And do you need something akin to a c/c++ break to signify that only one case is used, not all? Even in pseudocode, that's still an important distinction if it's not ruled upon by the underlying language you use.
     
  7. Chahk

    Chahk Member

    Messages:
    1,390
    Likes Received:
    0
    Trophy Points:
    0
    The flowchart looks fine.

    I'd slightly change the main program of the pseudocode:

    Code:
    Start
    Perform Initialization Module
    Perform Print Headings Module
    
    DOWHILE not EOF
       Read Transaction Records
       Perform Validate Transaction Record Module
    
        IF TEC = 000 THEN
           Perform Write Valid Record Module
        ELSE
           Perform Print Invalid Record Module
        ENDIF
     
    ENDDO
    
    Perform Print Totals Module
    Perform End of Program Routine
    Stop
    
    You don't need to check for EOF again within the WHILE loop.
     
    Last edited: Jul 17, 2006
  8. ^Dee^

    ^Dee^ Former Super Moderator

    Messages:
    4,385
    Likes Received:
    6
    Trophy Points:
    0
    I would check but I don't have anything other than notepad installed =P
     
  9. Chahk

    Chahk Member

    Messages:
    1,390
    Likes Received:
    0
    Trophy Points:
    0
    Openoffice.org
     
  10. Niarbeht

    Niarbeht Member

    Messages:
    2,010
    Likes Received:
    0
    Trophy Points:
    0
    OPENOFFICE FOR TEH WINZOR!

    Yeah, OpenOffice rocks. It's true. Hope you enjoy it, ^Dee^.
     
  11. MOOtant

    MOOtant Member

    Messages:
    4,047
    Likes Received:
    0
    Trophy Points:
    0
    That's 100MB or more to dl. Even if it's smaller it's stupid to use such a program to write some pseudo-code.
     
  12. Niarbeht

    Niarbeht Member

    Messages:
    2,010
    Likes Received:
    0
    Trophy Points:
    0
    Write pseudo-code... or your next essay... and also make the flow chart... not to mention a power point presentation... and a spreadsheet...
     
  13. dumpster_fox

    dumpster_fox Member

    Messages:
    1,716
    Likes Received:
    0
    Trophy Points:
    0
    Thanks a lot, guys (and Dee). I brought these up in class yesterday, and he pretty much okayed everything you pointed out. Now, to address the comments:

    Darg, TEC (which stands for Transaction Error Code, not that it matters) is set to '000' at the beginning of the Validation module.

    theBlind, all of those confusing commands (write/print, the moving, etc) are pretty much professor approved. In the CASE not-other states in the part you mentioned, they are not actually supposed to do anything. I brought that up specifically in class, and he said that the way that's structured is fine, although something like this:
    Code:
    IF STATE =/= 'CA' or 'WA' or 'NV'
           Set TEC = 'xxx'
           Add 1 to INVALID-x
    ENDIF
    would be preferable. Good eye, though.

    Chahk, I also asked about that, as I was wondering about that myself. There's no priming read (a read of the file outside the loop), and I didn't know what it would do if I did an EOF check with no file read, so I just popped another in there after the read, because that's how the book shows it done. I still didn't get a definitive answer from him, but I'm more inclined to believe you, sooo I guess I'll take your word for it.

    Sorry about taking so long to reply to my own thread. I was stressing out over a Microecon midterm I had today. 37.5 minutes to write an essay question with like ten graphs on average. Blarg. I think I did okay, though.
     

Share This Page