Jump to content

Logic Question

- - - - -

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

#1
fjchairul

fjchairul

    Newbie

  • Members
  • Pip
  • 1 posts
Hi,

I've been strugling with this logic for few days,
lets say the i have a translation program;
for example the doctor order 7mg of medicine for the patient
and in clinic only have tablet for 3mg and 2mg.
i want the system to translate
3mg = 1 tablet
2mg = 2 tablet.

now the problem is i want the big package as higher priority.
by looking at it is very simple, but how do we tell the system to translate it.
because not only we can give 2 package, it can be more than 3.

thx in advance

#2
cdg10620

cdg10620

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 389 posts
I guess that i'm not understanding what you are looking for exactly. Can you post the code that you have so far?

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
In general, there will be multiple ways to solve your problem. 6mg = 2 3mg tablets or 3 2mg tablets, for example.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog