How to test Pseudocode

Testing pseudocode and understanding where you went wrong

Page 1 of 1

6 Replies - 20697 Views - Last Post: 20 April 2009 - 04:01 PM

#1 JamesConley  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 19
  • View blog
  • Posts: 341
  • Joined: 09-March 09

How to test Pseudocode

Post icon  Posted 16 March 2009 - 07:56 PM

Here is my first lab, this is actually what I turned in. I would like to know if their is any software that I can test it with. I would like to get better at pseudocode, but my teacher more or less refuses to help anyone.

start
perform housekeeping ()
while not eof
perform mainloop ()
endwhile
stop

housekeeping ()
num OrigPrice
num itemNum
num discount = 10%
num discountPrice
num day=0
string description
string Header = “Rose’s Secondhand Resale Shop”
string ColHead= “Original Price Item Number Description Day Discount Price”
Print Header
Print ColHead
get origPrice, itemNum, description
return

mainloop()
day = 1
while day =1
Print origPrice, itemNum, description, day, discountPrice
while day < 7
discountPrice = discountPrice – (discount * discountPrice)
Print origPrice, itemNum, description, day, discountPrice
day = day +1
endwhile
endwhile
get origPrice, itemNum, description
return

Thanks in advance for taking time to read this and send me an some sort of direction.

Is This A Good Question/Topic? 0
  • +

Replies To: How to test Pseudocode

#2 krum110487  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 291
  • Joined: 07-February 09

Re: How to test Pseudocode

Posted 16 March 2009 - 08:37 PM

It is impossible to "Test" Pseudocode, other than by hand, and if you could. It wouldn't exactly be Pseudocode.

Pseudocode is simply programming but in plain english, so the best way to test it is to understand what is going on and run though it line by line.

this may be more along the lines of what an educator wants:

Start
	 Initialize X variable
	 
	 Set X equal to 1
	 
	 Loop from X to 100 and Print out X
End


but in reality there is no "Wrong" way of doing pseudocode, just the way the prof wants it...

Try searching google for the "Proper" way or his way and try to mimic it.

This post has been edited by krum110487: 16 March 2009 - 08:39 PM

Was This Post Helpful? 1
  • +
  • -

#3 JamesConley  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 19
  • View blog
  • Posts: 341
  • Joined: 09-March 09

Re: How to test Pseudocode

Posted 16 March 2009 - 08:41 PM

View Postkrum110487, on 16 Mar, 2009 - 07:37 PM, said:

It is impossible to "Test" Pseudocode, other than by hand, and if you could. It wouldn't exactly be Pseudocode.

Pseudocode is simply programming but in plain english, so the best way to test it is to understand what is going on and run though it line by line.

this may be more along the lines of what an educator wants:

Start
	 Initialize X variable
	 
	 Set X equal to 1
	 
	 Loop from X to 100 and Print out X
End


but in reality there is no "Wrong" way of doing pseudocode, just the way the prof wants it...

Try searching google for the "Proper" way or his way and try to mimic it.

Thanks for your input, I see now what you mean that it wouldn't be pseudcode if you could test it.
Was This Post Helpful? 0
  • +
  • -

#4 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3106
  • View blog
  • Posts: 19,145
  • Joined: 14-September 07

Re: How to test Pseudocode

Posted 16 March 2009 - 10:14 PM

You could always mock up a quick, small program to "run some numbers".
Was This Post Helpful? 0
  • +
  • -

#5 rahulbatra  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 185
  • Joined: 28-December 05

Re: How to test Pseudocode

Posted 17 March 2009 - 02:35 AM

Pseudocode by definition is a pretty free format. The only real way to "test" a pseudocode would be to dry-run it by hand which has some limitations of human prone errors.

Try to see what real programming language most resembles the pseudocode you write and convert it into a legal program. Running it through a legal compiler would solve your problem then. Kinda.
Was This Post Helpful? 0
  • +
  • -

#6 JamesConley  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 19
  • View blog
  • Posts: 341
  • Joined: 09-March 09

Re: How to test Pseudocode

Posted 17 March 2009 - 09:36 PM

Thanks everyone, I appreciate your time. For the time being I will just keep rockin pseudocode, this summer I will be in my first Java class. As far as I have researched, I think I will have a better understanding once I have put all of this with a language. I had asked my teacher about this and she said no that is a horrible way to learn it, funny how that is how Standford teaches it (with a language). They teach the intro/basics along with Java. Not saying that they are right, but its a hell of a lot better school than I am at!!! Again Thanks!!!
Was This Post Helpful? 0
  • +
  • -

#7 sudoNut  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 19-April 09

Re: How to test Pseudocode

Posted 20 April 2009 - 04:01 PM

Check out the links in my replay at the end of this post http://www.dreaminco...h...c=99885&hl=

It may help you understand pseudo code at bit more. I recommend you start learning Java or even C++.

When you hear... you forget. When you see... you remember. When you do... you understand
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1