hi im new to programming and iv got an assignment which i dont even know how to start can some one help me out here are the questions

a) Write pseudocode for a main menu. Note: you are not expected to write pseudocode for the options,
only the code to navigate the menu is required.
b) Draw a flowchart for a main menu.
c) Using appropriate test data, test the pseudocode written in Task 3a) by producing test plans, desk
checks and dry runs.

firstly how do i start my pseudocode and how do you test it finally for the flow chart i understand but for a and c im totally lost hope some one can help me out :S

Recommended Answers

All 8 Replies

It's pseudocode, there aren't any rules to follow, just make sure your logic is sound. Some people find flowcharts more intuitive, so you could start with that part of the assignment and derive the pseudocode from your result.

To be perfectly frank, this smells like a Programming 101 assignment. I understand that it can be overwhelming when starting out, but presumably you learned how to do all of this in class. I have a hard time believing that you don't know how to start unless you weren't paying attention in class (in which case I have no reason to help you because you won't help yourself first).

thanks for the reply if i knew how to start i wouldn't have ask for help im 3 month behind my class since i came in late for a certain reason that i could start the class. so ive miss a lot on this ive got notes but without proper explanation the notes is partly useless.i didnt ask to give me the whole answer but a guide of how to approach this.please help out thanks

>ive got notes but without proper explanation the notes is partly useless
You haven't asked your teacher to explain the parts you don't understand? That's what he's paid to do, after all.

>i didnt ask to give me the whole answer but a guide of how to approach this.
Actually, since this is the most basic of basics, I'd essentially be teaching you how to program. I'm afraid it's rather difficult to cram three months of prerequisite education into a forum post, and I'm actually not good at teaching the basics (I'm more of an intermediate/advanced teacher).

So try something, anything. Break the problem down into steps as if you were explaining how to do something to a very stupid person (which a computer is akin to). I'll get you started:

Start
Repeat Until Done
    Show Menu
    Get Option
    Run Option

ok so lets say my menu will consist of:

Main menu |Input new orders | Amend Orders |update orders |display stock

my presudocode will go as followed

[

Start programe

Repeat Until Done

Show Menu

Display:Input new orders

Display:Amend Orders

Display:update orders

Display:display stock

Get Option

if user choose {Input new orders} run option 1

else if choose {Amend Orders} run option 2

else if choose {update orders} run option 3

else if choose {display stock} run option 4

Run Option

option 1= (open new file to input new orders)

option 2= (open file need for amendment)

option 3=(open file need of update)

option 4= (get stock file and display stock)


end programe

]

i dont no if its right im trying

>i dont no if its right im trying
Didn't I already say there's no right or wrong with pseudocode? As long as the logic makes sense, you're solid. What you posted makes sense.

anyway since the assignment state Note: you are not expected to write pseudocode for the options,only the code to navigate the menu is required.

then i dont need the part get option of the presudocode?

since theres not right or wrong with presudocode how can i go about with the last question.

Using appropriate test data, test the pseudocode written in Task 3a) by producing test plans, desk checks and dry runs.

how can i test a code that has no right n wrong .

>then i dont need the part get option of the presudocode?
You're summarizing those steps rather than enumerating them, so I'd say what you have is fine.

>how can i test a code that has no right n wrong .
You misunderstand. There are no rules to pseudocode, but your logic can be faulty. The tests are for your logic rather than correct code. Come up with few test cases, and run them through the pseudocode to verify that the behavior is as expected. Here's an example of a test case:

1) Start the program
2) Enter an option not in the menu

Expected result: 
    Whatever you designed for this case, but 
    an error message and repeating the request
    for input is generally good behavior.

Take the test case and follow the steps of your algorithm as closely as you can. Then come up with as many test cases as needed to make you comfortable that the logic is correct for all possible execution paths.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.