I need C++ help preez!

Posts 1–9 of 9 · Page 1 of 1
I need C++ help preez!
ok so I made this calculator using basic functions and:
1) When you run calc.cpp it compiles fine, but when you run calc.dev it wont compile
2) if someone can get it running, make it look nice and post it for me
(it will probably be easy for you c++ experts out there)

for those of you virus freaks out there
VirusTotal - Free Online Virus and Malware Scan - Result
C++ Calculator.rarattachment deleted · 6 downloads before removal
What do you mean by it won't compile? Can you post errors?
Quote Originally Posted by treeham View Post
ok so I made this calculator using basic functions and:
1) When you run calc.cpp it compiles fine, but when you run calc.dev it wont compile
2) if someone can get it running, make it look nice and post it for me
(it will probably be easy for you c++ experts out there)
Well that was easy... It's just because your compiling to main methods. YOu can only have one main method in a program so delete main.cpp

The only other problem I found... which really wasn't an error... is that you keep saying the same comment: "Note the colon. Not a semicolon." I kind of got it the first time that it wasn't a semicolon, in fact I wouldn't even need a comment to tell that that colon was not a semicolon... so yeah.
lol, thats because I copied and pasted the code from my tutorial

Quote Originally Posted by Matrix_NEO006 View Post
i dont see anything wrong with this only compile this one 1 cpp file only idk why did u use header or another main.
Well i want to give it an icon, if you know another way pleeeeeeese tell, and also I want a tut on how to make it look nice, like some of the hacks on this site
Quote Originally Posted by treeham View Post
Well i want to give it an icon, if you know another way pleeeeeeese tell, and also I want a tut on how to make it look nice, like some of the hacks on this site
You mean the VB hacks I suppose, well they use windows and buttons and such. The only way to do that in C++ is to learn the Windows API. Or use a nother program to construct cute little buttons for u >_>...
do you know where I might find such a program? O,o
Quote Originally Posted by treeham View Post
do you know where I might find such a program? O,o
if u really want to learn coding extremely efficient then it is best to learn the basics first and then make it look nice.
i dont see anything wrong with this only compile this one 1 cpp file only idk why did u use header or another main.
Code:
 
#include <iostream>

using namespace std;

void Adding();
void Subtracting();
void Multiplying();
void Dividing();

int main()
{
  int input;
  
  cout<<"1. Adding\n";
  cout<<"2. Subtracting\n";
  cout<<"3. Multiplying\n";
  cout<<"4. Dividing\n";
  cout<<"5. Scientific Notation [beta]\n";
  cout<<"6. Exit\n";
  cout<<"Selection: ";
  cin>> input;
  switch ( input ) {
  case 1:    
       {        // Note the colon, not a semicolon 
  long double thisisanumber;
  long double thisisanint;
  long double a;

  cout<<"Please enter a number: ";
  cin>> thisisanumber;
  cin.ignore();
  cout<<"Please enter another number: ";
  cin>> thisisanint;
  cin.ignore();
  a = thisisanumber + thisisanint;
  cin.ignore();
  cout<<"Added together they equal: "<< a <<"\n";
  cin.get();
  break;
}

  case 2:    
       {        // Note the colon, not a semicolon
  long double thisisanumber2;
  long double thisisanint2;
  long double a2;

  cout<<"Please enter a number: ";
  cin>> thisisanumber2;
  cin.ignore();
  cout<<"Please enter another number: ";
  cin>> thisisanint2;
  cin.ignore();
  a2 = thisisanumber2 - thisisanint2;
  cin.ignore();
  cout<<"Subtracted they equal: "<< a2 <<"\n";
  cin.get();
    break;
}

  case 3:     
       {       // Note the colon, not a semicolon 
  long double thisisanumber3;
  long double thisisanint3;
  long double a3;

  cout<<"Please enter a number: ";
  cin>> thisisanumber3;
  cin.ignore();
  cout<<"Please enter another number: ";
  cin>> thisisanint3;
  cin.ignore();
  a3 = thisisanumber3 * thisisanint3;
  cin.ignore();
  cout<<"Multiplied together they equal: "<< a3 <<"\n";
  cin.get();
    break;
}

  case 4:  
       {          // Note the colon, not a semicolon
  long double thisisanumber4;
  long double thisisanint4;
  long double a4;

  cout<<"Please enter a number: ";
  cin>> thisisanumber4;
  cin.ignore();
  cout<<"Please enter another number: ";
  cin>> thisisanint4;
  cin.ignore();
  a4 = thisisanumber4 / thisisanint4;
  cin.ignore();
  cout<<"Divided together they equal: "<< a4 <<"\n";
  cin.get();
    break;
}

  case 5:  
       {          // Note the colon, not a semicolon
  long double Science;

  cout<<"Please enter a number: ";
  cin>> Science;
  cin.ignore();
  cout<<"Scientific Notation:"<< Science <<"";
  cin>> Science;
  cin.get();
    break;
}

  case 6:   
       {         // Note the colon, not a semicolon
    cout<<"Thank you for using Michael's Calculator!\n";
    cin.get();
    break;
}
  default:  
            {          // Note the colon, not a semicolon
    cout<<"Error, bad input, quitting\n";
    cin.get();
    break;
}
  }
  cin.get();
return 0;
}
Insert an icon with reshacker. Also, to make it look nice learn some WINAPI programming , or download VC2008 (WINAPI programming is more pro, and more freedom)
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us