Making GUI for this code or a user interface  and make it as a website  #include #include using namespace std; void codeform(); int main() {     codeform();     int Size;     codeform();     // enter size of vector     cout<<"________________________________________________________________"<>Size;     double arr[Size],Arr[Size],A[Size];     //enter vectores     cout<<"__________________________________"<>arr[i];     }     cout<<"__________________________________"<>Arr[i];     }     cout<<"__________________________________"<>A[i];     }     // display vectors     cout<<"__________________________________"<>choise;     // check entered vector     while(choise=='N')     {         cout<<"what vector do you want to edit"<>value;         if(value>3 || value<1)         {             cout<<"invalid enterd value"<>arr[i];                 }                  break;             }             case(2):             {                 cout<<"_________________________________________"<>Arr[i];                 }                  break;             }             case(3):             {                 cout<<"_________________________________________"<>A[i];                 }                  break;             }         }     cout<<"Is all vector correct or you want to edit: "<>choise;     if (choise=='Y')     {         break;     }     } // assume Y1=X1 double sum=0,temp=0; double M[Size],N[Size],S[Size]; for(int i=0;i0) {     alpha=(-1)*(sum/temp); } else {     alpha=(sum/temp); } // calculate y3=x3+gammay2+betay1 for(int i=0;i0) {     Beta=(-1)*(store/temp); } else {     Beta=(store/temp); } double pocket=0; for(int i=0;i0) {     gamma=(-1)*(pocket/Box); } else {     gamma=pocket/Box; } for(int i=0;i= "<= "<= "<

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Making GUI for this code or a user interface 

and make it as a website 

