Create a custom calculator program, C/C++ Programming

Assignment Help:

//Create a custom calculator program capable of reading the input stream of an expression

//and make basic computations to provide answer.

//Your program will ask the user to enter an expression in one single line

//Use an array to capture the input

//Choose how you want to word the request to the user (bound your request)

//Your calculator should be able to do the following operations individually or in combinaison:

//Multiplication

//Division

//Addition

//Substration

//maximum

//minimum

//square

//squareroot

//solve a system of equations with 2 variables (using 2 dimensional arrays) (max power is 1)

/*

Ax + By = C

Dx + Ey = F

*/

//solve a quadratic equation of the form Ax2 + Bx + C = 0

//Iplement each operation process in a separate function, and use pointers to access values used in computations

//Use the Shunting-yard_algorithm found at https://en.wikipedia.org/wiki/Shunting-yard_algorithm to obtain the

//output string that you would procees further to compute the answer

//Make use of Matrix for the last two operations and access elements using pointers

//Create your program so that the user may enter input indefinitely if needed

//Make use of the program skeleton provided below, debug and develop your code based on it.

//You can expand on it, but you must use all variables and structures defined

//At any time, ask the user he/she would like to continue

//(i.e. continue to prompt user whether to repeat exercise again)

//Print the result at each stage

//Variable declaration

const int SysEqMatrixSize = 3;

const int QuadEqArraySize = 3;

const int sizeOfInputString = 50;

const int sizeOfOutputString = 128;

//Function Declaration *********************

//Initialize the matrix provided with zeros

int myMatrixInit(int **myMatrix, int numRows, int numCols);

int processMyOutput(char *stringForProcess);

int main()

{

    int myRow;

    int myColumn;

    char myInput[sizeOfInputString];

    char myOutput[sizeOfOutputString];

    int myInputLocation;   

    int mySysOfEqu2[SysEqMatrixSize][SysEqMatrixSize];

    int QuadEqu1[QuadEqArraySize];

    int repeat = 0;

    int answer = 0;   

    //Tell the user about your program: What it does and what is expected of user   

        //Ask whether to proceed   

        //Proceed and continue processing as long as the user wants

    while(repeat == 1)

    {

        myMatrixInit(mySysOfEqu2, SysEqMatrixSize, SysEqMatrixSize);

        myMatrixInit(QuadEqu1, QuadEqArraySize, 0);

       //Collect input from user: initialize input array (load all element with \0)

       //Call input function: use scanf("%s", myInput);

       //The 's' argument type after the percent character is for string input

       //character string (not quoted); char * ; pointing to an array of characters

       //large enough for the string and a terminating '\0' that will be added

       //The name of the array is a pointer to the address of that array      

       //Check input: Design the format you want for your input and request it from user

       // if the input violates your requirements, then print error and prompt user again

       //Process execution: You must use the core code structure below

       // You may rearange it elsewhere in a function

       //***********

       //If regular expression, then do this

       //Use the Shunting-yard_algorithm found at https://en.wikipedia.org/wiki/Shunting-yard_algorithm to obtain the

       //output string that you would procees further to compute the answer

       if(shunting_yard(myInput, myOutput))

            answer = processMyOutput(myOutput);

       //Print the result at each stage

 

//Function Definitions ****************

//Passing by address

int myMatrixInit(int **myMatrix, int numRows, int numCols)

{

    //Complete with code

}

int processMyOutput(char *stringForProcess){

    //Complete with code

}

//*****************

//insert other function definition here


Related Discussions:- Create a custom calculator program

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Area under curve, Write a program to find the area under the curve y = f(x)...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

Write a c program to compute the value of a sine wave, Write a C program to...

Write a C program to compute the value of a sine wave from 0 to 2P with an increment of 0.1 radians.   #include stdio.h #include math.h #define pi 3.1415927 void main() {   c

Padovan string, padovan string generation till 40

padovan string generation till 40

Area under curve, Write a program to find the area under the curve y = f(x)...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.   #include float start_poin

Microprocessor programming, I need to program a microprocessor that would h...

I need to program a microprocessor that would have a temperature, gas, humidity and PIR sensor connected to it. It would send the data to a PC via a Zigbee and receive commands fro

Program to make another type of mask, Write a function that has int paramet...

Write a function that has int parameter n, makes another type of mask having n bit 1's from the left most bit and 32- n bit 0's next. The mask is called netmask in this seminar, an

C program, Just need the answers to the following 3 questions. "NO NEED to ...

Just need the answers to the following 3 questions. "NO NEED to write a program compile or run it, do not need it. Just need the answers for the following questions. Example quest

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd