Hi, I'm working on a program that calculates derivative.I'm only doing simple derivatives now but I eventually want to move into sinosodial functions and logarithms and more complicated stuff..this is what I have so far.I would greatly appreciate any critics or suggestions...
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
cout << "welcome!! please choose an options from below\n\n "<<
" 1. press (1) for derivative of constants \\ formula kx^n \n"<<
" 2. press (2) for algebraic derivative expression \\ \n (i.e : use when there is unknown (x)\n ";
A few quick comments:
1. Use code tags when you post, so one can read your code easier, and point out errors by line number
2. For case 1, your derivative formula is incorrect, it should be k*n, not k*x
3. Why do you ask for x in case 2, when you should not use x. You should ask only for k and n and print cout << "\n the derivative is : "<< D << "(x ^ " << d << ")";
ohh yeah..I'll fix that in case 1..thanks and how do I use tag numbers..and in case 2 I used a string..so if the user inputs 'a' 'b' or anything like that other than x..it will print out according to that..I thought maybe it would be convenient...
thanks for the appreciate it...