#include <iostream>
#include <iomanip>
using namespace std;
void codeform();
int main()
{
    codeform();
    int Size;
    codeform();
    // enter size of vector
    cout<<"________________________________________________________________"<<endl;
    cout<<"enter size of Vector(the size of vector is equal to other V2,V3)"<<endl;
    cin>>Size;
    double arr[Size],Arr[Size],A[Size];
    //enter vectores
    cout<<"__________________________________"<<endl;
    cout<<"Enter values of vector 1:"<<endl;
    for(int i=0;i<Size;i++)
    {
        cin>>arr[i];
    }
    cout<<"__________________________________"<<endl;
    cout<<"Enter values of vector 2:"<<endl;
    for(int i=0;i<Size;i++)
    {
        cin>>Arr[i];
    }
    cout<<"__________________________________"<<endl;
    cout<<"Enter values of vector 3:"<<endl;
    for(int i=0;i<Size;i++)
    {
        cin>>A[i];
    }
    // display vectors
    cout<<"__________________________________"<<endl;
    cout<<"your entered vector 1 is: "<<endl;
    for(int i=0;i<Size;i++)
    {
        cout<<arr[i];
        cout<<endl;
    }
    cout<<"__________________________________"<<endl;
    cout<<"your entered vector 2 is: "<<endl;
    for(int i=0;i<Size;i++)
    {
        cout<<Arr[i];
        cout<<endl;
    }
    cout<<"__________________________________"<<endl;
    cout<<"your entered vector 3 is: "<<endl;
    for(int i=0;i<Size;i++)
    {
        cout<<A[i];
        cout<<endl;
    }
    char choise ;
    int value;
    cout<<"Is all vector correct or you want to edit: "<<endl;
    cout<<"please answer Y(Yes) or N(No)"<<endl;
    cin>>choise;
    // check entered vector
    while(choise=='N')
    {
        cout<<"what vector do you want to edit"<<endl;
        cin>>value;
        if(value>3 || value<1)
        {
            cout<<"invalid enterd value"<<endl;
        }
        switch(value)
        {
            case(1):
            {
                cout<<"_________________________________________"<<endl;
                cout<<"enter the new vector"<<endl;
                for(int i=0;i<Size;i++)
                {
                    cin>>arr[i];
                }
                 break;
            }
            case(2):
            {
                cout<<"_________________________________________"<<endl;
                cout<<"enter the new vector"<<endl;
                for(int i=0;i<Size;i++)
                {
                    cin>>Arr[i];
                }
                 break;
            }
            case(3):
            {
                cout<<"_________________________________________"<<endl;
                cout<<"enter the new vector"<<endl;
                for(int i=0;i<Size;i++)
                {
                    cin>>A[i];
                }
                 break;
            }

        }
    cout<<"Is all vector correct or you want to edit: "<<endl;
    cout<<"please answer Y(Yes) or N(No)"<<endl;
    cin>>choise;
    if (choise=='Y')
    {
        break;
    }
    }
// assume Y1=X1
double sum=0,temp=0;
double M[Size],N[Size],S[Size];
for(int i=0;i<Size;i++)
{
    M[i]=arr[i];
}
//calculate Y2=X2+alphaY1
for(int i=0;i<Size;i++)
{
    sum+=M[i]*Arr[i];
}
for(int j=0;j<Size;j++)
{
    {
        temp+=M[j]*M[j];
    }
}
double alpha;
if (sum>0)
{
    alpha=(-1)*(sum/temp);
}
else
{
    alpha=(sum/temp);
}
// calculate y3=x3+gammay2+betay1
for(int i=0;i<Size;i++)
{

    N[i]=Arr[i]+(alpha*M[i]);
}
double store=0;
for(int i=0;i<Size;i++)
{
    store+=M[i]*A[i];
}
double Beta;
if(store>0)
{
    Beta=(-1)*(store/temp);
}
else
{
    Beta=(store/temp);
}
double pocket=0;
for(int i=0;i<Size;i++)
{
    pocket+=N[i]*A[i];
}
double Box=0;
for(int i=0;i<Size;i++)
{
    Box+=N[i]*N[i];
}
double gamma;
if(gamma>0)
{
    gamma=(-1)*(pocket/Box);
}
else
{
    gamma=pocket/Box;
}
for(int i=0;i<Size;i++)
{
    S[i]=A[i]+(gamma*N[i])+(Beta*M[i]);
}
// check for orthogonal
int Orth=0;
for(int i=0;i<Size;i++)
{
    Orth+=M[i]*N[i];
}
int Orthong=0;
for(int i=0;i<Size;i++)
{
    Orthong+=M[i]*S[i];
}
int Orthongonal=0;
for(int i=0;i<Size;i++)
{
    Orthongonal+=N[i]*S[i];
}
// display values y1,y2,y3
cout<<"Y1="<<endl;
for(int i=0;i<Size;i++)
{

    cout<<M[i]<<endl;
}
cout<<"______________________________________________"<<endl;
cout<<"Y2="<<endl;
for(int i=0;i<Size;i++)
{

    cout<<N[i]<<fixed<<setprecision(4)<<endl;
}
cout<<"______________________________________________"<<endl;
cout<<"Y3="<<endl;
for(int i=0;i<Size;i++)
{

    cout<<S[i]<<fixed<<setprecision(4)<<endl;
}
cout<<"______________________________________________________"<<endl;
cout<<"Check Orthongonality by inner product"<<endl;
if(Orth==0&&Orthong==0&&Orthongonal==0)
{
    cout<<"<Y1,Y2>= "<<Orth<<endl;
    cout<<"<Y2,Y3>= "<<Orthong<<endl;;
    cout<<"<Y1,Y2>= "<<Orthongonal<<endl;;
}
    return 0;
}
void codeform()
{
    cout<<"manual solution:"<<endl;
    cout<<"Assume  Y1=X1"<<endl;
    cout<<"        Y2=x2+alphaY1"<<endl;
    cout<<"        Y3=X3+betaY2+gammaY1"<<endl;
    cout<<"we need to find  alpha,beta,gamma"<<endl;

}
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Passing Array as Argument
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education