Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how do you add these functions to a code + / * + / * - sin , , con,tan ? ? #include CalFrame.h

how do you add these functions to a code +/*+/*- sin,,con,tan??#include "CalFrame.h""
#include
enum {{
ID__BUTTON_0=_0= wxID__HIGHEST +1,+1,
ID__BUTTON_1,_1,
ID__BUTTON_2,_2,
ID__BUTTON_3,_3,
ID__BUTTON_4,_4,
ID__BUTTON_5,_5,
ID__BUTTON_6,_6,
ID__BUTTON_7,_7,
ID__BUTTON_8,_8,
ID__BUTTON_9,_9,
ID__BUTTON__PLUS,
ID__BUTTON__MINUS,
ID__BUTTON__MULTIPLY,
ID__BUTTON__DIVIDE,
ID__BUTTON__MOD,
ID__BUTTON__DECIMAL,
ID__BUTTON__CLEAR,
ID__BUTTON__ENTER,
ID__BUTTON__TAN,
ID__BUTTON__SIN,
ID__BUTTON__CON,
ID__BUTTON__NEGATIVE,
ID__BUTTON__BACKSPACE
}};
CalFrame::CalFrame((const wxString& title, const wxPoint& pos, const wxSize& size))
: wxFrame((nullptr,, wxID__ANY, title, pos, size))
{{
textControl == new wxTextCtrl((this,, wxID__ANY, "","", wxPoint(10,10),(10,10), wxSize(260,30),(260,30), wxTE__READONLY));
new wxButton((this,, ID__BUTTON_1,"1",_1,"1", wxPoint(10,50),(10,50), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON_2,"2",_2,"2", wxPoint(60,50),(60,50), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON_3,"3",_3,"3", wxPoint(110,50),(110,50), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON_4,"4",_4,"4", wxPoint(10,100),(10,100), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON_5,"5",_5,"5", wxPoint(60,100),(60,100), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON_6,"6",_6,"6", wxPoint(110,100),(110,100), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON_7,"7",_7,"7", wxPoint(10,150),(10,150), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON_8,"8",_8,"8", wxPoint(60,150),(60,150), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON_9,"9",_9,"9", wxPoint(110,150),(110,150), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__DECIMAL, ".",".", wxPoint(10,200),(10,200), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON_0,"0",_0,"0", wxPoint(60,200),(60,200), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__NEGATIVE, "()","(-)", wxPoint(110,200),(110,200), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__PLUS, "+","+", wxPoint(170,50),(170,50), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__MINUS, "","-", wxPoint(220,50),(220,50), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__MULTIPLY, "*","*", wxPoint(170,100),(170,100), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__DIVIDE, "/","/", wxPoint(220,100),(220,100), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__MOD, "%","%", wxPoint(170,150),(170,150), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__SIN, "SIN", wxPoint(220,150),(220,150), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__CON, "CON", wxPoint(170,200),(170,200), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__TAN, "TAN", wxPoint(220,200),(220,200), wxSize(50,50))(50,50));
new wxButton((this,, ID__BUTTON__BACKSPACE, "<","<-", wxPoint(170,250),(170,250), wxSize(100,50))(100,50));
new wxButton((this,, ID__BUTTON__ENTER, "=","=", wxPoint(10,250),(10,250), wxSize(150,50))(150,50));
new wxButton((this,, ID__BUTTON__CLEAR, "CLEAR", wxPoint(10,300),(10,300), wxSize(260,50))(260,50));
Bind((wxEVT__BUTTON, &CalFrame::OnButtonClicked, this, ID__BUTTON_0,_0, ID__BUTTON_9)_9);
Bind((wxEVT__BUTTON, &CalFrame::OnClearButtonClick, this, ID__BUTTON__CLEAR));
}}
void CalFrame::OnButtonClicked((wxCommandEvent& event))
{{
int buttonId == event.GetId()();
wxString buttonText == wxString::Format("%("%c",", buttonId - ID__BUTTON_0+'0')" id="MathJax-Element-240-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">_0+'0')_0+'0');
if ((buttonId >=>= ID__BUTTON_0_0 && buttonId <=<= ID__BUTTON_9){_9){
buttonText == wxString::Format("%("%c",", buttonId - ID__BUTTON_0+'0')" id="MathJax-Element-253-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">_0+'0')_0+'0');
}}
else {{
switch ((buttonId){){
case ID__BUTTON__PLUS:
buttonText ="+"="+";
break;
case ID__BUTTON__MINUS:
buttonText =""="-";
break;
case ID__BUTTON__MULTIPLY:
buttonText ="*"="*";
break;
case ID__BUTTON__DIVIDE:
buttonText ="/"="/";
break;
case ID__BUTTON__MOD:
buttonText ="%"="%";
break;
case ID__BUTTON__DECIMAL:
buttonText ="."=".";
break;
case ID__BUTTON__CLEAR:
buttonText =""="";
break;
case ID__BUTTON__ENTER:
buttonText ="="="=";
break;
case ID__BUTTON__TAN:
buttonText == "TAN";
break;
case ID__BUTTON__SIN:
buttonText == "SIN";
break;
case ID__BUTTON__CON:
buttonText == "CON";
break;
case ID__BUTTON__NEGATIVE:
buttonText ="()"="(-)";
break;
case ID__BUTTON__BACKSPACE:
buttonText ="<"="<-";
break;
}}
}}
textControl>->AppendText((buttonText));
}}
void CalFrame::OnClearButtonClick((wxCommandEvent& event))
{{
textControl>->Clear()();
}}
void CalFrame::HandleNumberButton((int num))
{{
}}
void CalFrame::HandleOpratorButton((char ops))
{{
}}
void CalFrame::Calculat

Step by Step Solution

There are 3 Steps involved in it

Step: 1

To add functions for trigonometric calculations sin cos tan to the provided code for the Vending Mac... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Precalculus Concepts Through Functions A Unit Circle Approach To Trigonometry

Authors: Michael Sullivan

5th Edition

0137945139, 9780137945139

More Books

Students also viewed these Programming questions

Question

4. Analyzing: Breaking something down into its parts.

Answered: 1 week ago

Question

In Problems 5172, establish each identity. csc 2 2 2 1 - cose

Answered: 1 week ago