Recent content by squidsk

  1. squidsk

    MHB Clarifying some rules on solving quadratic equation

    There's no guarantee that a quadratic equation has two roots. Further from the last equation the second root would be derived from: $$\sqrt{x - q} + \sqrt{x - p} = 0$$ Which if you aren't dealing with complex numbers, which wasn't given in your original question, only has one possibility of...
  2. squidsk

    Java Java Help with Methods: Solve Your Method Struggles

    Your main problem seems to be you're getting confused about how method declaration (i.e. the bit of code that says what the method does) relates to method usage. In your main method you're calling createPattern with 5 parameters userRows, userColumns, starterStr, secondStr and seperator but your...
  3. squidsk

    MHB My First Algebra Question: Associative Property

    Re: My FIrst Algebra Question No you are missing the fact that the 3 is added to and not multiplied against the result of the bracket. The only way you'd multiply the three (3) from your first example or the four (4) from your second against the brackets is if the addition was replaced by a...
  4. squidsk

    MHB Random picking of 3 digit numbers

    I'll just comment on one thing since this is a common misconception amount people without a math or computing background. There is no real random number generation done by computers. The number picked are pseudo-random and are generated by a mathematical formula. Some of the math formulas used...
  5. squidsk

    MHB C Function Help - Solve Issues with Void Function

    OK, then what's wrong with your solution, other than you haven't called the function in main?
  6. squidsk

    MHB C Function Help - Solve Issues with Void Function

    Look carefully at the function header, the marked line, for your insert0 function you have syntax error on the line.
  7. squidsk

    MHB Random Number Generation Avoiding Human Error in the Keyboard

    Having people type in a product number is not future proof. I never said all products needed to be seen at the same time on the list nor that the list had to be dropdown list. The system should allow for filtering to allow for users to narrow the focus down so that there are fewer products...
  8. squidsk

    MHB Random Number Generation Avoiding Human Error in the Keyboard

    I'd argue your looking at the problem in the wrong way. The real question should be why are you having people type in the part numbers instead of selecting them from a list? That being said bank/credit card numbers do not avoid numbers being side by side on a keyboard or keypad. They likely use...
  9. squidsk

    MHB Writing a recursive math function

    In your code that final return is redundant. You either go into the if or the else block of the conditional and both have a return value so that final return 1; is unreachable code. In the OPs version of the code there are no return statements other than a final return at the end of the function...
  10. squidsk

    MHB Creating Objects within a Class

    You don't want to create objects in the class you want the class to take objects as parameters, specifically one trainer and one athlete objects.
  11. squidsk

    MHB Percentages of success in basketball

    Your correct that the answer is no. In terms of finding an example to show this the easiest way is to find some fraction that is greater than and not equal to 80% where subtracting one from the numerator and one from the denominator is less than and not equal to 80%. In other words find a...
  12. squidsk

    MHB Writing a recursive math function

    There's a critical error on your recursive line. The recursive definition of exponent is given by: $${a}^{n} = a * {a}^{?}$$ What's the ? supposed to be and how does that compare with your recursive definition?
  13. squidsk

    MHB Linked list negative values counting.

    If that code is supposed to count (i.e. do addition) I think you're missing something critical on the line. Also if you're supposed to count only the negative numbers you need to figure out whether the number at that spot in the linked list is negative. Two other questions for you to ponder...
  14. squidsk

    MHB Linked list negative values counting.

    If you're supposed to be counting the number of negatives, where's your code that is doing the counting?
  15. squidsk

    C/C++ How can I create a recursive function to mimic long division in C++?

    You can clean up your solution by inverting the if statement as follows: void longDivision(int dividend, int divisor, int decimalplace){ if (decimalplace > 0) { cout << dividend / divisor; longDivision((dividend % divisor) * 10, divisor, decimalplace - 1); } } This...
Back
Top