[Tutor] New to this idea (!)
John Kleinjans
johnk@meta3.net
Sun, 09 May 1999 08:29:44 -0500
At 11:40 PM 4/11/99 EDT, you wrote:
>Sir/Madam,
> I'm fascinated with computer programing, but I have nothing for it to
>do with it right now! Any ideas/suggestions on what to write while
learning?
> I'm using Win 98 (control that grimace, now...it's alright, I know CPR!),
>and, as stated before, have nothing to write! Any suggestions would be
nice,
>and remember that I'm a novice! Thanx!
>
> Emerson B. Lancaster
1) a calculator that takes in two numbers and adds them
2) take two numbers and add, subtract, multiply, and divide
a) check for zero; add "can't divide by zero" message
3) Quadratic formula (Ax^2 + Bx + C = 0):
a) get A, B, and C
b) calcuate D = B^2 - 4*A*C (D for "determinant")
i) if D < 0 then "no real roots"
ii) if D == 0 then x = (your answer here)
iii) if D > 0 then two roots; x1 and x2
c) change 3bi to return the imaginary roots
d) keep getting A, B, and C until the user enters 0 for A
(then it's not quadratic any more)
4) take two aspirin and call me in the morning
- let us know how it goes.
- john