School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,506 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,903 people online right now. Registration is fast and FREE... Join Now!




How to test Pseudocode

 

How to test Pseudocode, Testing pseudocode and understanding where you went wrong

jpconleyiv

16 Mar, 2009 - 06:56 PM
Post #1

D.I.C Head
Group Icon

Joined: 9 Mar, 2009
Posts: 88



Thanked: 4 times
My Contributions
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.

User is offlineProfile CardPM
+Quote Post


krum110487

RE: How To Test Pseudocode

16 Mar, 2009 - 07:37 PM
Post #2

D.I.C Regular
***

Joined: 7 Feb, 2009
Posts: 265



Thanked: 33 times
My Contributions
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:

CODE

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 Mar, 2009 - 07:39 PM
User is offlineProfile CardPM
+Quote Post

jpconleyiv

RE: How To Test Pseudocode

16 Mar, 2009 - 07:41 PM
Post #3

D.I.C Head
Group Icon

Joined: 9 Mar, 2009
Posts: 88



Thanked: 4 times
My Contributions
QUOTE(krum110487 @ 16 Mar, 2009 - 07: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:

CODE

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.
User is offlineProfile CardPM
+Quote Post

KYA

RE: How To Test Pseudocode

16 Mar, 2009 - 09:14 PM
Post #4

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 11,192



Thanked: 489 times
Dream Kudos: 2825
Expert In: C, C++, Java

My Contributions
You could always mock up a quick, small program to "run some numbers".
User is offlineProfile CardPM
+Quote Post

rahulbatra

RE: How To Test Pseudocode

17 Mar, 2009 - 01:35 AM
Post #5

D.I.C Head
Group Icon

Joined: 28 Dec, 2005
Posts: 176



Thanked: 2 times
Dream Kudos: 275
My Contributions
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.
User is offlineProfile CardPM
+Quote Post

jpconleyiv

RE: How To Test Pseudocode

17 Mar, 2009 - 08:36 PM
Post #6

D.I.C Head
Group Icon

Joined: 9 Mar, 2009
Posts: 88



Thanked: 4 times
My Contributions
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!!!
User is offlineProfile CardPM
+Quote Post

sudoNut

RE: How To Test Pseudocode

20 Apr, 2009 - 03:01 PM
Post #7

New D.I.C Head
*

Joined: 19 Apr, 2009
Posts: 21



Thanked: 2 times
My Contributions
Check out the links in my replay at the end of this post http://www.dreamincode.net/forums/index.ph...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
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 05:09AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month