Jump to content

C project

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
thenewbiecoder

thenewbiecoder

    Newbie

  • Members
  • Pip
  • 3 posts
Post Office Project

I have to do this project, but I really don't know how to. If someone could help me, please do, I would really appreciate it :)

We suppose we have N cities identified by a numeric code and by their geographical position (north, center, south) and many different postal products identified by a code, a type (letter, recorded delivery, etc.)and shipping prices.
For each city it's possible to insert a max of M products.
The program must allow the user to:
-given a city, the user can insert a new product, if possible. We have to consider the positions of previously entered products.
-calculate entire price of products for a city.
-delete a shipped product.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Are you looking for help on the strategy or code? For code, we would need to see what you've written so far.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Guest_Jordan_*

Guest_Jordan_*
  • Guests
What have you create so far? Where are you having problems with?

#4
thenewbiecoder

thenewbiecoder

    Newbie

  • Members
  • Pip
  • 3 posts
I have problems on creating the algorithm, so I need suggestions to deal with it.

Thanks in advance if you can help me :)

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Since I'm a little fuzzy on how the cities are supposed to work, I'd start with how to represent that.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#6
thenewbiecoder

thenewbiecoder

    Newbie

  • Members
  • Pip
  • 3 posts
pastebin.com/d2aebe175

that's what I did, but I miss the correct way to delete an item from the cue... anyone could help me?

#7
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
The basic logic for inserting/deleting data from an array:
To insert, find where to insert. Then move everything after where you'll insert one position down in the array. Then insert in the newly created space.

To delete find where to delete. Then move everything after up one, starting with the next element.

Note: the logic for insert and delete is very similar.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog