Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


pseudocode clarification

Posted on 2004-04-01
Medium Priority
Last Modified: 2010-05-18
Hi guys, I'm no good at pseudocode. But I want to confirm with an expert, how would you professionally
write pseudocode from the below information.

Calculate Postage based on the following..

1. user will enter the weight of the item being posted in a text box
2. user will select the service required (there must be two options air and
surface mail)
3. user then will press calculate button that will display the cost.


Yes, i know it sounds simple, but call me paranoid. Have to make sure its to the boss's liking.
Thankyou in advance
Question by:elusivesoul
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 101

Assisted Solution

mlmcc earned 800 total points
ID: 10732245
I won't guarantee it is to the bosses liking

1.  Get weight of package from the user
     a.  Prompt user for the weight - "What is the weight of the package being sent : "
     b.  Read user input
2.  Get the service level required
     a.  Prompt user for the service level
         1)  Repeat
              a)  Display menu A- Air  S - Surface
              b)  Read user selection
             Until selection is A or S
3.  When user requests calculation
     a.  Calculate postage due using the
          1) Air formula
          2) Surface formula

If this were to be a visual interface I would probably develop a screen view in VB or PowerPoint as

     Package Weight - TEXTBOX FOR ENTRY

    OPTION BOX    Air
    OPTION BOX    Surface

    COMMAND BUTTON - Calculate Postage

    Postage Due  -  TEXBOX FOR RESULT


Author Comment

ID: 10732371
thanks mlmcc. Well, i was searching through our shared folder at work, and i came across this one from last year. How would u tailor it to the below one?.

ihcar            range                   age
barina       city                       17
skyline       country               21+

If they choose
Car val=1
If they choose skyline
Car val=2
If they choose mitso
Car val=3

If they choose city
Range val= 1
If they choose country
Range val=2

If age=17
Age val=3
If  age val=1

Total=car val + range val+ age val+ base rate

Expert Comment

ID: 10734169
You need to know the surface and air formulas before you can write the proper pseudocode.
In other words, if a user enters a weight and selects surface, how do we work out the cost? and if they select a wieght and select air, how do we work out that cost?
If you tell us that we'll be able to give you proper pseudocode :)
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 11

Accepted Solution

Mighty_Silly earned 1200 total points
ID: 10734656
Going with the example you provided, how's this:

Calculate Postage based on the following..

1. user will enter the weight of the item being posted in a text box
2. user will select the service required (there must be two options air and
surface mail)
3. user then will press calculate button that will display the cost.

weight            service
user input         air
user input         surface

they enter weight (required. can't calculate with no weight)
weight = user input

they select service
If they choose Air
service val= 1
If they choose Surface
service val=2

Total=car val + range val+ age val+ base rate
Postage = (check Weight & check Service selection)
If both requirements are satisfied, proceed with below calculation.  If not, goto Prompt.
Define Service fee
Service Fee = Fulfill Service fee based on set formula.  formula is unknow at this time
(example:  Air = 1; 1 = 10 + base rate.
                Surface = 2; 2 = 20 + base rate)
Postage = Weight + Service Fee (from above determination.)
(since we don't know Service fee formula at this time, it is best to break it off into another
calculation, right before using the fee with weight.  This fulfills the "Modular" coding requirement.
Doing this allows flexibility when converting from pseudocode to real action.)
Note: Formula for Service

Prompt user to fulfill both requirements



Author Comment

ID: 10735473
thanks guys, your help has been much appreciated..
LVL 27

Expert Comment

ID: 10736051
Hi elusivesoul,

make a textbox, call it Weight,
make either
a Combobox, call it AirSurface, with List values as Air; Surface (I will use this option for this example).
2 check boxes in an option group, call them Air and give it an option value 1, and Surface and give it an option value 2
make a Command button, call it Command1
Make another txt box, call it  TotalPrice.
click on the properties of the command1 button, go to the On Click, and place the following in the code:

If me!AirSurface="Air" then
 TotalPrice=Weight * 1.2 ' assuming 1.2 is for Air mail
elseIf me!AirSurface="Surface" then
 TotalPrice=Weight * .8 ' assuming .8 is for Air mail
end if

Hope this helps

LVL 101

Expert Comment

ID: 10737701
Glad I could help


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question