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?
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).
@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.