ماشین حساب گرافیکی در C++
#include
#include
#include
void load()
{
clrscr() ;
int i, o ;
gotoxy(33,9) ; cout << "_________________" ;
gotoxy(32,10) ; cout << "/" ;
gotoxy(49,10) ; cout << "/" ;
gotoxy(35,8) ;cout << "LOADING..." ;
for(o=0; o<3; o++)
{
for(i=0; i<800; i++){ gotoxy(33,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(34,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(35,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(36,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(37,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(38,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(39,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(40,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(41,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(42,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(43,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(44,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(45,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(46,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(47,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(48,10) ; cout << "\f" ; }
for(i=0; i<800; i++){ gotoxy(34,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(35,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(36,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(37,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(38,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(39,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(40,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(41,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(42,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(43,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(44,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(45,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(46,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(47,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(48,10) ; cout << "\b_" ; }
for(i=0; i<800; i++){ gotoxy(49,10) ; cout << "\b_" ; }
}
clrscr();
}
void main()
{
char dummychar ; int o ;
cout << "\n\n\t\t\t\tBYPASS CODE : " ;
dummychar = getch() ;
if(dummychar == '+')
goto main ;
else
goto loading ;
loading:
for( o=0; o<1; o++) load() ;
cout << "\n\n\n\n\n\n\n\n\t\t\t\t BYPASS CODE IS +" ;
cout << "\n\n\t\t\t PRESS ENTER TO CONTINUE..." ;
getch() ;
clrscr() ;
main:
ofstream output ;
output.open("graph.xlsx" , ios::app ) ;
int loop ; const float size = 10 ; char ch ;
clrscr() ;
cout << "\n" ; for( loop=0; loop<80; loop++) cout <<"\f" ;
cout << "\n ______________________________________________________________________\n" ;
cout << " | |\n" ;
cout << " | ««««««««««««««««««««« GRAPHIC CALCULATOR »»»»»»»»»»»»»»»»»»»»» |\n" ;
cout << " | |\n" ;
cout << " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ;
cout << "\n" ; for( loop=0; loop<80; loop++) cout <<"\f" ;
cout << "\n\n" ;
cout << " \n\n\t A--> LINEAR EQUATION \t\t D--> DELETE EXISTING DATA" ;
cout << " \n\n\t B--> QUADRATIC EQUATION \t R--> READ-ME" ;
cout << " \n\n\t C--> CUBIC EQUATION \t\t X--> Exit" ;
ch = getch() ;
if((ch=='a')||(ch=='A'))
{
linear :
clrscr() ;
cout << "¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤" ;
cout << " ______________________________________________________________________\n" ;
cout << " | |\n" ;
cout << " | ::::::::::::::::::::: LINEAR EQUATION ::::::::::::::::::::: |\n" ;
cout << " | |\n" ;
cout << " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n" ;
cout << "¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤\n" ;
float x, y, a, b ;
cout << "\n Enter coefficient of 'x'\t: " ;
cin >> a ;
cout << "\n Enter Constant ('0' if None)\t: " ;
cin >> b ;
cout << "\n Your Equation : y = " << a << "(x^1) + " << b << " \n\n\n" ;
if(a==0)
{
cout << "\n\n ::::::::::::::ERROR: Co-efficient Of 'x^1' Cannot Be Zero:::::::::::::: \n\n" ;
cout << "\n\tPress Any Key To Go To Main Menu " ;
getch() ;
goto main ;
}
output << "\n\n\n Your Equation\t: y = " << a << "(x^1) + " << b << "\n\tZOOM-OUT FOR BETTER VIEW OF CURVE \n\n\n" ;
float nsize = (-1*size) ;
for(x=nsize; x> a ;
cout << "\n\tEnter coefficient of 'x'\t: " ;
cin >> b ;
cout << "\n\tEnter Constant ('0' If None)\t: " ;
cin >> c ;
cout << "\n\tYour Equation\t: y = " << a << "(x^2) + " << b << "(x^1) + " << c <<" \n\n\n";
if(a==0)
{
cout << "\n\n ::::::::::::::ERROR: Co-efficient Of 'x^2' Cannot Be Zero:::::::::::::: \n\n" ;
cout << "\n\tPress Any Key To Go To Main Menu " ;
getch() ;
goto main ;
}
output << "\n\n\n Your Equation : y = " << a << "(x^2) + " << b << "(x^1) + " << c <<"\n\tZOOM-OUT FOR BETTER VIEW OF CURVE \n\n\n" ;
float nsize = (-1*size) ;
for(x=nsize; x<=size; x+=0.5)
{
y = (a*x*x) + (b*x) + c ;
output << " |"<> a ;
cout << "\n\tEnter coefficient of 'x^2'\t: " ;
cin >> b ;
cout << "\n\tEnter coefficient of 'x'\t: " ;
cin >> c ;
cout << "\n\tEnter Constant ('0' If None)\t: " ;
cin >> d ;
cout << "\n\tYour Equation\t: y = " << a << "(x^3) + " << b << "(x^2) + " << c << "(x^1) + " << d << "\n\n\n" ;
if(a==0)
{
cout << "\n\n\t\tERROR: Co-efficient Of 'x^3' Cannot Be Zero\n\n" ;
cout << "\n\tPress Any Key To Go To Main Menu " ;
getch() ;
goto main ;
}
output << "\n\n\n Your Equation : y = " << a << "(x^3) + " << b << "(x^2) + " << c << "(x^1) + " << d << "\n\tZOOM-OUT FOR BETTER VIEW OF CURVE \n\n\n" ;
float nsize = (-1*size) ;
for(x=nsize; x<=size; x+=0.5)
{
y = (a*x*x*x) + (b*x*x) + (c*x) + d ;
output << "\t|" <
توضیحات:
نمونه تصویر خروجی برنامه ماشین حساب گرافیکی در C++ :
صورت سوال:
ماشین حساب گرافیکی در C++
این برنامه یک ماشین حساب به زبان سی پلاس پلاس را به صورت گرافیکی ارائه میکند که با استفاده از آن میتوانید چند عمل ریاضی (ضرب ، جمع ، تفریق ، تقسیم ، توان و..) را محاسبه نمایید.
این سورس کد در سایت های فارسی زبان به فروش میرسد اما این سورس و تمام سورس کد های پیشرفته دیگر را میتوانید به صورت رایگان از سایت سورسا دریافت نمایید.
شما میتوانید سوالات خود را از طریق ایمیل پشتیبانی – تماس با ما – یا در قسمت نظرات سوال خود را بپرسید.