Share via

How do I construct a pseudo code on Excel 2013?

Anonymous
2013-09-28T20:25:12+00:00

I have been asked to construct a pseudo code based on the information provided, but I am confused as to how I would type this out. I have no examples provided from my book or in-class lectures about a scenario similar to this so I don't seem to know how to approach this. All I seem to understand is that it starts as: =IF(

The result “Loan” is displayed for an applicant that has either salary greater than $100,000 and a credit score of at least 700, or a salary greater than $50,000 and a credit score of at least 750. Otherwise, the result 

displayed is “No Loan."

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2013-09-28T23:55:43+00:00

    When I was learning programming we had our knuckles slapped hard if our psuedo code contained anything that looked the the actual code format.

    We were taught that psuedo code is supposed to be an english statement of the logic we wish to program. It should be readable. It doesn't follow the syntax of any programming language. It can include descriptive text to make it more readable.

    So my "formal" psueodo code would never loo like =IF(...  It would be more like

    "IF it is a weekday

         pay at normal rate

    Else If it is a weekend

        pay at time and a half

    Else it is a holiday

       pay double time

    end if

    Excel is one of the last programs I would use for Pseudo coding. Word or any other text editor is better.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2013-09-29T02:43:33+00:00

    A gpa of 3.89 and 25 years of experience say I managed to get something right.

    Or they needed their star quarterback on the team really, really badly!

    And I hate the "We taught that in class on day 4.  Did you sleep through the class?" type instructors.  Especially when you are paying for the education - that's when I say "You're supposed to be teaching - I'm supposed to be learning; now teach again because obviously your teaching didn't impart learning the first time around."

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-09-29T01:11:13+00:00

    Hopefully the work isn't due Monday. Assuming it isn't due, I would say go back and ask the instructor and ask for further examples.  Hopefully you don't have one of those idiots who refuse to explain, they expect you to read their mind then complain when you don't.

    If it is due Monday, call around to your classmates, hang out at the library or programming lab to find someone in the course to explain it.  And as JJ suggests, do it a couple of ways so you have it ready to hand in any way.

    A gpa of 3.89 and 25 years of experience say I managed to get something right.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-09-29T00:19:06+00:00

    I think the instructor's intent is to get you to DEFINE THE PROBLEM - and that is a key step in doing just about anything even remotely resembling computer programming; in the case of Excel that being either creating a formula or writing some VBA code.

    I'm kind of siding with Rohn007 on this one - the Requirements Definition should be a readable living document, not a rehash of actual code.  If you take a statement like this:

    If applicant's salary is greater than $100K AND their credit score is equal to or greater than 700

    OR

    applicant's salary is greater than $50K AND their credit score is equal to or greater than 750 then

     Grant the Loan (display "Loan")

    Otherwise

     Deny the loan (display "No Loan")

    Then that statement (actually part of a Requirements Definition) can be 'translated' into any programming language or an Excel worksheet formula.  The key here is that the requirement is not directly tied to any specific language or application at all - it simply defines what rules the "program" must follow to provide the proper result.

    And actually the way I wrote it out 'translates' almost literally into joeu2004's 2nd formula.

    But we could be wrong - so if you get it marked wrong, take solace in knowing that we, too, blew it.  Of course, our GPA doesn't depend on our responses here.  But I'll say this:  having seen many solid results achieved by both joeu2004 and Rohn007, and having been formally trained to program myself and practicing it for over 30 years now, I think we might have gotten close.

    I will say there may be one caveat to all of this:  If the problem was presented to you in a way that you are certain that

    "All I seem to understand is that it starts as: =IF( "

    Then joeu2004's method may be exactly what the instructor is shooting for.

    You might consider providing BOTH methods back - give him/her a joeu2004 type answer, follow it up with a little "the above could also be written specifically as..." and toss in the word description of the requirement definition.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2013-09-28T20:41:53+00:00

    sKirb-bLez wrote:

    I have been asked to construct a pseudo code based on the information provided, but I am confused as to how I would type this out. I have no examples provided from my book or in-class lectures about a scenario similar to this so I don't seem to know how to approach this.

    Pseudo-code is not real code; and here, "code" seems to refer to Excel formulas.

    There are no rules for "pseudo code".  It can take many forms, whatever is convenient for you, the programmer.  It might be just English statements.  Or it might be of the same form as Excel formulas, but usually not anything that can be entered into Excel directly.  That is, don't worry about Excel syntax.

    sKirb-bLez wrote:

    All I seem to understand is that it starts as: =IF(

    The result “Loan” is displayed for an applicant that has either salary greater than $100,000 and a credit score of at least 700, or a salary greater than $50,000 and a credit score of at least 750. Otherwise, the result displayed is “No Loan."

    An example of pseudo-code for this might be a semi-English semi-Excel expression of the form:

    IF( (salary > $100,000 and score >= 700) or (salary > $50,000 and score >= 750), "Loan", "No Loan" )

    If you want to get closer to Excel syntax, you might write:

    IF(OR(AND(salary>100000,score>=700),AND(salary>50000,score>=750)),"Loan","No Loan")

    But IMHO, that's more than required for pseudo-code.  When writing pseudo-code, we want to focus on conveying the ideas, not worry about syntax and correct function usage.

    Was this answer helpful?

    0 comments No comments