none
need help with homework please RRS feed

  • Question

  • Hallo,

    I have homework but I am verry bad at programing and cant do anything.Can someone please do for me calculator for quadratic equation but do this like a beginner please.PS: I think we lern something about Two-Dimensional Arrays.

    Thanks in advance

    Friday, May 11, 2012 10:48 PM

Answers

All replies

  • Friday, May 11, 2012 11:09 PM
  • Thanks so much!
    Saturday, May 12, 2012 12:53 PM
  • I've just looked at the code snippet - it's ghastly I would avoid it like the plague. E.g. it uses try...catch... to control program flow. Complete with a goto in the catch block to jump back when input is invalid. Try using loop (while or do...until) and TryParse to validate input.

    If you handed that in I'd give it a failing mark (but I'm not your teacher :) ). The only merit it has it that it does validate inputs. It also makes the mistake of saying if the discriminant is negative there are no solutions. Not so. The solutions are complex not real, but they are solutions.

    Arrays are not needed so don't know where they might come in.


    Regards David R
    ---------------------------------------------------------------
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
    Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.

    Saturday, May 12, 2012 3:08 PM