comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <marin.condic.auntie.spam@pacemicro.com>
Subject: Re: About a design for a supermarket POS (Point of Sale System)
Date: Fri, 2 Mar 2001 14:02:09 -0500
Date: 2001-03-02T19:02:53+00:00	[thread overview]
Message-ID: <97oqot$7d7$1@nh.pace.co.uk> (raw)
In-Reply-To: 97okk9$ll29@tech.port.ac.uk

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4276 bytes --]

This clearly looks like a homework problem. Generally, we're willing to help
with homework assignments if you have a) made an honest effort to find the
answer through traditional means and b) have a *SPECIFIC* question in mind.

Seeing as how you have at least attempted a solution, it doesn't look like
you are asking us to do your homework for you. However, your question is
pretty broad and vague. Is there some particular part of this that has you
confused?

Also, for some reason your code has no indentation. This makes it terribly
hard to look at. Try to get it to the newsgroup as plain ASCII with spaces
instead of tabs & maybe it will appear correctly.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/




"MYC" <fartmanx@hotmail.com> wrote in message
news:97okk9$ll29@tech.port.ac.uk...
> Dear Sir,
>
> I have some problems about Ada.  I am not sure whether it is correct.
Would
> you help me check it?  Thank you very much.
>
> ��The exercise is to write a design for the solution of the problem, which
> simulates aspects of a supermarket POS (Point of Sale System), while the
> design should consist of Ada or pseudo code for the main procedure, a
> definition of all user defined types, a definition of the arrays and / or
> records used and for each subprogram proposed in this solution including
the
> name of the subprogram, an English description of what it does and the
data
> passed into and out of the subprogram.
>
> Also, the user enters an 8 digit binary number (the bar code), which is
> converted to a decimal equivalent.  This decimal value can be used to
locate
> the data for the product.
>
> Moreover, the program is menu driven requiring the following options:
>  Process a shopping basket of goods
>  Modify or add new product details
>  Run off a product inventory by bar code order
>  List product details in alphabetic product name order
>  Report on any product below the (user supplied) re-order level��
>
> Example data and program requirements
>
> BINARY CODE     PRODUCT     PRICE     QUANTITY
> 0000 0001       COFFEE      2.75        27
> 0000 0010       BREAD       0.44       120
> 0000 0011       MILK        0.89        47
> 0000 0100       Nil         0.00         0
>
> 1111 1100       LIME PICKLE 1.59        30
> 1111 1101       Nil         0.00         0
> 1111 1110       BASMATI     3.99        67
> 1111 1111       TOM YUM     0.55        32
>
>
============================================================================
> =
> My solution is as follows:
>
> 1. User Defined Data Types
>
> type PRODUCT_TYPE IS
> subtype BINARY_CODE is STRING (1..8)
> subtype NAME is STRING (1..12)
> subtype PRICE is FLOAT range 0.00..1000.00
> subtype QUANTITY is STRING range 0..1000
>
> type MENU IS (PROCESS, MODIFY, ADD, DISPLAY1, DISPLAY2, REPORT, QUIT)
>
>
> 2. Data Structures �C Records and Arrays
>
> Record to represent a product:
>
> type PRODUCT is a record
> BAR-CODE   : INTEGER
> DESCRIPTION  : NAME
> VALUE    : PRICE
> RESTOCK     : QUANTITY
> KIND     : PRODUCT_TYPE
> end record
> ITEM : PRODUCT;
>
> Array of products:
> type PRODUCTS is array (1,..1000) of PRODUCT
>
> 3. Ada Based Design for Main Procedure
>
> Procedure POINT_OF_SALE_SYSTEM is
> THE_PRODUCTS: PRODUCTS
> begin
> CREATEPRODUCTS;
> loop
> DISPLAYMENU;
> GET(MENU_CHOICE);
> exit when MENU_CHOICE = QUIT
> case MENU_CHOICE is
> when PROCESS T PROCESS_SHOPPING_BASKETS
> when MODIFY  T MODIFY_PRODUCT_DETAILS
> when ADD     T NEW_PRODUCT
> when DISPLAY1 T DISPLAY_PRODUCTS_BY_BARCODE_ORDER
> when DISPLAY2 T DISPLAY_PRODUCTS_BY_ALPHABETIC_NAME_ORDER
> when REPORT T REPORT_REORDER_LEVEL
> when OTHERS T PUT(��Unexpected menu choice!!��)
> end case
> end POINT_OF_SALE_SYSTEM
>
> 4.Subprograms Required
>
> CREATEPRODUCTS
> Description
> Initializes the array THE_PRODUCTS
>
> NEWPRODUCT
> Description
> Procedure to allow user to add a new product to the system
>
> GET(A_PRODUCT: out PRODUCT)
> Description
> Procedure to prompt user to input full details of a product
>
============================================================================
> ===
>
>
>
>
>
>





  reply	other threads:[~2001-03-02 19:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-02 17:18 About a design for a supermarket POS (Point of Sale System) MYC
2001-03-02 19:02 ` Marin David Condic [this message]
2001-03-02 19:26 ` Ken Garlington
2001-03-03  3:40 ` Gerhard Häring
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox