Skip to main content
Add paragraphs
Source Link
Stephen Rauch
  • 4.2k
  • 12
  • 23
  • 36

For a strictly C++ effort, your use of objects could be considered commendable, from a certain perspective. However, your program is very long for a table. In fact, I wrote a similar program a few days ago that uses only 14 lines of code. To implement the degree sign would be 15, and most of it is just a simple for-loop. You would do well to avoid overcomplicating with objects if you want to do a task that requires some text output. 

Instead of using a class, make a namespace that includes a double function that returns the calculated number. Take a look at lines 17 to 31 here. 

You should also consider implementing getopt from unistd.h so that you don't have to write your own argv[] parser.

For a strictly C++ effort, your use of objects could be considered commendable, from a certain perspective. However, your program is very long for a table. In fact, I wrote a similar program a few days ago that uses only 14 lines of code. To implement the degree sign would be 15, and most of it is just a simple for-loop. You would do well to avoid overcomplicating with objects if you want to do a task that requires some text output. Instead of using a class, make a namespace that includes a double function that returns the calculated number. Take a look at lines 17 to 31 here. You should also consider implementing getopt from unistd.h so that you don't have to write your own argv[] parser.

For a strictly C++ effort, your use of objects could be considered commendable, from a certain perspective. However, your program is very long for a table. In fact, I wrote a similar program a few days ago that uses only 14 lines of code. To implement the degree sign would be 15, and most of it is just a simple for-loop. You would do well to avoid overcomplicating with objects if you want to do a task that requires some text output. 

Instead of using a class, make a namespace that includes a double function that returns the calculated number. Take a look at lines 17 to 31 here. 

You should also consider implementing getopt from unistd.h so that you don't have to write your own argv[] parser.

Source Link

For a strictly C++ effort, your use of objects could be considered commendable, from a certain perspective. However, your program is very long for a table. In fact, I wrote a similar program a few days ago that uses only 14 lines of code. To implement the degree sign would be 15, and most of it is just a simple for-loop. You would do well to avoid overcomplicating with objects if you want to do a task that requires some text output. Instead of using a class, make a namespace that includes a double function that returns the calculated number. Take a look at lines 17 to 31 here. You should also consider implementing getopt from unistd.h so that you don't have to write your own argv[] parser.