Skip to main content
8 votes

Scientific Calculator

Imprecise pi Use at least DBL_DECIMAL_DIG significant digits. DBL_DECIMAL_DIG is commonly 17. Check input return values Detect ...
chux - Reinstate Monica's user avatar
7 votes
Accepted

Mathematical calculation of engine fuel injectors

SimilarCalculations is not a very good name. If we interpret it to be a superclass of your other two classes, it can simply be ...
Reinderien's user avatar
  • 62.4k
7 votes
Accepted

Calculation of centrifugal liquid propellant injectors

Thank you for citing a reference. worth dividing ... by type of construction The code is quite readable as it is. But we have 26 derived properties, so yes, if you can break out a couple of ...
J_H's user avatar
  • 29.2k
7 votes

Shunting yard calculator in C

while (1) { fgets(expr, 200, stdin); ... } What happens if fgets() fail? You are ignoring its return value. ...
Harith's user avatar
  • 8,906
6 votes
Accepted

Shunting yard calculator in C

Expanding on the idea of an array for the stack, the Node type wouldn't need to hold pointers and you wouldn't have to allocate a ...
TrayMan's user avatar
  • 303
5 votes
Accepted

String Calculator in C++

A few suggestions (got too long for a comment): don't do the calculation in the constructor, but only when the result is needed (lazily) Do you need a separate method to remove leading and trailing ...
MrBean Bremen's user avatar
5 votes

Simple calculator in python using tkinter

DRY - don't repeat yourself All the button_X functions can be replaced by a single parametrized button(digit: int) function: <...
QuasiStellar's user avatar
  • 2,249
5 votes

Calculation of centrifugal liquid propellant injectors

First of all: thank you! This code is in good shape overall, I wish everything I work with could look like this. Now, a few more comments to complement @J_H answer: Enum? String? You define a ...
SUTerliakov's user avatar
4 votes

Calculation of centrifugal liquid propellant injectors

Even without understanding the matter at hand, or the algos involved, if we look at it purely from a programming view point I believe some properties could be consolidated. A function can return more ...
Kate's user avatar
  • 6,983
4 votes

A very basic calculator in C#

static void Main(string[] args) In C# you can change the Main method's signature to one of the followings depending on your ...
Peter Csala's user avatar
  • 9,279
4 votes

Mathematical calculation of engine fuel injectors

naming Carefully choose identifiers. These are terrific names: GasJetInjector LiquidJetInjector So is Reynolds. But a "similar" prefix is not a good ...
J_H's user avatar
  • 29.2k
4 votes
Accepted

Advanced String Calculator in C++

Great that you have incorporated all review comments! This is not a complete review (I may get back to it if time permits), but there are two things that caught my eye. The parser: You continue ...
MrBean Bremen's user avatar
4 votes

String Calculator in C++

Bug in processing: Power expressions are processed from left to right. 2^3^2 This should be processed as: 2^(3^2) Your code will do it the wrong way: (2^3)^2 But the fix is simple: ...
Loki Astari's user avatar
  • 95.3k
3 votes

Shunting yard calculator in C

double math? .number is a long double. I'd expect ...
chux - Reinstate Monica's user avatar
3 votes

A kinematics (SUVAT) equation solver for micropython

Add docstrings for the functions. Add instructions in the input prompt to let the user know that x means stop. Change: ...
toolic's user avatar
  • 3,691
3 votes

A kinematics (SUVAT) equation solver for micropython

optional values The five flags like “a_known” are overkill. It would be enough to test “if a is None:” Break out a helper that is responsible for obtaining 5 optional values, π substituted. enough ...
J_H's user avatar
  • 29.2k
2 votes

Income Tax Calculator using 1913 tax standards

Make Sure this Meets the Requirements You don’t give a specification for what the algorithm is supposed to do, or any test cases, so it’s impossible to tell whether it has any bugs or not. However, ...
Davislor's user avatar
  • 7,956
2 votes

Income Tax Calculator using 1913 tax standards

Use a data-driven design You have lots of code duplication. You can remove that and simplify your code by using a more data-driven design. First, create a struct ...
G. Sliepen's user avatar
  • 58.3k
2 votes
Accepted

Simple calculator in python using tkinter

Issues Background colors ...
301_Moved_Permanently's user avatar
1 vote

The simple calculator in Ruby

Indent the when cases. You use 2 spaces - good. ...
radarbob's user avatar
  • 7,654

Only top scored, non community-wiki answers of a minimum length are eligible