شما این محصولات را انتخاب کرده اید

سبد خرید

ماشین حساب گرافیکی در C++
شناسه پست: 4157
بازدید: 3371

ماشین حساب گرافیکی در C++

				
					#include<iostream>
#include<conio.h>
#include<iomanip.h>


	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<size ; x++) 
			{
				y = (x*a) + b ;
				output << "	|" <<setfill('-') <<  setw(y+200) << "¤                                    " << "( " << x << " , " << y << " ) \n" ;
			}

			cout << "\n		Please Check For The Output File In (.xls) Format \n\n" ;
			cout << "\n\tPress Any Key To Go To Main Menu "  ;
			getch() ;
			goto main ;

		}

		else if((ch=='b')||(ch=='B'))

		{
			quadratic :
			clrscr() ;
			cout << "¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤" ;
			cout << "    ______________________________________________________________________\n" ;
			cout << "    | 								         |\n" ;
			cout << "    | :::::::::::::::::::::   QUADRATIC EQUATION   ::::::::::::::::::::: |\n" ;
			cout << "    | 								         |\n" ;
			cout << "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ;
			cout << "¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤\n" ;

				float a ,b, c, x ,y ;

			cout <<	"\n\tEnter coefficient of 'x^2'\t: " ;
				cin >> 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 << "	|"<<setfill('-') <<  setw(y+100) << "¤                                    ( " << x << " , " << y << " ) \n" ;
			}

			cout << "\t    Please Check For The Output File In (.xls) Format \n\n" ;
			cout << "\n\tPress Any Key To Go To Main Menu "  ;
			getch() ;
			goto main ;

		}

		else if((ch=='c')||(ch=='C'))

		{
			cubic :
			clrscr() ;
			cout << "\n¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤" ;
			cout << "    ______________________________________________________________________\n" ;
			cout << "    | 								         |\n" ;
			cout << "    | :::::::::::::::::::::     CUBIC EQUATION     ::::::::::::::::::::: |\n" ;
			cout << "    | 								         |\n" ;
			cout << "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ;
			cout << "¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤" ;
				float a, b, c, d , x, y ;

			cout <<  "\n\tEnter coefficient of 'x^3'\t: " ;
				cin >> 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|" <<setfill('-')<< setw(y+500) << "¤                                    " << "( " << x << " , " << y << " ) \n" ;
			}

			cout << "		Please Check For The Output File In (.xls) Format \n\n" ;
			cout << "\n\tPress Any Key To Go To Main Menu "  ;
			getch() ;
			goto main ;


		}

		else if(ch=='d'||ch=='D')
		{
			output.close() ;           
			clrscr() ;
			cout << "\n\n\n\n\n\n\n\n\n\t\t\t\tDATA CLEARED" ;
			ofstream output ;	output.open("graph.xlsx" , ios::trunc) ;output.close() ;
			clrscr() ;                  
			cout << "\n\n\n\n\n\n\n\n\t\t\t\tDATA CLEARED" ;
			getch() ; goto main ;       
		}

		else if(ch=='r'||ch=='R')
		{
			clrscr() ;
		}

		else if(ch=='x'||ch=='X')     
		{
      	clrscr() ;
			cout << "\n\n\n\n\n\n\n" ;
			cout << "\t\t\t\f\f\f\f\f\f	\f\f\f       \f\f\f	\f\f\f\f\f\f  \f\f\f\f\f\f  \n" ;
			cout << "\t\t\t\f\f\f\f\f\f	 \f\f\f     \f\f\f    \f\f\f\f\f\f  \f\f\f\f\f\f \n" ;
			cout << "\t\t\t\f\f        \f\f\f   \f\f\f       \f\f      \f\f   \n" ;
			cout << "\t\t\t\f\f         \f\f\f \f\f\f        \f\f      \f\f   \n" ;
			cout << "\t\t\t\f\f\f\f\f\f      \f\f\f\f\f         \f\f      \f\f   \n" ;
			cout << "\t\t\t\f\f         \f\f\f \f\f\f        \f\f      \f\f   \n" ;
			cout << "\t\t\t\f\f        \f\f\f   \f\f\f       \f\f      \f\f   \n" ;
			cout << "\t\t\t\f\f\f\f\f\f   \f\f\f     \f\f\f    \f\f\f\f\f\f    \f\f   \n" ;
			cout << "\t\t\t\f\f\f\f\f\f  \f\f\f       \f\f\f   \f\f\f\f\f\f    \f\f   \n" ;
			getch() ;
			clrscr() ;
			cout << "\n¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤" ;
			cout << "\n" ; for( loop=0; loop<80; loop++)	cout <<"\f" ;
			cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n" ;
			cout << "\n\t\tPARTNERS\tBORLAND® C++\tMICROSOFT©" ;
			cout << "\n" ; for( loop=0; loop<80; loop++)	cout <<"\f" ;
			cout << "\n¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤¸¸.¤°¨°¤" ;
			getch() ;
			clrscr() ;
		}

		else    	  						  	
			{
				cout 	<< "\a\n\n :::::::::::::::::::::::  ERROR:  Invalid Choice  :::::::::::::::::::::::\n\n";

				goto main ;
			}

			output.close() ;
	}

				
			

توضیحات:

نمونه تصویر خروجی برنامه ماشین حساب گرافیکی در C++ :

ماشین حساب گرافیکی در c++

صورت سوال:

ماشین حساب گرافیکی در C++

این برنامه یک ماشین حساب به زبان سی پلاس پلاس را به صورت گرافیکی ارائه می‌کند که با استفاده از آن می‌توانید چند عمل ریاضی (ضرب ، جمع ، تفریق ، تقسیم ، توان و..) را محاسبه نمایید.

این سورس کد در سایت های فارسی زبان به فروش می‌رسد اما این سورس و تمام سورس کد های پیشرفته دیگر را می‌توانید به صورت رایگان از سایت سورسا دریافت نمایید.

شما میتوانید سوالات خود را از طریق ایمیل پشتیبانی – تماس با ما – یا در قسمت نظرات سوال خود را بپرسید.

پست های مرتبط:

اشتراک در
اطلاع از
guest

0 نظرات
قدیمی‌ترین
تازه‌ترین بیشترین رأی
بازخورد (Feedback) های اینلاین
مشاهده همه دیدگاه ها