Results 1 to 6 of 6

Thread: Modules & program Design

  1. #1
    Join Date
    Mar 2009
    Beans
    2

    Modules & program Design

    Can anyone help me? I have homework due tomorrow and I am stuck on #1. Here is my issue: Rewrite the following pseudocode so that the user input and calcuations are each in a spearate module. Include a comment at the beginning of each module that describes the purpose of that module. A line containing a comment should bening with a single quote ('). You should have a data entry module, a calculation module, and an output module.

    start
    num quantityOrdered
    num itemPrice

    print "Enter an Order Quantity"
    read quantityOrdered

    print "Enter the Items Price"
    read itemPrice

    if quantityOrdered > 100 then
    discount =.20
    else
    if quantityOrdered > 12 then
    discount =.10
    else
    discount = 0
    endif
    endif

    total = price * quantityOrdered
    total = total - discount * total
    print total
    stop


    All help ASAP would be greatly appreciated.

  2. #2
    Join Date
    Aug 2005
    Location
    Fargo, ND, USA
    Beans
    1,499
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: Modules & program Design

    No one's going to help you unless you have specific questions. Read the stickies.
    http://ubuntuforums.org/showthread.php?t=717011
    Help yourself: Search the community docs or try other resources.
    Quote Originally Posted by Henry Spencer
    Those who do not understand Unix are condemned to reinvent it, poorly.
    Let science use your computer when you aren't: Folding@Home.

  3. #3
    Join Date
    Mar 2009
    Beans
    2

    Re: Modules & program Design

    Sorry, my question is, how do I create a module for data entry?

  4. #4
    Join Date
    Jun 2007
    Location
    Porirua, New Zealand
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Modules & program Design

    Quote Originally Posted by SLeigh1213 View Post
    Sorry, my question is, how do I create a module for data entry?
    I suspect that the answer can be found in what you understand to be a "module" and what you understand to be "data entry"..... perhaps there is something in your course notes that can help.

    EDIT: here's a hint as to what might be expected: http://www.computerhope.com/jargon/d/dataentr.htm
    Last edited by lisati; March 15th, 2009 at 01:02 AM.
    Forum DOs and DON'Ts
    Never assume that information you find using a search engine is up-to-date.
    Please use CODE tags.
    A low-volume blog

  5. #5
    Join Date
    Feb 2008
    Beans
    367

    Re: Modules & program Design

    It would really help if you were to tell us what language you are using as well. There are multiple approaches to your problem. Although somewhat trivial for any other purpose than learning, you could implement your solution with an OOP design, although an imperitave design would be as equally effective given the simplicity of the problem.

    So basically, we need more information to help you.

  6. #6
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Modules & program Design

    A line containing a comment should bening with a single quote (')
    I smell BASIC.

    EDIT: I also think that module == function
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •