I made 1 calculator in C++ but it looks preatty simple. If some 1 sees it, he will tell that i made it in 2 mins... How can i change the design and looks of the C++ programs? I mean i want my calculator to look like this 1 but i don't know how to modify it to my needs. Should i try learning C# for that? I need some advise, btw im only a beginner...
Code:
Code:
Code:
#include<iostream> #include<windows.h> #include<mmsystem.h> using namespace std; int main(void) { double n1; double n2; char redo; char operation; do { system("CLS"); // If a person enters y it returns the program to this line. system("TITLE Calculator"); // Title of Program system("Color B4"); // Writing Color cout << "Please enter your desired calculation: " << endl; cin >> n1 >> operation >> n2; switch(operation) { case '+': cout << "Your result is: " << n1 + n2 << endl; break; case '-': cout << "Your result is: " << n1 - n2 << endl; break; case '*': cout << "Your result is: " << n1 * n2 << endl; break; case 'x': cout << "Your result is: " << n1 * n2 << endl; break; case 'X': cout << "Your result is: " << n1 * n2 << endl; break; case '/': if(n2 == 0){ cout << "That is an invalid operation" << endl; }else{ cout << "Your result is: " << n1 / n2 << endl; } break; default: cout << "That is an invalid operation" << endl; break; } cout << "Do you want to calculate something else?(Y/N)" << endl; cin >> redo; }while(redo == 'y' || redo == 'Y'); // || means or. If a person enters y or Y the program starts again and return to the system CLS line system("PAUSE"); return 0; }
Comment