This is a simple program I made using some void functions and the math.h file thing. I did it in c++. If you want the source code tell me.
It's my first one, I'm looking for feedback, but it says all that in the program so yeah.
Download here:
my math program.zip
Tell me if that download link doesn't work.
I think I did this right, I put it in a winrar zip thing...XD
It should work...right?
I scanned it to make sure there weren't viruses:
Code:Scanners [ArcaVir] 2010-03-20 Found nothing [F-Secure Anti-Virus] 2010-03-21 Found nothing [A-Squared] 2010-03-21 Found nothing [G DATA] 2010-03-21 Found nothing [Avast! antivirus] 2010-03-21 Found nothing [Ikarus] 2010-03-21 Found nothing [Grisoft AVG Anti-Virus] 2010-03-21 Found nothing [Kaspersky Anti-Virus] 2010-03-21 Found nothing [Avira AntiVir] 2010-03-19 Found nothing [ESET NOD32] 2010-03-21 Found nothing [Softwin BitDefender] 2010-03-21 Found nothing [Panda Antivirus] 2010-03-21 Found nothing [ClamAV] 2010-03-20 Found nothing [Quick Heal] 2010-03-19 Found nothing [CPsecure] 2010-03-21 Found nothing [Sophos] 2010-03-21 Found nothing [Dr.Web] 2010-03-21 Found nothing [VirusBlokAda VBA32] 2010-03-19 Found nothing [Frisk F-Prot Antivirus] 2010-03-20 Found nothing [VirusBuster] 2010-03-20 Found nothing
Results 1 to 12 of 12
Thread: My first Math Program
- 21 Mar. 2010 02:58pm #1
My first Math Program
Last edited by ksrocks333; 21 Mar. 2010 at 03:10pm.
LG's Dyke. Enough. Said.
- 21 Mar. 2010 04:50pm #2
- 21 Mar. 2010 04:58pm #3
Can you please help me with what error your getting? Why does it work perfectly for me D:
Does it have to do with the fact I coded in C++?
Source Code:
Code:#include <iostream.h> #include <math.h> using namespace std; const double PI = 3.14159265; void sum(double x, double y) { cout<<x<<"+"<<y<<"="<<x+y<<endl; } void sub(double x, double y) { cout<<x<<"-"<<y<<"="<<x-y<<endl; } void mult(double x, double y) { cout<<x<<"*"<<y<<"="<<x*y<<endl; } void div(double x, double y) { cout<<x<<"/"<<y<<"="<<x/y<<endl; } void mid(double x, double y) { cout<<"The midpoint of "<<x<<" and "<<y<<" is: "<<(x+y)/2<<endl; } void grad(double x, double y) { cout<<"Your grade of "<<x<<" out of "<<y<<" is: "<<(x/y)*100<<"%"<<endl; } int main() { double n1, n2, param, ans1, ans2, ans3, base, expon, rbase, rans, aval; cout<< "-------------------A simple math program by Robyn------------------------------"<<endl; cout<<endl; cout<< "This is my first program using void functions and the math.h file, I had fun "<<endl; cout<< "making this, I would like your opinions of the program. Also, tell me the "<<endl; cout<< "errors you find."<<endl; cout<< "-Robyn"<<endl; cout<<endl; cout<< "**After inputing a number when prompted, hit enter to get answer and continue to"; cout<< "the next function. :D **"<<endl; cout<< "-------------------------------------------------------------------------------"; cout<<endl; cout<< "A few basic math functions."<<endl; cout<< "Enter a number: "; cin>>n1; cout<< "Enter another number: "; cin>>n2; cout<<endl; sum(n1, n2); sub(n1, n2); mult(n1, n2); div(n1, n2); mid(n1, n2); grad(n1, n2); cout<<endl; cout<< "-------------------------------------------------------------------------------"; cout<<endl; cout<< "Now for some more complicated functions."<<endl; cout<< "Enter a degree (1-360): "; cin>>param; ans1 = cos(param*PI/180); cout << "Cosine of " << param << " degrees is " << ans1; cout<<endl; ans2 = sin (param*PI/180); cout << "Sine of " << param << " degrees is " << ans2; cout<<endl; ans3 = tan(param*PI/180); cout << "Tangent of " << param << " degrees is " << ans3<<endl; cout<< "-------------------------------------------------------------------------------"; cout<<endl; cout<< "These are some useful functions to save time"<<endl; cout<< "Enter a base number: "; cin>>base; cout<< "Enter an exponent: "; cin>>expon; cout<<base<<"^"<<expon<<"="<<pow(base, expon); cout<<endl; cout<< "-------------------------------------------------------------------------------"; cout<<endl; cout<<"Square root functions."<<endl; cout<< "Enter a number to find the square root of: "; cin>>rbase; rans = sqrt (rbase); cout<< "The square root of "<<rbase<<" is "<<rans; cout<<endl; cout<< "-------------------------------------------------------------------------------"; cout<<endl; cout<< "Absolute value."<<endl; cout<< "Enter a number (Only negative will show change): "; cin>>aval; cout<< "The absolute value of "<<aval<<" is "<< fabs(aval); cout<<endl; cout<<endl; cout<<"That's all for now. Tell me what you think I could add to the program."; cout<<endl; cout<< "--------This program belongs to Robyn. DONT STEAL (without asking) (lol)-------"; cout<<endl; system ("PAUSE"); return 0; }
EDIT. It's working on both my computers. One of which I've never downloaded any C++ programs before.Last edited by ksrocks333; 21 Mar. 2010 at 05:15pm.
LG's Dyke. Enough. Said.
- 21 Mar. 2010 05:43pm #4
- 21 Mar. 2010 05:53pm #5
The .dll's? i'm not following? It's just supposed to come up as a command prompt thing with a blackground, no skin or buttons or anything. Just basic.
Also, if that's not what a dll is, I didn't add any dll's when I sent it to my other comp, so how did it work on there? D:
Pic of what it should look like:LG's Dyke. Enough. Said.
- 21 Mar. 2010 06:05pm #6
Chad it works... o.O
Even on my screwed up computer...
Make sure you have the C++ Runtime files...
@KsRocks You should program with VB / C# you have potential...
- 21 Mar. 2010 07:50pm #7
- 21 Mar. 2010 09:08pm #8
- 22 Mar. 2010 12:17am #9
- 22 Mar. 2010 12:19am #10
- 22 Mar. 2010 01:00am #11
- 22 Mar. 2010 01:07am #12
Eh, Everyone has there opinions...
Np KsRocks... http://forum.logicalgamers.com/progr...tml#post141479...Last edited by Eternal Darkness; 22 Mar. 2010 at 01:27am.