How to choose a solution among many solutions

Hello,

About exercise 7 of chapter 10 of PPP (page 372): changing the calculator to gives us the result of the roman numerals, like XXI + CIV = CXXV.

At *first* time there are two solutions for solving it in my mind.

First is, giving each roman number to a function like the one existing in exercise 6 and then get their integer numbers and then calculate them by the calculator of chapter 7 and finally make a function to convert the result to roman mode. (simpler)

Second is to change the calculator from chapter 7 to calculate roman numbers inside itself and gives the result again in roman mode. (harder)

As an important step of ‘solving the problems’/’programming’, how can I make decision to choose a solution for solving a problem.
Please note I don’t want to get the solutions (my favorite food is solving the programming problems!), the thing I’m looking for is you guys guide me how to choose a solution among many solutions. Is the simplicity of a solution best factor for choosing it?

Best.
Last edited on
@khostip - it will be like "cin>>value, an then cin>>anothervalue, value+anothervalue" or enter all the expression?
you don't have the PPP book?
http://www.stroustrup.com/Programming/
About exercise 7 of chapter 10 of PPP (page 372)

I have no idea what this is sorry mate.

Is the simplicity of a solution best factor for choosing it?

In my opinion, most definitely. As long as it answers the requirements of your project, the simpler the better (unless you need to consider speed and optimisation issues, but i guess that falls under your requirements as well).
Last edited on
thanks 'mutexe' for your opinion.
you don't have the PPP book?

Sorry, I don't.
you don't have the PPP book?

Nah mate, I'm not a big fan of his books to be honest.
@iQChange:
We first have an integer numbers calculator program. Then also have a program that if we give it a roman number it gives us its integer mode. The exercise wants us that using that integer numbers calculator write a program that calculates the expressions of roman numerals (as above one). Could I say it clear? If so, so you can now get back to first post and say your opinion please.
For me, first is the better, just make the reverse function
Topic archived. No new replies allowed.