Joined: 28 Aug 2008 Posts: 161 Location: Singapore
Posted: Thu Nov 27, 2008 1:52 am Post subject: Some help needed (Moved. Pls lock or delete)
Code:
#include <iostream.h>
void calc ()
{
float num1;
float num2;
char op;
float ans;
cout << "Calculator!" << endl;
cout << "Enter two numbers and perform an operation." << endl;
cout << "Enjoy!!!!!!!!"
cout << "Enter the first number and press ENTER:" << endl;
cin >> num1;
cout << "Enter the second number and press ENTER:" << endl
cin >> num2;
cout << "You entered " << num1 << "and" << num2 << endl;
cout
<< "Press A followed by ENTER to subtract the two numbers."
<< endl
<< "Press S followed by ENTER to multiply the two numbers."
<< endl
<< "Press M followed by ENTER to multiply the two numbers."
<< endl
<< "Press D followed by ENTER to multiply the two numbers."
<< endl;
cout << "---------------------------" << endl;
cin >> op;
if (op == 65)
{
ans = num1 + num2 ;
}
if (op == 83)
{
ans = num1 - num2;
}
(if op == 77)
{
ans = num1 * num2;
}
if (op == 68)
{
ans = num1 / num2;
}
cout << " The answer is " << and << endl;
cout << "Thanks for using the Calculator." << endl;
cout << "Application now exiting ..." << endl;
}
I'm a 12 year old that trying to learn programming and i need some help. The error reads:
Code: 800A0400
Source: Microsoft VBscript compilation error.
err i saved this as a .vbs using Ultraedit and its supposed to be a calculator or smth( learning from a manual ). Please Help!
Last edited by aasddsaadsasdasdasdassads on Thu Nov 27, 2008 2:19 am; edited 1 time in total
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum